<div class="container mt-5 mb-5">
	<div class="card bg-light-transparent">
		<div class="card-header bg-light">
			<h5 class="card-title">My Pay Slip</h5>
		</div>
		<div class="card-body ">

			<div class="card text-white bg-dark">
				<div class="card-body">
					
						<div class="row">
							<div class="text-center col-12 col-md-2">
								<?php
									if(!empty($picture)) echo '<img src="'.base_url($picture).'" class="rounded-circle" style="width:100px; height:100px;border:1px solid #dedede;">';
								?>
							</div>

							<div class="col-12 col-md-6">
								<div class="row">
									<label class="col-12 control-label" for="name" align="left">Name :</label>
										<div class="col-12">
											<input type="text" name="name" id="name" class="form-control" value="<?php echo (!empty($user_name)) ? $user_name : ''; ?>" readonly/>
										</div>
								</div>

								<div class="row">
									<label class="col-12 control-label" for="dept_name" >Department:</label>
										<div class="col-12">
											<input type="text" name="dept_name" id="dept_name" class="form-control" value="<?php echo (!empty($department)) ? $department : ''; ?>" readonly/>
										</div>
								</div>
							</div>
						</div>	
				</div>
			</div>

			<div class="card card-body">
				
				<div class="row d-none d-sm-block">
					<div class="col-lg-12">
					
						<table class="table table-responsive table-bordered p-0" width="100%" border="1">
							<thead>
								<th class="sorting" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" aria-label="#: activate to sort column ascending" style="width: 0px;">
									#
								</th>
								<th class="" >Company Code</th>
								<th class="col">Company Name</th>
								<th class="col">Salary/ Wage Month</th>
								<th class="col">Action</th>
							</thead>
							<tbody>		
								<?php if (!empty($payslips)) {
									foreach ($payslips as $key => $payslip) {
								?>
								<tr>
									<td><?php echo $key+1;?></td>
									<td><?php echo $payslip->roc_no;?></td>
									<td ><?php echo $payslip->name; ?></td>
									<td ><?php echo date('M',mktime(0,0,0,$payslip->month,10)).' '.$payslip->year;?></td>
									<td class="text-center">
										<a href="<?php echo base_url('hr/payslip/view/'.$payslip->id) ?>" target="_blank" data-toggle="tooltip" data-placement="top" title="Print"><i class="fa fa-print"></i></a>
									</td>
								</tr>
								<?php
									}}
								?>
							</tbody>
						</table>
					</div>
				</div>

				
				<div class="d-block d-sm-none">
					<?php 
						if (!empty($payslips)) {
							foreach ($payslips as $key => $payslip) {
					?>
						<div class="row">
							<div class="col-12 mb-3">
								<strong class="text-uppercase">Company Code </strong><br>
								<?php echo $payslip->roc_no;?>
							</div>
						</div>

						<div class="row">
							<div class="col-12 mb-3">
								<strong class="text-uppercase">Company Name</strong><br>
								<?php echo $payslip->name; ?>
							</div>
						</div>

						<div class="row">
							<div class="col-12 mb-3">
								<strong class="text-uppercase">Salary / Wage Month</strong><br>
								<?php echo date('M',mktime(0,0,0,$payslip->month,10)).' '.$payslip->year;?>
							</div>
						</div>

						<div class="row">
							<div class="col-12 mb-3">
								<a href="<?php echo base_url('hr/payslip/view/'.$payslip->id) ?>" target="_blank" data-toggle="tooltip" data-placement="top" title="Print" class="btn btn-primary"><i class="fa fa-print"></i> Print</a>
							</div>
						</div>

						<hr><br>
					<?php }}?>
				</div>
					

			</div>

		</div>
	</div>
</div>