<?Php
	$nidn = $_GET['ij'];
	$id_jurusan = $_GET['id'];

	$detail_dosen = mysqli_query($conn,"SELECT
                                                            	b.id_user,b.nidn,b.nama,b.aktif,
                                                                c.jurusan,d.fakultas,e.nama_badan_hukum,
                                                                b.jenis_kelamin,
                                                                b.alamat,b.email,b.nidn,b.pas_photo as foto
                                                            FROM
                                                            	m_user b
                                                                INNER JOIN m_jurusan c ON b.id_company=c.kd_jurusan
                                                                INNER JOIN m_fakultas d ON c.kd_fakultas=d.kd_fakultas
                                                                INNER JOIN m_badan_hukum e ON d.id_badan_hukum=e.id_badan_hukum
                                                                WHERE
								b.id_company = '$id_jurusan' AND b.id_user = '$nidn'
							");
							
	$dp = mysqli_fetch_array($detail_dosen);
	
	
?>
<header id="fh5co-header" class="fh5co-cover fh5co-cover-sm" role="banner" style="background-image:url(admin/foto_user/<?Php echo"$dp[foto]";?>);" data-stellar-background-ratio="0.5">
	<div class="overlay"></div>
	<div class="container">
		<div class="row">
			<div class="col-md-8 col-md-offset-2 text-center">
				<div class="display-t">
					<div class="display-tc animate-box" data-animate-effect="fadeIn">
						<h1><?Php echo"$dp[nama]";?></h1>
						<h2><?Php echo"$dp[email]";?></h2>
					</div>
				</div>
			</div>
		</div>
	</div>
</header>

<div id="fh5co-blog">
	<div class="container">
		<div class="row">
			<div class="col-lg-12 col-md-4">
				<div class="fh5co-blog animate-box">
				    <div class='table-responsive'>
				        <div class='panel-body'>
				            <ul class='nav nav-tabs'>
				                <li><a href='#biodata' data-toggle='tab'>Biodata Pegawai</a></li>
				                <li><a href='#riwayatPendidikan' data-toggle='tab'>Riwayat Pendidikan</a></li>
				            </ul>
				            <div class='tab-content'>
				                
				                <div class='tab-pane fade in active' id='biodata'>
				                    <?Php
				                    $biodata = mysqli_query($conn,"SELECT
                                                            	b.id_user,b.nidn,b.nama,b.aktif,
                                                                c.jurusan,d.fakultas,e.nama_badan_hukum,
                                                                b.jenis_kelamin
                                                            FROM
                                                            	m_user b
                                                                INNER JOIN m_jurusan c ON b.id_company=c.kd_jurusan
                                                                INNER JOIN m_fakultas d ON c.kd_fakultas=d.kd_fakultas
                                                                INNER JOIN m_badan_hukum e ON d.id_badan_hukum=e.id_badan_hukum
                                                            WHERE
                                                            	b.id_company = '$id_jurusan' AND b.id_user = '$nidn'");
                                    $b = mysqli_fetch_array($biodata);
                                    switch($b[jenis_kelamin]){
                                        case'1':
                                                $jeniskelamin = "Laki-Laki";
                                            break;
                                        case'2':
                                                $jeniskelamin = "Perempuan";
                                            break;
                                        
                                    }
                                    ?>
                                    <form action="#">
                						<div class="row form-group">
                							<div class="col-md-12">
                								<label for="fname">NIDN / NITK</label>
                								<input type="text" id="fname" class="form-control" value="<?Php echo$b[nidn];?>">
                							</div>
                						</div>
                
                						<div class="row form-group">
                							<div class="col-md-12">
                								<label for="fname">Nama</label>
                								<input type="text" id="fname" class="form-control" value="<?Php echo$b[nama];?>">
                							</div>
                						</div>
                
                						<div class="row form-group">
                							<div class="col-md-12">
                								<label for="fname">Perguruan Tinggi</label>
                								<input type="text" id="fname" class="form-control" value="<?Php echo$b[jurusan];?> Pasar Rebo">
                							</div>
                						</div>
                						
                						<div class="row form-group">
                							<div class="col-md-12">
                								<label for="fname">Program Studi</label>
                								<input type="text" id="fname" class="form-control" value="<?Php echo$b[jurusan];?>">
                							</div>
                						</div>
                						
                						<div class="row form-group">
                							<div class="col-md-12">
                								<label for="fname">Jenis Kelamin</label>
                								<input type="text" id="fname" class="form-control" value="<?Php echo$jeniskelamin;?>">
                							</div>
                						</div>
                
                					</form>
				                </div>
				                <div class='tab-pane fade' id='riwayatPendidikan'>
				                    <table class='table table-striped table-bordered table-hover' id='dataTables-example'>
				                        <thead>
				                            <tr><th>no</th><th>Perguruan Tinggi</th><th>Gelar Akademik</th><th>Tanggal Ijazah</th><th>Jenjang</th></tr>
				                        </thead>
				                        <tbody>
				                        <?Php
												$Pendidikan = mysqli_query($conn,"SELECT
                                                                	a.id_user,a.id_company,a.periode,a.mata_ajar,a.institusi,
                                                                    a.gelar,a.jenjang
                                                                FROM
                                                                	m_user_cv a
                                                                    INNER JOIN m_user b ON a.id_user=b.id_user
                                                                WHERE
                                                                	b.id_company = '$id_jurusan' AND a.id_user = '$nidn' AND a.gelar IS NOT NULL");
												$i=1;
												while ($p = mysqli_fetch_array($Pendidikan)){
												  echo "<tr>
															<td>$i</td>
															<td>$p[institusi]</td>
															<td>$p[gelar]</td>
															<td>$p[periode]</td>
															<td>$p[jenjang]</td>
														</tr>";
												$i++;
												}
										?>
										</tbody>
									</table>
				                </div>
				            </div>
				        </div>
				    </div>
						 
				</div>
			</div>
		</div>
	</div>
</div>