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

	$detail_dosen = mysqli_query($conn,"SELECT 
                                                	a.kd_jurusan,a.nidn,a.kd_matakuliah,
                                                    b.matakuliah,
                                                    c.nama,c.alamat,c.email,d.pas_photo as foto
                                                FROM
                                                	kelas_perkuliahan a
                                                    INNER JOIN m_matakuliah b on a.kd_matakuliah=b.kd_matakuliah
                                                    INNER JOIN m_dosen c on a.nidn=c.nidn
                                                    INNER JOIN m_user d ON d.nidn=c.nidn
                                                WHERE
								a.kd_jurusan = '$id_jurusan' AND a.nidn = '$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 class='active'><a href='#matakuliah' data-toggle='tab'>Mata Kuliah</a></li>
				                <li><a href='#biodata' data-toggle='tab'>Biodata Dosen</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='matakuliah'>
				                    <?Php
                        				$tampil = mysqli_query($conn,"SELECT 
                                                                        	a.kd_jurusan,a.nidn,a.kd_matakuliah,
                                                                            b.matakuliah,b.SKS,b.metode_kuliah,
                                                                            c.nama,c.alamat,c.email,c.foto
                                                                        FROM
                                                                        	kelas_perkuliahan a
                                                                            INNER JOIN m_matakuliah b on a.kd_matakuliah=b.kd_matakuliah
                                                                            INNER JOIN m_dosen c on a.nidn=c.nidn
                                                                        WHERE
                        								a.kd_jurusan = '$id_jurusan' AND a.nidn = '$nidn'");
                        			    echo "
                        					<table class='table'>
                        			        <thead>
                        			          <tr>
                        			            <th data-toggle='true' data-name='id'>Kode Mata Kuliah</th>
                        			            <th data-hide='phone'>Matakuliah</th>
                        			            <th data-hide='phone'>Sks</th>
                        			            <th data-hide='phone'>Metode Kuliah</th>
                        			          </tr>
                        			        </thead>
                        			        <tbody>"; 
                        
                        			    $no=1;
                        			    $i=0;
                        			    while ($r=mysqli_fetch_array($tampil)){
                        			    	
                        			       echo "
                        						<tr class='odd gradeX'>
                        							<td>$r[kd_matakuliah]</td>
                        							<td>$r[matakuliah]</td>
                        							<td>$r[SKS]</td>
                        							<td>$r[metode_kuliah]</td>
                        						</tr>";
                        			      $no++;
                        			      $i++;
                        			    }
                        			    echo "</tbody>
                        			        </table>
                        			          ";
                        			    
                        				?>
				                </div>
				                <div class='tab-pane fade' id='biodata'>
				                    <?Php
				                    $biodata = mysqli_query($conn,"SELECT
                                                            	a.nidn,a.status_dosen,a.nama,a.aktif,
                                                                c.jurusan,d.fakultas,e.nama_badan_hukum,
                                                                b.jenis_kelamin
                                                            FROM
                                                            	m_dosen a
                                                                INNER JOIN m_user b ON a.nidn=b.nidn
                                                                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 a.nidn = '$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</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 b.nidn = '$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>