@extends('layouts.dashboard')

@section('page_title')
 Allowances
@endsection

@section('page_header_title')
HR
@endsection



@section('page_body')
{{ Breadcrumbs::render('asset') }}
	<div class="row row-cards row-deck">
  <div class="col-12">
                <div class="card">
                	  <div class="card-header">		    

      @if(Auth::user()->hasAnyPermission(['All','Add Asset']))
					     <button  class="float-right btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#md_add_asset"><i class="fa fa-plus"></i></button> &nbsp;&nbsp;
               @endif

					     <h3 class="card-title">Add Asset</h3>
					  </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-sm table-vcenter text-nowrap card-table cls_datatable">
                      <thead>
                        <tr>
                          
                          <th>#</th>
                          <th>Asset Code</th>
                          <th>Name</th>
                          <th>Type</th>
                          <th>Description</th>
                          <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>
                          
                        </tr>
                      </thead>
                      <tbody>
                        @if(isset($asset_list))
                        @foreach($asset_list as $rows)

                        @php($pass_data = [])
                        
           @php(
                      $pass_data = array(
          'asset'                     => Crypt::encrypt($rows->id),
          'type'                      => $rows->type,
          'name'                      => $rows->name,
          'code'                      => $rows->asset_code,
          'description'               => $rows->description,
          
                        )
                        )
                        <tr>
                          <td>{{$loop->iteration}}</td>
                          <td>{{$rows->asset_code}}</td>
                          <td>{{ucwords($rows->name)}}</td>
                          <td>{{ucwords($rows->type)}}</td>
                          <td>{{ucwords($rows->description)}}</td>
                       

                                      <td class="text-center">

                                  <div class="item-action dropdown">
                                    <a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fa fa-list-ul"></i></a>
                                    <div class="dropdown-menu dropdown-menu-right">
                                       <a href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon fa fa-cogs"></i> Action</a>
                                      <div class="dropdown-divider"></div>

                                  @if(Auth::user()->hasAnyPermission(['All','Update Asset']))
                                      <a onclick="update(event,'{{json_encode($pass_data)}}','form_update_asset','md_update_asset')" href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon fa fa-edit"></i> Update </a>
                                      @endif
                                     
                                     
                                     
                                    </div>
                                  </div>
                               </td>
                        </tr>

                        @endforeach

                        @endif
               
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
          </div>

@endsection

@section('page_modal')

  @include('hr.asset.modals.add_asset')
  @include('hr.asset.modals.update_asset')

@endsection

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