<div id="page-wrapper">
	<div class="main-page">
		<div class="forms">

<!--
-->	
	
<div class="row row-sm mg-b-20">
		<div class="col-lg-12">
		  <div class="table-responsive">
			<table class="table table-striped mg-b-0">
			  <thead>
				<tr>
			 <!--<th>No</th>
				  <th>Tingkat</th>
			   -->
				  	
				  <th rowspan="2" style="background-color: cornflowerblue; vertical-align: middle;"><center>Jumlah</center><center>Pendaftar</center><center>17R(604)</center>
				  <th colspan=2 style="background-color: cornflowerblue;"><center>Terverifikasi</center>
				  <th rowspan=2 style="background-color: cornflowerblue;vertical-align: middle; text-align: center;">Asal SMP
				  <th rowspan=2 style="background-color: cornflowerblue;vertical-align: middle; text-align: center;">Asal MTs
				  <th colspan=2 style="background-color: cornflowerblue;"><center>Program PP</center><center>2R(64)</center>
				  <th rowspan=2 style="background-color: cornflowerblue;vertical-align: middle; text-align: center;"><center>Kelas</center><center>Prestasi</center><center>2R(72)</center>
				  <th rowspan=2 style="background-color: cornflowerblue;vertical-align: middle; text-align: center;"><center>Kelas</center><center>Ketrmpln</center><center>5R(180)</center>
				  <th rowspan=2 style="background-color: cornflowerblue;vertical-align: middle; text-align: center;"><center>Kelas</center><center>Reguler</center><center>7R(252)</center>
				  <th rowspan=2 style="background-color: cornflowerblue;vertical-align: middle; text-align: center;"><center>Kelas</center><center>KKO</center><center>1R(36)</center>
				  <tr>

				    <th style="background-color: crimson;"><center>L</center> 
					<th style="background-color: royalblue;"><center>P</center>
					<th style="background-color: crimson;"><center>L</center> 
					<th style="background-color: royalblue;"><center>P</center>
		
				  </tr>
			  </thead>
			  <tbody>
			  <?php

						foreach($jumlah_calon1 as $p)
						{
							?>
							<tr>
								<td rowspan="2" style="background-color: lightblue; vertical-align: middle;"><center><?php echo $p['jc1'];?></center></td>							
						
							<?php
						}
						foreach($jumlah_calon2a as $q)
						{
							?>
							
								<td><center><?php echo $q['jc2a'];?></center></td>							
							
							<?php
						}
						foreach($jumlah_calon2b as $r)
						{
							?>
							
								<td><center><?php echo $r['jc2b'];?></center></td>							
							
							<?php
						}
						foreach($jumlah_calon3a as $s)
						{
							?>
							
								<td rowspan="2" style="background-color: lightblue; vertical-align: middle;"><center><?php echo $s['jc3a'];?></center></td>							
							
							<?php
						}
						foreach($jumlah_calon3b as $t)
						{
							?>
							
								<td rowspan="2" style=" background-color: lightblue; vertical-align: middle;"><center><?php echo $t['jc3b'];?></center></td>							
							
							<?php
						}
						foreach($jumlah_calon4a as $u)
						{
							?>
							
								<td><center><?php echo $u['jc4a'];?></center></td>							
							
							<?php
						}
						foreach($jumlah_calon4b as $v)
						{
							?>
							
								<td><center><?php echo $v['jc4b'];?></center></td>							
							
							<?php
						}
						foreach($jumlah_calon5 as $w)
						{
							?>
							
								<td rowspan="2" style=" background-color: lightblue; vertical-align: middle;"><center><?php echo $w['jc5'];?></center></td>							
							
							<?php
						}
						foreach($jumlah_calon6 as $x)
						{
							?>
							
								<td rowspan="2" style="background-color: lightblue; vertical-align: middle;"><center><?php echo $x['jc6'];?></center></td>							
							
							<?php
						}
						foreach($jumlah_calon7 as $y)
						{
							?>
							
								<td rowspan="2" style="background-color: lightblue; vertical-align: middle;"><center><?php echo $y['jc7'];?></center></td>							
							
							<?php
						}
						foreach($jumlah_calon8 as $z)
						{
							?>
							
								<td rowspan="2" style="background-color: lightblue; vertical-align: middle;"><center><?php echo $z['jc8'];?></center></td>							
							  </tr>

							<?php
						}
						foreach($jumlah_calon2c as $a)
						{
							?>
							  <tr>
								<td colspan="2" style="background-color: lightblue;"><center><?php echo $a['jc2c'];?></center></td>							
	
							<?php
						}
						foreach($jumlah_calon4c as $b)
						{
							?>

								<td colspan="2" style="background-color: lightblue;"><center><?php echo $b['jc4c'];?></center></td>
							   </tr>
							<?php
						}
												
				?>
			  </tbody>
			</table>
		  </div><!-- table-responsive -->
		</div><!-- col-4 -->
	  </div><!-- row -->

