
<div class="modal fade" id="md_add_asset" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  {{ Form::open(array('route' => 'asset.store', 'class' => 'cls_form', 'id' => 'form_add_asset')) }}
  <div class="modal-dialog modal-md" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add Asset</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true"></span>
        </button>
      </div>
      <div class="modal-body">
        <div class = "card">
          <div class ="card-body form-fieldset">
          <div class="row">
               <div class="col-sm-6">
            <label class="label-color">Code: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('code',":message") }}</small>

            <div class="input-group mb-3">
          
              {{Form::text('code', '', ['class' => 'form-control form-control-sm  cls_required ', 'placeholder' => 'Asset Code' , 'aria-label' => 'Default' , 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>
        

                 <div class="col-sm-6">
            <label class="label-color">Name: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('name',":message") }}</small>

            <div class="input-group mb-3">
          
              {{Form::text('name', '', ['class' => 'form-control form-control-sm  cls_required ', 'placeholder' => 'Asset Name' , 'aria-label' => 'Default' , 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>

                     <div class="col-sm-12">
              <label class="label-color"> Select Asset Type : <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('asset_type',":message") }}</small>

            <div class="input-group mb-3">
              <select name="asset_type" class="form-control form-control-sm cls_selection type_list" onChange = "setAssetType(event,this)">
                  <option value="0">Select Asset Type</option>

                 @foreach($types as $rows)
                 <option value="{{$rows->type}}">{{$rows->type}}
                 </option>
                 @endforeach
                 <option value = "Other">Other </option>
                </select>
            </div>
          </div>

          <div class="col-sm-12 type_div" style = "display:none;">
               <label class="label-color"> Type: <i style = "color:red;"></i></label>
            <small class="form-errors pull-right " value="*">{{ $errors->first('type',":message") }}</small>
            <div class="input-group mb-3">
             
              {{Form::Text('type', '', ['class' => 'form-control form-control-sm  type', 'placeholder' => 'Type', 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>

                    <div class="col-sm-12">
            <label class="label-color">Description: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('description',":message") }}</small>

            <div class="input-group mb-3">
          
              {{Form::textarea('description', '', ['class' => 'form-control form-control-sm  cls_required ', 'placeholder' => 'Description' , 'aria-label' => 'Default' , 'aria-describedby' => 'inputGroup-sizing-default','rows'=> '2'])}}
            </div>
          </div>

        </div>
          </div>
        </div> 
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-primary cls_submit" content="add asset">Add Asset</button>
      </div>
    </div>
  </div>
  {{ Form::close() }}
</div>