<?php $__env->startSection('content'); ?>

<div class="card">
    <div class="card-header">
        <?php echo e(trans('global.create')); ?> <?php echo e(trans('cruds.asset.title_singular')); ?>

    </div>

    <div class="card-body">
        <form method="POST" action="<?php echo e(route("admin.assets.store")); ?>" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>
            <input type="hidden" id='status_id' name='status_id' value='33'>
            <div class="form-group">
                <label class="required" for="client_id"><?php echo e(trans('cruds.asset.fields.client')); ?></label>
                <select class="form-control select2 <?php echo e($errors->has('client') ? 'is-invalid' : ''); ?>" name="client_id" id="client_id" required>
                    <?php $__currentLoopData = $clients; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($id); ?>" <?php echo e(old('client_id') == $id ? 'selected' : ''); ?>><?php echo e($entry); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php if($errors->has('client')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('client')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.client_helper')); ?></span>
            </div>


            <div class="form-group">
                <label class="required" for="location_id"><?php echo e(trans('cruds.serviceComplaint.fields.location')); ?></label>
                <select class="form-control select2 <?php echo e($errors->has('location') ? 'is-invalid' : ''); ?>" name="locations[]" id="locations" disabled>
                    <?php $__currentLoopData = $locations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($id); ?>" <?php echo e(old('locations') == $id ? 'selected' : ''); ?>><?php echo e($entry); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php if($errors->has('location')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('location')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.serviceComplaint.fields.location_helper')); ?></span>
            </div>


            <div class="form-group">
                <label class="required" for="commissioning"><?php echo e(trans('cruds.asset.fields.commissioning')); ?></label>
                <input class="form-control <?php echo e($errors->has('commissioning') ? 'is-invalid' : ''); ?>" type="text" name="commissioning" id="commissioning" value="<?php echo e(old('commissioning', '')); ?>" required>
                <?php if($errors->has('commissioning')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('commissioning')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.commissioning_helper')); ?></span>
            </div>
            <div class="row">
            <div class="col-md-4 form-group">
                <label for="air_compressor_id"><?php echo e(trans('cruds.asset.fields.air_compressor')); ?></label>
                <select class="form-control select2 <?php echo e($errors->has('air_compressor') ? 'is-invalid' : ''); ?>" name="air_compressor_id" id="air_compressor_id">
                    <?php $__currentLoopData = $air_compressors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($id); ?>" <?php echo e(old('air_compressor_id') == $id ? 'selected' : ''); ?>><?php echo e($entry); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php if($errors->has('air_compressor')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('air_compressor')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.air_compressor_helper')); ?></span>
            </div>

            <div class="col-md-4 form-group">
                <label for="air_compressor_serial_no"><?php echo e(trans('cruds.asset.fields.air_compressor_serial_no')); ?></label>
                <input class="form-control <?php echo e($errors->has('air_compressor_serial_no') ? 'is-invalid' : ''); ?>" type="text" name="air_compressor_serial_no" id="air_compressor_serial_no" value="<?php echo e(old('air_compressor_serial_no', '')); ?>">
                <?php if($errors->has('air_compressor_serial_no')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('air_compressor_serial_no')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.air_compressor_serial_no_helper')); ?></span>
            </div>
            <div class="col-md-4 form-group">
                <label for="air_compressor_part_no"><?php echo e(trans('cruds.asset.fields.air_compressor_part_no')); ?></label>
                <input class="form-control <?php echo e($errors->has('air_compressor_part_no') ? 'is-invalid' : ''); ?>" type="text" name="air_compressor_part_no" id="air_compressor_part_no" value="<?php echo e(old('air_compressor_part_no', '')); ?>">
                <?php if($errors->has('air_compressor_part_no')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('air_compressor_part_no')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.air_compressor_part_no_helper')); ?></span>
            </div>
            </div>
            <div class="row">
            <div class="col-md-4 form-group">
                <label for="airdryer_id"><?php echo e(trans('cruds.asset.fields.airdryer')); ?></label>
                <select class="form-control select2 <?php echo e($errors->has('airdryer') ? 'is-invalid' : ''); ?>" name="airdryer_id" id="airdryer_id">
                    <?php $__currentLoopData = $airdryers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($id); ?>" <?php echo e(old('airdryer_id') == $id ? 'selected' : ''); ?>><?php echo e($entry); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php if($errors->has('airdryer')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('airdryer')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.airdryer_helper')); ?></span>
            </div>
            <div class="col-md-4 form-group">
                <label for="airdryer_serial_no"><?php echo e(trans('cruds.asset.fields.airdryer_serial_no')); ?></label>
                <input class="form-control <?php echo e($errors->has('airdryer_serial_no') ? 'is-invalid' : ''); ?>" type="text" name="airdryer_serial_no" id="airdryer_serial_no" value="<?php echo e(old('airdryer_serial_no', '')); ?>">
                <?php if($errors->has('airdryer_serial_no')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('airdryer_serial_no')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.airdryer_serial_no_helper')); ?></span>
            </div>
            <div class="col-md-4 form-group">
                <label for="air_dryer_part_no"><?php echo e(trans('cruds.asset.fields.air_dryer_part_no')); ?></label>
                <input class="form-control <?php echo e($errors->has('air_dryer_part_no') ? 'is-invalid' : ''); ?>" type="text" name="air_dryer_part_no" id="air_dryer_part_no" value="<?php echo e(old('air_dryer_part_no', '')); ?>">
                <?php if($errors->has('air_dryer_part_no')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('air_dryer_part_no')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.air_dryer_part_no_helper')); ?></span>
            </div>
        </div>
        <div class="row">
            <div class="col-md-4 form-group">
                <label for="filter_id"><?php echo e(trans('cruds.asset.fields.filter')); ?></label>
                <select class="form-control select2 <?php echo e($errors->has('filter') ? 'is-invalid' : ''); ?>" name="filter_id" id="filter_id">
                    <?php $__currentLoopData = $filters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($id); ?>" <?php echo e(old('filter_id') == $id ? 'selected' : ''); ?>><?php echo e($entry); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php if($errors->has('filter')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('filter')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.filter_helper')); ?></span>
            </div>
            <div class="col-md-4 form-group">
                <label for="filter_serial_no"><?php echo e(trans('cruds.asset.fields.filter_serial_no')); ?></label>
                <input class="form-control <?php echo e($errors->has('filter_serial_no') ? 'is-invalid' : ''); ?>" type="text" name="filter_serial_no" id="filter_serial_no" value="<?php echo e(old('filter_serial_no', '')); ?>">
                <?php if($errors->has('filter_serial_no')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('filter_serial_no')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.filter_serial_no_helper')); ?></span>
            </div>
            <div class="col-md-4 form-group">
                <label for="filter_part_no"><?php echo e(trans('cruds.asset.fields.filter_part_no')); ?></label>
                <input class="form-control <?php echo e($errors->has('filter_part_no') ? 'is-invalid' : ''); ?>" type="text" name="filter_part_no" id="filter_part_no" value="<?php echo e(old('filter_part_no', '')); ?>">
                <?php if($errors->has('filter_part_no')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('filter_part_no')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.filter_part_no_helper')); ?></span>
            </div>
        </div>
        <div class="row">
            <div class="col-md-4 form-group">
                <label for="eco_drain_id"><?php echo e(trans('cruds.asset.fields.eco_drain')); ?></label>
                <select class="form-control select2 <?php echo e($errors->has('eco_drain') ? 'is-invalid' : ''); ?>" name="eco_drain_id" id="eco_drain_id">
                    <?php $__currentLoopData = $eco_drains; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($id); ?>" <?php echo e(old('eco_drain_id') == $id ? 'selected' : ''); ?>><?php echo e($entry); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php if($errors->has('eco_drain')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('eco_drain')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.eco_drain_helper')); ?></span>
            </div>
            <div class="col-md-4 form-group">
                <label for="eco_drain_serial_no"><?php echo e(trans('cruds.asset.fields.eco_drain_serial_no')); ?></label>
                <input class="form-control <?php echo e($errors->has('eco_drain_serial_no') ? 'is-invalid' : ''); ?>" type="text" name="eco_drain_serial_no" id="eco_drain_serial_no" value="<?php echo e(old('eco_drain_serial_no', '')); ?>">
                <?php if($errors->has('eco_drain_serial_no')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('eco_drain_serial_no')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.eco_drain_serial_no_helper')); ?></span>
            </div>
            <div class="col-md-4 form-group">
                <label for="eco_drain_part_no"><?php echo e(trans('cruds.asset.fields.eco_drain_part_no')); ?></label>
                <input class="form-control <?php echo e($errors->has('eco_drain_part_no') ? 'is-invalid' : ''); ?>" type="text" name="eco_drain_part_no" id="eco_drain_part_no" value="<?php echo e(old('eco_drain_part_no', '')); ?>">
                <?php if($errors->has('eco_drain_part_no')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('eco_drain_part_no')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.eco_drain_part_no_helper')); ?></span>
            </div>
        </div>
        <div class="row">
            <div class="col-md-4 form-group">
                <label for="air_receiver_id"><?php echo e(trans('cruds.asset.fields.air_receiver')); ?></label>
                <select class="form-control select2 <?php echo e($errors->has('air_receiver') ? 'is-invalid' : ''); ?>" name="air_receiver_id" id="air_receiver_id">
                    <?php $__currentLoopData = $air_receivers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($id); ?>" <?php echo e(old('air_receiver_id') == $id ? 'selected' : ''); ?>><?php echo e($entry); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php if($errors->has('air_receiver')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('air_receiver')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.air_receiver_helper')); ?></span>
            </div>
            <div class="col-md-4 form-group">
                <label for="air_receiver_serial_no"><?php echo e(trans('cruds.asset.fields.air_receiver_serial_no')); ?></label>
                <input class="form-control <?php echo e($errors->has('air_receiver_serial_no') ? 'is-invalid' : ''); ?>" type="text" name="air_receiver_serial_no" id="air_receiver_serial_no" value="<?php echo e(old('air_receiver_serial_no', '')); ?>">
                <?php if($errors->has('air_receiver_serial_no')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('air_receiver_serial_no')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.air_receiver_serial_no_helper')); ?></span>
            </div>
            <div class="col-md-4 form-group">
                <label for="air_reciever_part_no"><?php echo e(trans('cruds.asset.fields.air_reciever_part_no')); ?></label>
                <input class="form-control <?php echo e($errors->has('air_reciever_part_no') ? 'is-invalid' : ''); ?>" type="text" name="air_reciever_part_no" id="air_reciever_part_no" value="<?php echo e(old('air_reciever_part_no', '')); ?>">
                <?php if($errors->has('air_reciever_part_no')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('air_reciever_part_no')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.air_reciever_part_no_helper')); ?></span>
            </div>
        </div>
    </div>
    <div class="row col-md-12">
            <div class="col-md-4 form-group">
                <label for="commisioned_date"><?php echo e(trans('cruds.asset.fields.commisioned_date')); ?></label>
                <input class="form-control date w-35 <?php echo e($errors->has('commisioned_date') ? 'is-invalid' : ''); ?>" type="text" name="commisioned_date" id="commisioned_date" value="<?php echo e(old('commisioned_date',date('d-m-Y', strtotime('+3 day')))); ?>">
                <?php if($errors->has('commisioned_date')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('commisioned_date')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.commisioned_date_helper')); ?></span>
            </div>
            <div class="col-md-4 form-group">
                <label for="warranty_start_date"><?php echo e(trans('cruds.asset.fields.warranty_start_date')); ?></label>
                <input class="form-control date <?php echo e($errors->has('warranty_start_date') ? 'is-invalid' : ''); ?>" type="text" name="warranty_start_date" id="warranty_start_date" value="<?php echo e(old('warranty_start_date')); ?>">
                <?php if($errors->has('warranty_start_date')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('warranty_start_date')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.warranty_start_date_helper')); ?></span>
            </div>
            <div class="col-md-4 form-group">
                <label for="warranty_end_date"><?php echo e(trans('cruds.asset.fields.warranty_end_date')); ?></label>
                <input class="form-control date <?php echo e($errors->has('warranty_end_date') ? 'is-invalid' : ''); ?>" type="text" name="warranty_end_date" id="warranty_end_date" value="<?php echo e(old('warranty_end_date')); ?>">
                <?php if($errors->has('warranty_end_date')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('warranty_end_date')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.warranty_end_date_helper')); ?></span>
            </div>
        </div>
        <div class="row  col-md-12">
            <div class="col-md-4 form-group">
                <label><?php echo e(trans('cruds.asset.fields.commisioned_by')); ?></label>
                <select class="form-control <?php echo e($errors->has('commisioned_by') ? 'is-invalid' : ''); ?>" name="commisioned_by" id="commisioned_by">
                    <option value disabled <?php echo e(old('commisioned_by', null) === null ? 'selected' : ''); ?>><?php echo e(trans('global.pleaseSelect')); ?></option>
                    <?php $__currentLoopData = App\Models\Asset::COMMISIONED_BY_SELECT; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($key); ?>" <?php echo e(old('commisioned_by', 'fusion') === (string) $key ? 'selected' : ''); ?>><?php echo e($label); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php if($errors->has('commisioned_by')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('commisioned_by')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.commisioned_by_helper')); ?></span>
            </div>
            <div class="col-md-4 form-group">
                <label for="commissioned_engineer_id"><?php echo e(trans('cruds.asset.fields.commissioned_engineer')); ?></label>
                <select class="form-control select2 <?php echo e($errors->has('commissioned_engineer') ? 'is-invalid' : ''); ?>" name="commissioned_engineer_id" id="commissioned_engineer_id">
                    <?php $__currentLoopData = $commissioned_engineers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($id); ?>" <?php echo e(old('commissioned_engineer_id') == $id ? 'selected' : ''); ?>><?php echo e($entry); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php if($errors->has('commissioned_engineer')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('commissioned_engineer')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.commissioned_engineer_helper')); ?></span>
            </div>
        </div>
        <!--
        <div class="row col-md-12">
            <div class="col-md-3 form-group">
                <label for="start_of_work"><?php echo e(trans('cruds.asset.fields.start_of_work')); ?></label>
                <input class="form-control <?php echo e($errors->has('start_of_work') ? 'is-invalid' : ''); ?>" type="text" name="start_of_work" id="start_of_work" value="<?php echo e(old('start_of_work', '')); ?>">
                <?php if($errors->has('start_of_work')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('start_of_work')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.start_of_work_helper')); ?></span>
            </div>
            <div class="col-md-3 form-group">
                <label for="end_of_work"><?php echo e(trans('cruds.asset.fields.end_of_work')); ?></label>
                <input class="form-control <?php echo e($errors->has('end_of_work') ? 'is-invalid' : ''); ?>" type="text" name="end_of_work" id="end_of_work" value="<?php echo e(old('end_of_work', '')); ?>">
                <?php if($errors->has('end_of_work')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('end_of_work')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.end_of_work_helper')); ?></span>
            </div>
            <div class="col-md-3 form-group">
                <label for="travelling_time"><?php echo e(trans('cruds.asset.fields.travelling_time')); ?></label>
                <input class="form-control <?php echo e($errors->has('travelling_time') ? 'is-invalid' : ''); ?>" type="text" name="travelling_time" id="travelling_time" value="<?php echo e(old('travelling_time', '')); ?>">
                <?php if($errors->has('travelling_time')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('travelling_time')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.travelling_time_helper')); ?></span>
            </div>
            <div class="col-md-3 form-group">
                <label for="travelling_k_m"><?php echo e(trans('cruds.asset.fields.travelling_k_m')); ?></label>
                <input class="form-control <?php echo e($errors->has('travelling_k_m') ? 'is-invalid' : ''); ?>" type="text" name="travelling_k_m" id="travelling_k_m" value="<?php echo e(old('travelling_k_m', '')); ?>">
                <?php if($errors->has('travelling_k_m')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('travelling_k_m')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.travelling_k_m_helper')); ?></span>
            </div>
</div>
            <div class="col-md-12 form-group">
                <label for="status_id"><?php echo e(trans('cruds.asset.fields.status')); ?></label>
                <select class="form-control select2 <?php echo e($errors->has('status') ? 'is-invalid' : ''); ?>" name="status_id" id="status_id">
                    <?php $__currentLoopData = $statuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($id); ?>" <?php echo e(old('status_id') == $id ? 'selected' : ''); ?>><?php echo e($entry); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php if($errors->has('status')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('status')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.status_helper')); ?></span>
            </div>
            <div class="col-md-12 form-group">
                <label for="remarks"><?php echo e(trans('cruds.asset.fields.remarks')); ?></label>
                <textarea class="form-control <?php echo e($errors->has('remarks') ? 'is-invalid' : ''); ?>" name="remarks" id="remarks"><?php echo e(old('remarks')); ?></textarea>
                <?php if($errors->has('remarks')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('remarks')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.remarks_helper')); ?></span>
            </div>
            <div class="col-md-12  form-group">
                <label for="pending_work"><?php echo e(trans('cruds.asset.fields.pending_work')); ?></label>
                <textarea class="form-control <?php echo e($errors->has('pending_work') ? 'is-invalid' : ''); ?>" name="pending_work" id="pending_work"><?php echo e(old('pending_work')); ?></textarea>
                <?php if($errors->has('pending_work')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('pending_work')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.pending_work_helper')); ?></span>
            </div>
        -->
            <div class="col-md-12 form-group">
                <label for="asset_photos"><?php echo e(trans('cruds.asset.fields.asset_photos')); ?></label>
                <div class="needsclick dropzone <?php echo e($errors->has('asset_photos') ? 'is-invalid' : ''); ?>" id="asset_photos-dropzone">
                </div>
                <?php if($errors->has('asset_photos')): ?>
                    <div class="invalid-feedback">
                        <?php echo e($errors->first('asset_photos')); ?>

                    </div>
                <?php endif; ?>
                <span class="help-block"><?php echo e(trans('cruds.asset.fields.asset_photos_helper')); ?></span>
            </div>
            <div class="col-md-8 form-group">
                <button class="btn btn-danger lg" type="submit">
                    <?php echo e(trans('global.save')); ?>

                </button>
            </div>
        </form>
    </div>
</div>



<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script>
    var uploadedAssetPhotosMap = {}
Dropzone.options.assetPhotosDropzone = {
    url: '<?php echo e(route('admin.assets.storeMedia')); ?>',
    maxFilesize: 250, // MB
    acceptedFiles: '.jpeg,.jpg,.png,.gif',
    addRemoveLinks: true,
    headers: {
      'X-CSRF-TOKEN': "<?php echo e(csrf_token()); ?>"
    },
    params: {
      size: 250,
      width: 4096,
      height: 4096
    },
    success: function (file, response) {
      $('form').append('<input type="hidden" name="asset_photos[]" value="' + response.name + '">')
      uploadedAssetPhotosMap[file.name] = response.name
    },
    removedfile: function (file) {
      console.log(file)
      file.previewElement.remove()
      var name = ''
      if (typeof file.file_name !== 'undefined') {
        name = file.file_name
      } else {
        name = uploadedAssetPhotosMap[file.name]
      }
      $('form').find('input[name="asset_photos[]"][value="' + name + '"]').remove()
    },
    init: function () {
<?php if(isset($asset) && $asset->asset_photos): ?>
      var files = <?php echo json_encode($asset->asset_photos); ?>

          for (var i in files) {
          var file = files[i]
          this.options.addedfile.call(this, file)
          this.options.thumbnail.call(this, file, file.preview ?? file.preview_url)
          file.previewElement.classList.add('dz-complete')
          $('form').append('<input type="hidden" name="asset_photos[]" value="' + file.file_name + '">')
        }
<?php endif; ?>
    },
     error: function (file, response) {
         if ($.type(response) === 'string') {
             var message = response //dropzone sends it's own error messages in string
         } else {
             var message = response.errors.file
         }
         file.previewElement.classList.add('dz-error')
         _ref = file.previewElement.querySelectorAll('[data-dz-errormessage]')
         _results = []
         for (_i = 0, _len = _ref.length; _i < _len; _i++) {
             node = _ref[_i]
             _results.push(node.textContent = message)
         }

         return _results
     }
}
$(document).ready(function(){
    $('#client_id').change(function(){
        $('#locations').removeAttr('disabled');
        var id = $(this).val();
        $.ajax({
                    type: 'GET',
                    url: "<?php echo e(url('admin/contact-contacts/getLocationName?client_id=')); ?>" + id,
                    success: function(data){
                        var array = data;
                        console.log(array);
                        var s = '<option value="">Please select</option>';
                        array.forEach(function(value){
                            s += '<option value="' + value['id'] + '">' + value['location'] + '</option>'
                        })

                        $('#locations').html(s);
                    }
                })


    })
})

</script>

<script type="text/javascript">

$(document).ready(function(){
    alert('3');

        $('#client_id').change(function(){
            alert('4');
            var id = $(this).val();
            if(id){
                //$('#location_id').attr('disabled', 'disabled');
                $('#locations').removeAttr('disabled');


                $.ajax({
                    type: 'GET',
                    url: "<?php echo e(url('admin/contact-contacts/getLocationName?client_id=')); ?>" + id,
                    success: function(data){
                        var array = data;
                        console.log(array);
                        var s = '<option value="">Please select</option>';
                        array.forEach(function(value){
                            s += '<option value="' + value['id'] + '">' + value['location'] + '</option>'
                        })

                        $('#locations').html(s);
                    }
                })



            }
        })

</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/newrhytha2/public_html/sfm.fusionengg.in/resources/views/admin/assets/create.blade.php ENDPATH**/ ?>