<?php
//nilai
$filenya = base_url()."/android1212/i_akun_profil";
$filenyax = base_url()."/android1212/i_akun_profil";
$judul = "Profil Diri";
$juduli = $judul;
//nilai session
$ku_hkode=$_GET['hkode'];
$tiga=$this->db->query("SELECT * from web_login where hkode='$ku_hkode'");
foreach ($tiga->result() as $rt) {
	$sesiku=$rt->sesiku;
	$sesinama=$rt->sesinama;
	$passx=$rt->passx;
	$departemen=$rt->departemen;
	$kd6_session=$rt->sesiku;
	$kodeabsen = $rt->sesiku;
	
}
$ceksiswa=$this->db->query("SELECT * FROM web_siswa WHERE absen='$sesiku'");
foreach ($ceksiswa->result() as $rt1) {
	$kdabsen=$rt1->absen;
}
//PROSES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//jika form
if ((isset($_GET['aksi']) && $_GET['aksi'] == 'form'))
	{
	//detail
	$ceksiswa=$this->db->query("SELECT * FROM web_siswa WHERE absen='$sesiku'");
	foreach ($ceksiswa->result() as $rt1) {
		$kdkelas=$rt1->KD_JENIS_KETENAGAAN;
		$filex1=$rt1->filex1;
	}
	$carikelas3=$this->db->query("SELECT * FROM web_kelas where kode='".$kdkelas."'");
		foreach ($carikelas3->result() as $baris3) {
			$namakelas=$baris3->nama;
		}
	echo '
	<div class="row m-3">
	                <div class="cell-md-4 text-center text-left-md">
	                    <h3 class="dashboard-section-title">PROFIL
	                    </h3>
	                </div>
	            </div>

	            <div class="p-1 m-3">
	                <div class="row">

	<table class="table">
	<tr align="top">
	<td width="10">&nbsp;</td>
	<td rowspan="2">
		<p>';
			?>
		<img id="gambar" src="<?php echo base_url('upload/profil/'.$filex1.'');?>" width="100">
		<?php
		echo '</p>


	</td>
	<td><p>Nama :<br><b>'.$sesinama.'</b></p></td>
	<td width="10">&nbsp;</td>
	</tr>
	<tr align="top">
	<td width="10">&nbsp;</td>
	<td><p>Kelompok :<br><b>'.$namakelas.'</b></p></td>
	<td width="10">&nbsp;</td>
	</tr>
	</table>
	</div>
	</div>';

	exit();
	}
//upload Foto
if ((isset($_GET['aksi']) && $_GET['aksi'] == 'simpan'))
	{
		//echo "namaku adalah";
	//nilai
	$sesiku = $this->session->userdata('sesiku');
	$hariini=date("Ymdhis");
	$new_image_name = "$sesiku.jpg";
	//copy...
	move_uploaded_file($_FILES["file"]["tmp_name"], "./upload/profil/".$new_image_name);
	$this->db->query("UPDATE web_siswa SET filex1 = '$new_image_name' WHERE absen = '$sesiku'");
	exit();
	}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
?>
