<header>
	<div class="row">
		<div class="col-12">
			<div class="t-corp pull-left">
				<div class="t-corp-logo">
					<img src="<?php echo base_url().'assets/images/logo/salihin-logo.png'; ?>" alt="company logo" />
				</div>
				<div class="t-corp-name"><b>SPS</b> | HR SYSTEM</div>
			</div>
			<div class="report-title pull-right" style="padding-top: 30px;">
				<h5><?php echo (isset($title) ? $title : 'Report'); ?></h5>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-12">
			<table class="company">
				<tr>
					<td class="divider">
						<span class="line">&nbsp;</span>
					</td>
					<td class="details">
						<span><b>SALIHIN (AF 1426)</b></span>
						<span>555, Jalan Samudra Utara 1, Taman Samudra, Batu Caves,</span>
						<span>68100, Batu Caves, Selangor</span>
						<span>Phone: 03-6185 9970 &nbsp;&nbsp; Fax: 03-6185 9970</span>
						<span>Website: salihin.com.my</span>
					</td>
					<?php if(!empty($ID)) { ?>
						<td class="divider">
							<span class="line">&nbsp;</span>
							
						</td>
					<?php } else { ?>
						<?php //debug($this->session->userdata()); ?>
						<td class="divider">
							<span class="line">&nbsp;</span>
							<table>
								<tr>
									<td><span><b>STAFF NAME</b></span></td>
									<td><span><b style="padding-left: 2rem;">:</b></span></td>
									<td><span><b style="padding-left: 1rem;">

										<?php if(($this->session->userdata('exam_filter_staff') == null) || $this->session->userdata('exam_filter_staff') == 'ALL'){ 
											echo 'ALL'; 
										} else { 
											echo $staff_list['name'].' | '.$staff_list['branch_name']; 
										} ?>
										
										</b></span>
									</td>
								</tr>
								<tr>
									<td><span><b>EXAM STATUS</b></span></td>
									<td><span><b style="padding-left: 2rem;">:</b></span></td>
									<td><span><b style="padding-left: 1rem;">
										<?php if(($this->session->userdata('exam_filter_exam_status') == null) || $this->session->userdata('exam_filter_exam_status') == 'ALL'){ 
											echo 'ALL'; 
										} else if($this->session->userdata('exam_filter_exam_status') == 0){ 
											echo 'New'; 
										} else if($this->session->userdata('exam_filter_exam_status') == 1){ 
											echo 'Repeat'; 
										} ?>

										</b></span>
									</td>
								</tr>
								<tr>
									<td><span><b>SL ALLOCATION STATUS</b></span></td>
									<td><span><b style="padding-left: 2rem;">:</b></span></td>
									<td><span><b style="padding-left: 1rem;">

										<?php if(($this->session->userdata('exam_filter_sl_status') == null) || $this->session->userdata('exam_filter_sl_status') == 'ALL'){ 
											echo 'ALL'; 
										} else if($this->session->userdata('exam_filter_sl_status') == 0){ 
											echo 'No'; 
										} else if($this->session->userdata('exam_filter_sl_status') == 1) { 
											echo 'Yes'; 
										} ?>
											
										</b></span>
									</td>
								</tr>
								<tr>
									<td><span><b>EXAM RESULT</b></span></td>
									<td><span><b style="padding-left: 2rem;">:</b></span></td>
									<td><span><b style="padding-left: 1rem;">
										<?php if(($this->session->userdata('exam_filter_exam_result') == null) || $this->session->userdata('exam_filter_exam_result') == 'ALL'){ 
											echo 'ALL'; 
										} else if($this->session->userdata('exam_filter_exam_result') == 0){ 
											echo 'Pass'; 
										} else if($this->session->userdata('exam_filter_exam_result') == 1){ 
											echo 'Failed'; 
										} ?>

										</b></span>
									</td>
								</tr>
								<tr>
									<td><span><b>EXAM DATE</b></span></td>
									<td><span><b style="padding-left: 2rem;">:</b></span></td>
									<td><span><b style="padding-left: 1rem;"><?php echo (!empty($this->session->userdata('exam_filter_exam_date')))?($this->session->userdata('exam_filter_exam_date')):'ALL'; ?></b></span></td>
								</tr>
							</table>
						</td>
					<?php } ?>
				</tr>
			</table>
		</div>
	</div>
</header>

<div class="col-12">
	<div class="col-12 table-responsive " style="margin-top:2rem">
		<table class="table table-bordered" width="100%" border="1">
			<thead>
	            <th class="sorting border-top text-center" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" style="width: 0px;">
	                #
	            </th>
	            <th class="sorting border-top text-center" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" style="width: 0px;">
	                Staff Name
	            </th>
	            <th class="sorting border-top text-center" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" style="width: 0px;">
	                Programme
	            </th>
	            <th class="sorting border-top text-center" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" style="width: 0px;">
	                Paper Code
	            </th>
	            <th class="sorting border-top text-center" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" style="width: 0px;">
	                Title of Paper/Subject
	            </th>
	            <th class="sorting border-top text-center" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" style="width: 0px;">
	                Exam Date
	            </th> 
	            <th class="sorting border-top text-center" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" style="width: 0px;">
	                Status
	            </th>
	            <th class="sorting border-top text-center" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" style="width: 0px;">
	                Result
	            </th>     
	        </thead>	

			<tbody>
				<?php //if($this->session->userdata('hr__exam') && $this->session->userdata('hr__exam') != 'No Data') {  
					if($exam_list){
					foreach($exam_list as $key => $row) {?>
	                    <tr>
	                        <td class="text-center"><small><?php echo $key+1; ?></small></td>
	                        <td><?php echo $row['staff_name']; ?> <br><small><i><?php echo $row['department_name']; ?> - <?php echo $row['branch_name']; ?></i></small></td>
							<td><?php echo $row['programme']; ?></td>
							<td><?php echo $row['paper_code']; ?></td>
							<td><?php echo $row['title']; ?></td>
							<td><?php if(($row['exam_date'] != null) && ($row['exam_date'] != '1970-01-01')){ echo date("d-m-Y", strtotime($row['exam_date'])); }else{ echo ''; } ?></td>
							<td>
								Exam Status 
								<?php if($row['status'] == 0){ ?>
									<span class="badge badge-pill badge-info"> New ! </span>
								<?php } else { ?>
									<span class="badge badge-pill badge-danger"> Repeat ! </span>
								<?php } ?>
								<br>
								SL Allocation 
								<?php if($row['allocation_status'] == 0){ ?>
									<span class="badge badge-pill badge-info"> No </span>
								<?php } else { ?>
									<span class="badge badge-pill badge-info"> Yes </span>
								<?php } ?>
							</td>
							<td><?php if($row['result'] == '0'){ echo "FAILED"; }else if($row['result'] == 1){ echo "PASS"; } ?></td> 
	                    </tr>
	                <?php } ?>
	            <?php } ?>
	        </tbody>
		</table>
	</div>
</div>
	