
<?php $__env->startSection('content'); ?>
<?php $__env->startSection('title'); ?>
<?php echo app('translator')->getFromJson('payment.my_payroll'); ?>
<?php $__env->stopSection(); ?>
	<div class="container-fluid">
		<div class="row bg-title">
			<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
			   <ol class="breadcrumb">
					<li class="active breadcrumbColor"><a href="<?php echo e(url('dashboard')); ?>"><i class="fa fa-home"></i> <?php echo app('translator')->getFromJson('dashboard.dashboard'); ?></a></li>
					<li><?php echo $__env->yieldContent('title'); ?></li>
				</ol>
			</div>	

		</div>
					
		<div class="row">
			<div class="col-sm-12">
				<div class="panel panel-info">
					<div class="panel-heading"><i class="mdi mdi-table fa-fw"></i><?php echo app('translator')->getFromJson('payment.my_payroll'); ?></div>
					<div class="panel-wrapper collapse in" aria-expanded="true">
						<div class="panel-body">
							<?php if(count($results)>0): ?>
							<div class="row">
								<div class="col-md-12 text-right">
									<h4 style="">
										<a class="btn btn-success" style="color: #fff" href="<?php echo e(URL('downloadMyPayroll')); ?>"><i class="fa fa-download fa-lg" aria-hidden="true"></i> <?php echo app('translator')->getFromJson('common.download'); ?> PDF</a>
									</h4>
								</div>
							</div>
							<?php endif; ?>
							<div class="table-responsive">
								<table  id="" class="table table-bordered">
									<thead>
										 <tr class="tr_header">
											<th><?php echo app('translator')->getFromJson('common.serial'); ?></th>
											<th><?php echo app('translator')->getFromJson('common.month'); ?></th>
											<th><?php echo app('translator')->getFromJson('employee.photo'); ?></th>
											<th><?php echo app('translator')->getFromJson('common.employee_name'); ?></th>
											<th><?php echo app('translator')->getFromJson('salary_sheet.pay_grade'); ?></th>
											<th><?php echo app('translator')->getFromJson('paygrade.basic_salary'); ?></th>
											<th><?php echo app('translator')->getFromJson('salary_sheet.gross_salary'); ?></th>
											<th><?php echo app('translator')->getFromJson('common.status'); ?></th>
											<th><?php echo app('translator')->getFromJson('common.action'); ?></th>
										</tr>
									</thead>
									<tbody>
										<?php if(count($results)>0): ?>
											<?php echo $sl=null; ?>

											<?php $__currentLoopData = $results; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
												<tr>
													<td style="width: 100px;"><?php echo ++$sl; ?></td>
													<td>
                                                        <?php 
															$monthAndYear   = explode('-',$value->month_of_salary);

															$month = $monthAndYear[1];
															$dateObj   = DateTime::createFromFormat('!m', $month);
															$monthName = $dateObj->format('F');
															$year = $monthAndYear[0];

															$monthAndYearName = $monthName." ".$year ;
															echo $monthAndYearName;
                                                        ?>
													</td>
													<td>
														<?php if($value->employee->photo != ''): ?>
															<img style=" width: 70px; " src="<?php echo asset('uploads/employeePhoto/'.$value->employee->photo); ?>" alt="user-img" class="img-circle">
														<?php else: ?>
															<img style=" width: 70px; " src="<?php echo asset('admin_assets/img/default.png'); ?>" alt="user-img" class="img-circle">
														<?php endif; ?>
													</td>
													<td><?php if(isset($value->employee->first_name)): ?><?php echo $value->employee->first_name; ?> <?php echo e($value->employee->last_name); ?><?php endif; ?></td>
													<td><?php if(isset($value->employee->payGrade->pay_grade_name)): ?><?php echo $value->employee->payGrade->pay_grade_name; ?> <?php endif; ?></td>
													<td><?php echo $value->basic_salary; ?></td>
													<td><?php echo $value->gross_salary; ?></td>
													<td>
														<span class="label label-success"><?php echo app('translator')->getFromJson('salary_sheet.paid'); ?></span>
													</td>
													<td style="width: 100px">
															<a href="<?php echo e(url('myPayroll/generatePayslip',$value->salary_details_id)); ?>" target="_blank"><button  class="btn btn-success waves-effect waves-light"><span><?php echo app('translator')->getFromJson('salary_sheet.generate_payslip'); ?></span> </button></a>
													</td>

												</tr>
											<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
										<?php else: ?>
											<tr>
												<td colspan="9"><?php echo app('translator')->getFromJson('common.no_data_available'); ?> ! </td>
											</tr>
										<?php endif; ?>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<?php $__env->stopSection(); ?>



<?php echo $__env->make('admin.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>