<!--
-->
			<div class=" form-grids row form-grids-right">
				<div class="widget-shadow " data-example-id="basic-forms"> 
					<div class="form-title">
						<h4>Data Calon Siswa</h4>
					</div>
				</div>
			</div>
		</div>
		<div class="tables">
			<div class="table-responsive bs-example widget-shadow">
				<div class="col-md-12">
					<a href="<?php echo base_url();?>admin/Admin/downloadExcel" class="btn btn-md btn-primary pull-right">
						<i class="fa fa-download"></i> Download Data Calon Siswa
					</a>
				</div>
				<div class="clearfix"> </div>
				<br>
				<table class="table table-bordered" style="font-size:12px !important;" id="dataku">
					<thead>
						<tr>
							<th>No</th>
							<th>Tanggal Cetak</th>
							<th>Nama</th>
							<th>No Pendaftaran</th>
							<th>Asal Sekolah</th>
							<th>Jurusan #1</th>
							<th>Jurusan #2</th>
							<th>Status</th>
							<th>Hasil</th>
							<th>Kelola</th>
						</tr>
					</thead>
					<tbody>
						<?php
							if($calon_siswa == NULL)
							{
								?>
								<tr>
									<td colspan="9"><center>Tidak ada data calon siswa.</center></td>
								</tr>
								<?php
							}
							else
							{
								$no = 0;
								foreach($calon_siswa as $cs)
								{
									if($cs['id_status'] == 1)
									{
										$label = "default";
									}
									else if($cs['id_status'] == 2)
									{
										$label = "info";
									}
									else if($cs['id_status'] == 3)
									{
										$label = "warning";
									}
									else if($cs['id_status'] == 4)
									{
										$label = "primary";
									}
									else if($cs['id_status'] == 5)
									{
										$label = "success";
									}
									$no++;
									?>
									<tr>
										<td><?php echo $no;?></td>
										<td><?php echo $cs['tanggal_submit'];?></td>
										<td><?php echo $cs['nama'];?></td>
										<td><?php echo $cs['nomor_pendaftaran'];?></td>
										<td><?php echo $cs['asal_sekolah'];?></td>
										<td>
											<?php
												foreach($jurusan as $j)
												{
													if($j['id_jurusan'] == $cs['id_jurusan'])
													{
														echo $j['jurusan'];
													}
												}
											?>
										</td>
										<td>
											<?php
												foreach($jurusan as $j)
												{
													if($j['id_jurusan'] == $cs['id_jurusan2'])
													{
														echo $j['jurusan'];
													}
												}
											?>
										</td>
										<td><span class="label label-<?php echo $label;?>"><?php echo $cs['status'];?></span></td>
										<td style="color:<?php echo ($cs['hasil_wawancara'] == "Diterima" ? "#00FF00" : "#FF0000");?>;"><strong><?php echo $cs['hasil_wawancara'];?></strong></td>
										<td style="font-size:10px !important;">
											<a href="<?php echo base_url();?>admin/Admin/calonSiswaDetail/<?php echo $cs['id_calon_siswa'];?>" class="btn btn-xs btn-info" title="Detail Calon Siswa" target="_blank">
												<i class="fa fa-info-circle"></i>
											</a>
											<?php
												$session_data	= $this->session->userdata('admin');
												$role			= $session_data['role'];
												if($role == "Admin")
												{
													?>
													<a href="<?php echo base_url();?>admin/Admin/calonSiswaEdit/<?php echo $cs['id_calon_siswa'];?>" class="btn btn-xs btn-warning" title="Edit Calon Siswa">
														<i class="fa fa-pencil"></i>
													</a>
													<?php
												}
												if($cs['id_status'] == 3)
												{
													if($role == "Pewawancara")
													{
														?>
														<a href="<?php echo base_url();?>admin/Admin/calonSiswaWawancara/<?php echo $cs['id_calon_siswa'];?>" class="btn btn-xs btn-primary" title="Lakukan Wawancara">
															<i class="fa fa-comment"></i>
														</a>
														<?php
													}
												}
												else if($cs['id_status'] == 4 || $cs['id_status'] == 5)
												{
													?>
													<a href="<?php echo base_url();?>admin/Admin/downloadHasilWawancaraSiswa/<?php echo $cs['id_calon_siswa'];?>" class="btn btn-xs btn-primary" title="Download Hasil Wawancara Untuk Siswa" target="_blank">
														<i class="fa fa-file"></i>
													</a>
													<a href="<?php echo base_url();?>admin/Admin/downloadHasilWawancara/<?php echo $cs['id_calon_siswa'];?>" class="btn btn-xs btn-success" title="Download Hasil Wawancara Lengkap" target="_blank">
														<i class="fa fa-download"></i>
													</a>
													<?php
												}
												if($role == "Admin")
												{
													?>
													<a href="<?php echo base_url();?>admin/Admin/resetPassword/<?php echo $cs['id_calon_siswa'];?>" class="btn btn-xs btn-default" title="Reset Password" onclick="return confirm('Apakah Anda ingin mereset password <?php echo $cs['nama'];?> ?');">
														<i class="fa fa-key"></i>
													</a>
													<a href="<?php echo base_url();?>admin/Admin/calonSiswaDelete/<?php echo $cs['id_calon_siswa'];?>" class="btn btn-xs btn-danger" onclick="return confirm('Anda yakin akan menghapus calon siswa ini?');" title="Hapus Calon Siswa">
														<i class="fa fa-trash"></i>
													</a>
													<a href="<?php echo base_url();?>admin/Admin/calonMhsUjianReset/<?php echo $cs['id_calon_siswa'];?>" class="btn btn-xs btn-primary disabled" onclick="return confirm('Anda yakin akan mereset ujian calon siswa ini?');" title="Reset Ujian Calon Siswa">
														<i class="fa fa-reply"></i>
													</a>
													<?php
												}
											?>
										</td>
									</tr>
									<?php
								}
							}
						?>
					</tbody> 
				</table>
			</div>
		</div>
	</div>
</div>