<?php $__env->startSection('page_title'); ?>
	Manage Employee
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_header_title'); ?>
	Manage Employee
<?php $__env->stopSection(); ?>



<?php $__env->startSection('page_body'); ?>
<?php echo e(Breadcrumbs::render('employee')); ?>


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

					    <?php if(Auth::user()->hasAnyPermission(['All','Add Employee'])): ?>

					     <button  class="float-right btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#md_add_employee" ><i class="fa fa-plus"></i></button> &nbsp;&nbsp;
             <?php endif; ?>

					     <h3 class="card-title">Add Employee</h3>
					  </div>

                	<div class="card-status card-status-left bg-blue"></div>
                  <div class="table-responsive table-height">
                    <table class="table table-hover table-sm table-outline table-vcenter text-nowrap card-table cls_datatable">
                      <thead>
                        <tr>

                          <th>#</th>
                          <th>Name</th>
                          <th>Father Name</th>
                          <th>Blood Group</th>
                          <th>Cnic #</th>
                          <th>Email </th>
                          <th>Status</th>
                          <th>Contact #</th>
                          <th>Type</th>
                          <th>Designation</th>
                          <th>Department</th>
                          <th>Branch</th>
                          <th></th>
                          
                          <th><i class="icon-settings"></i></th>
                        </tr>
                      </thead>
                      <tbody>
                      	<?php if(isset($user_list)): ?>
                          <?php ($pass_data = []); ?>
                      		<?php $__currentLoopData = $user_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php if(Auth::user()->id != $rows->id): ?>

                              <?php ($employee_department = $user->getUserDepartment($rows->id)); ?>
                              <?php ($code = ''); ?>
                              <?php ($department = ''); ?>


                            <?php if(isset($employee_department->department->id)): ?>
                              <?php ($code = $employee_department->department->code); ?>
                              <?php ($department = $employee_department->department->name); ?>
                            <?php endif; ?>



                     <?php (
                                 $pass_data = array(
                                  'user_id'      			   => Crypt::encrypt($rows->id),
                                  'full_name'        	   => $rows->name,
                                  'employee_type'         => $rows->employee_type,
                                  'father_name'           => $rows->fname,
                                  'cnic'    		         => ($rows->cnic),
                                  'email'       	       => $rows->email,
                                  'gender'               => $rows->gender,
                                  'blood_group'          => $rows->blood_group,
                                  'contact'    	         => $rows->contact,
                                  'salary_mode'          => $rows->salary_mode,
                                  'temporary_address'         => $rows->temp_address,
                                  'permanent_address'          => $rows->per_address,
                                  'bank_branch'          => $rows->bank_branch,
                                  'bank_name'            => $rows->bank_name,
                                  'account_no'           => $rows->account_no,
                                  'status'               => $rows->status,
                                  'designation_id'       => Crypt::encrypt($rows->designation->id),
                                  'department'           => trim($code.' '.$department),
                                  EF::branchWhiteLabel()['module']  	           => trim($rows->branch->code.' '.$rows->branch->name),
                                )
                            ); ?>


                      			<tr <?php if($rows->status === 'Deactive'): ?> style="background-color: #f7dfdf" <?php endif; ?>>
                      				<td><?php echo e($loop->iteration); ?></td>

                      				<td><?php echo e(ucfirst($rows->name)); ?></td>

                      				<td><?php echo e(ucfirst($rows->fname)); ?></td>

                              <td><?php echo e($rows->blood_group); ?></td>

                      				<td><?php echo e(($rows->cnic)); ?></td>

                              <td><?php echo e(EF::filterEmail($rows->email)); ?></td>

                              <td><?php echo e($rows->status); ?></td>

                      				<td><?php echo e($rows->contact); ?></td>

                              <td><?php echo e($rows->employee_type); ?></td>

                              <td><?php echo e(ucfirst($rows->designation->title)); ?></td>

                              <td><?php if(isset($employee_department->id)): ?><?php echo e($employee_department->department->code); ?> <?php echo e($employee_department->department->name); ?><?php endif; ?></td>

                      				<td><?php echo e($rows->branch->name); ?></td>

                              <td><a href="<?php echo e(EF::getFile($rows->employee_form)); ?>">View Document</a></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">

                                        <?php if(Auth::user()->hasAnyPermission(['All','Employee Profile Document'])): ?>
                                        <a  href="<?php echo e(route('employeeprofile',['id' => Crypt::encrypt($rows->id)])); ?>" class="dropdown-item" ><i class="dropdown-icon fa fa-file"></i>Employee Profile</a>
                                      <?php endif; ?>

                                 <?php if(Auth::user()->hasAnyPermission(['All','View Employee Assets'])): ?>
                                      <a onclick="getAssignPermission(event,this)" href="<?php echo e(route('show.assign_permission',['id' => Crypt::encrypt($rows->id)])); ?>" class="dropdown-item " content="remove employee"><i class="dropdown-icon fa fa-cog"></i> Assign Permission</a>
                                      <?php endif; ?>

                                      




  <?php if(Auth::user()->hasAnyPermission(['All','Update Employee'])): ?>
			                                <a onclick="update(event,'<?php echo e(json_encode($pass_data)); ?>','form_update_employee','md_update_employee'); checkSalaryMode('<?php echo e($rows->salary_mode); ?>','bank_section')" href="javascript:void(0)" class="dropdown-item" data-toggle="modal" data-target="#md_update_employee"><i class="dropdown-icon fa fa-edit"></i> Update</a>
                                      <?php endif; ?>


  <?php if(Auth::user()->hasAnyPermission(['All','View Employee Assets'])): ?>
                                    <a  href="<?php echo e(route('employee.assets',['id' => Crypt::encrypt($rows->id)])); ?>" content="View Details" class="dropdown-item"><i class="dropdown-icon fa fa-eye "></i> View Assets</a>
                                      <?php endif; ?>

			                              </div>
			                            </div>
			                         </td>
                      			</tr>
                            <?php endif; ?>


                      		<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                      	<?php endif; ?>

                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
          </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_modal'); ?>
	<?php echo $__env->make('user.modals.add_employee', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('user.modals.update_employee', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('user.modals.assign_department', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

  <?php echo $__env->make('permission.modals.assign_permission', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>



<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_script'); ?>
	<?php echo $__env->make('scripts.permission', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ubuntu/rebmgisplus/skylite/resources/views/user/manage_employee.blade.php ENDPATH**/ ?>