@extends('layouts.master')
@section('page_title')
    @if(isset($page_title))
        {{ $page_title }}
    @endif
@endsection
@section('content')
  <div class="">
    <div class="page-title">
      <div class="title_left" style="width:800px !important;">
        <ol class="breadcrumb">
          <li><a href="{!! url('dashboard') !!}">Dashboard</a></li>
          <li class="active"><a href="{!! url('staffmembers') !!}">Team Members</a></li>
          <li class="active">Update Team Member Details</li>
        </ol>
      </div>
    </div>
    <div class="clearfix"></div>
      <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
          <div class="x_panel">
              <div class="x_title">
                Update Team Member Details
                @include('commons.notifications')
                <div class="clearfix"></div>
              </div>
              {{-- start of content --}}
              <div class="x_content">
              <br>
                  {!! Form::model($staff_member, [
                    'method' => 'PATCH',
                    'url' => ['staffmembers', $staff_member->id],
                    'class' => 'form-horizontal form-label-left'
                  ]) !!}
                  <div class="row">

                    <div class="col-md-6">
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="staffName">Name</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('staffmembers') ? 'has-error' : ''}}">
                          {!! Form::text('name', old('name'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Full Name' , 'id' => 'staffName', 'required' => 'true']) !!}
                          {!! $errors->first('name', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="gender">Gender</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('gender') ? 'has-error' : ''}}">              
                          {!! Form::select('gender', $gender_arr, old('gender'),  ['class' => 'form-control', 'placeholder'=>'Select Gender' , 'id' => 'gender', 'required' => 'true']) !!}
                          {!! $errors->first('gender', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="phone">Phone</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('phone') ? 'has-error' : ''}}">
                          {!! Form::text('phone', old('phone'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Mobile Number' , 'id' => 'phone', 'required' => 'true']) !!}
                          {!! $errors->first('phone', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="email">Email</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('email') ? 'has-error' : ''}}">
                          {!! Form::text('email', old('email'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Email Address' , 'id' => 'email', 'required' => 'true']) !!}
                          {!! $errors->first('email', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="staffName">Personal Email</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('personalEmail') ? 'has-error' : ''}}">
                          {!! Form::text('personal_email', old('personal_email'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Personal Email' , 'id' => 'personalEmail', 'required' => 'true']) !!}
                          {!! $errors->first('personal_email', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="departmentID">Department</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('name') ? 'has-error' : ''}}">              
                          {!! Form::select('department_id', $departments, old('department_id'),  ['class' => 'form-control', 'placeholder'=>'Select Department' , 'id' => 'departmentID', 'required' => 'true']) !!}
                          {!! $errors->first('department_id', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>              
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="status">Status</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('status') ? 'has-error' : ''}}">
                          {!! Form::select('status', $status ,old('status'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select Status ' , 'id' => 'status', 'required' => 'true']) !!}
                          {!! $errors->first('status', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="locationCountry">Country</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('network') ? 'has-error' : ''}}">
                          {!! Form::select('location_country', $countries, old('location_country'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select Country ' , 'id' => 'locationCountry', 'required' => 'true']) !!}
                          {!! $errors->first('location_country', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>                                     
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="hireDate">Hire Date</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('hire_date') ? 'has-error' : ''}}">
                          {!! Form::text('hire_date', old('hire_date'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Hire Date' , 'id' => 'hireDate']) !!}
                          {!! $errors->first('hire_date', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                    </div>
                    <div class="col-md-6">
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="emergencyContactPerson">Emergency Contact Person</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('emergency_contact_person') ? 'has-error' : ''}}">
                          {!! Form::text('emergency_contact_person', old('pemergency_contact_person'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Contact Person name' , 'id' => 'emergencyContactPerson', 'required' => 'true']) !!}
                          {!! $errors->first('emergency_contact_person', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="emergencyContactPhone">Emergency Contact Phone</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('emergency_contact_phone') ? 'has-error' : ''}}">
                          {!! Form::text('emergency_contact_phone', old('emergency_contact_phone'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Contact Number' , 'id' => 'emergencyContactPhone', 'required' => 'true']) !!}
                          {!! $errors->first('pemergency_contact_phonehone', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="knownHealthCondition">Known Health Condition(s)</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('known_health_condition') ? 'has-error' : ''}}">
                          {!! Form::text('known_health_condition', old('known_health_condition'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Health Condition' , 'id' => 'knownHealthCondition']) !!}
                          {!! $errors->first('known_health_condition', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="bloodGroup">Blood Group</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('blood_group') ? 'has-error' : ''}}">
                          {!! Form::text('blood_group', old('blood_group'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Blood Group' , 'id' => 'bloodGroup']) !!}
                          {!! $errors->first('blood_group', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-md-12">
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-12 col-sm-12 col-xs-12">
                          <button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Submit</button>
                        </div>
                      </div>
                    </div>
                  </div>     
                  {!! Form::close() !!}
                
                {{-- end of x_content --}}
              </div>
              {{-- end of x_panel --}}
            </div>
          </div>
          
        </div>

@endsection

@section('javascript')
<script type="text/javascript">
  $(function(){
    $('select').select2();

  });
</script>
@endsection
