<!-- Modal ADD LEAVE -->

<div class="modal fade" id="md_add_leave" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" onchange="addLeaveForm(event,this)">
  {{ Form::open(array('route' => 'leave.store', 'class' => 'cls_form','id'=>'form_add_leave')) }}
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add Leave</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"> Select Employee : <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('employee',":message") }}</small>

            <div class="input-group mb-3">
              <select name="employee" class="form-control form-control-sm cls_selection employee_list">
                  <option value="{{Crypt::encrypt(0)}}">Select Employee</option>

                 @foreach($employee_list as $rows)
                 <option value="{{Crypt::encrypt($rows->id)}}">{{$rows->name}}
                 </option>
                 @endforeach
                </select>
            </div>
          </div>

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

              <div class="input-group mb-3">
                <select name="type" class="form-control form-control-sm cls_selection" onchange="showLeaveType(event,this)">
                    
                    <option value="{{Crypt::encrypt(0)}}">Select Type</option>

                    @foreach (EF::getLeavesTypeList() as $rows)

                    <option value="{{$rows}}">{{$rows}}</option>

                    @endforeach
                   
                </select>
              </div>
            </div>

            <div class="col-sm-6 permanent-section hid">
              <label class="label-color"> Start Date : <i style = "color:red;"></i></label>
            <small class="form-errors pull-right req" value="">{{ $errors->first('start_date',":message") }}</small>

            <div class="input-group mb-3">
              {{Form::date('start_date', '', ['class' => 'form-control hidden form-control-sm cls_date', 'placeholder' => 'Start Date' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>


          <div class="col-sm-6 permanent-section hid">
              <label class="label-color"> End Date : <i style = "color:red;"></i></label>
            <small class="form-errors pull-right req" value="">{{ $errors->first('end_date',":message") }}</small>

            <div class="input-group mb-3">
              {{Form::date('end_date', '', ['class' => 'form-control hidden form-control-sm cls_date', 'placeholder' => 'End Date' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>


          <div class="col-sm-12 short-section hid">
              <label class="label-color"> Number Of Hours : <i style = "color:red;"></i></label>
            <small class="form-errors pull-right req" value="">{{ $errors->first('no_of_hours',":message") }}</small>

            <div class="input-group mb-3">
              {{Form::number('no_of_hours', '', ['class' => 'form-control hidden form-control-sm cls_required', 'placeholder' => 'Number Of Hours' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>


          


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

            <div class="input-group mb-3">
              {{Form::textarea('reason', '', ['class' => 'form-control form-control-sm cls_required', 'placeholder' => 'Reason' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'rows' => 4, 'cols' => 54])}}
             

            </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 leave">Add Leave</button>
      </div>
    </div>
  </div>
  {{ Form::close() }}
</div>
<!-- END MODAL ADD LEAVE -->