@extends('layouts.dashboard')

@section('page_title')
  Contract
@endsection

@section('page_header_title')
HR
@endsection



@section('page_body')

{{ Breadcrumbs::render('contractassignment',Crypt::encrypt($contract_id)) }}

<div class="row row-cards row-deck">
  <div class="col-6">
                <div class="card">

                  {{ Form::open(array('route' => 'allowance.assign', 'class' => 'cls_form', 'id' => 'form_assign_allowance')) }}
                       <div class="card-header">
              <div class = "col-md-11">


      <h3 class="card-title">Assign Allowance</h3>
    </div>

        <div class = "col-md-1">
                <i style = "float:right; display:none;" class="btn btn-primary btn-sm cls_submit cls_assign_allowance" content = "assign selected allowances"> Assign</i>  
        </div>
    </div>

    <div class="card-status card-status-left bg-blue">
    </div>

    <div class="table-responsive table-height">

    	<table class="table table-hover table-outline table-vcenter text-nowrap card-table ">
       <input type ="hidden" name="contract_id" value = {{Crypt::encrypt($contract_id)}} />
    		<thead>
                        <tr>
                           <th><input type="checkbox" onchange="selectAllAllowance(event,this)"/></th>
                          <th>Title</th>
                          <th>Type</th>
                          <th>Percentage</th>
                          <th>Amount</th>
                   
                        
                        </tr>
                      </thead>

                      <tbody>


                          @foreach($new_allowances as $rows)

                             <td><input onchange="verifyAllowanceChecks();" type="checkbox" class="checked_allowance"  name = "allowance_id[]" value= "{{Crypt::encrypt($rows->id)}}"/></td>
                            <td>{{$rows->title}}</td>
                            <td>{{$rows->type}}</td>
                             <td>{{$rows->percentage}}</td>
                              <td>{{$rows->amount}}</td>
                             
                          </tr>

                          @endforeach

                      	

                      </tbody>
    	            </table>
                  </div>
                </div>

                {{ Form::close() }}
              </div>

                <div class="col-6">
                <div class="card">
          {{ Form::open(array('route' => 'asset.assign', 'class' => 'cls_form', 'id' => 'form_assign_asset')) }}
                    <div class="card-header">
              <div class = "col-md-11">

      <h3 class="card-title">Assign Asset</h3>
    </div>

        <div class = "col-md-1">
                <i style = "float:right; display:none;" class="btn btn-primary btn-sm cls_submit cls_assign" content = "assign selected assets"> Assign</i>  
        </div>
    </div>


    

    <div class="card-status card-status-left bg-blue">
    </div>

    <div class="table-responsive table-height">
         <input type ="hidden" name="contract" value = {{Crypt::encrypt($contract_id)}} />

      <table class="table table-hover table-outline table-vcenter text-nowrap card-table ">

        <thead>
                        <tr>
                        <th><input type="checkbox" onchange="selectAllAsset(event,this)"/></th>
                          <th>Code</th>
                          <th>Name</th>
                          <th>Type</th>
                          <th>Description</th>

                    
                        
                        </tr>
                      </thead>

                      <tbody>

                          @foreach($new_assets as $rows)

                          <tr>
                             <td><input onchange="verifyAssetChecks();" type="checkbox" class="checked_asset"  name = "asset_id[]" value= "{{Crypt::encrypt($rows->id)}}"/></td>
                            <td>{{$rows->asset_code}}</td>
                            <td>{{$rows->name}}</td>
                             <td>{{$rows->type}}</td>
                              <td>{{$rows->description}}</td>
                            
                          </tr>

                          @endforeach
                        

                      </tbody>
                  </table>
                  </div>
                </div>

                {{ Form::close() }}
              </div>
            </div>
    



@endsection

@section('page_modal')
  @include('hr.contract.modals.asset_form')
@endsection

@section('page_script')
 @include('hr.scripts.assignment')  
@endsection
