<?php
session_start();


//ambil nilai
require("../inc/config.php");
require("../inc/fungsi.php");
require("../inc/koneksi.php");



nocache;

//nilai
$filenya = "$sumber/android_pegawai/i_upload.php";
$filenyax = "$sumber/android_pegawai/i_upload.php";
$judul = "Upload Foto Selfie";
$juduli = $judul;



//nilai session
$sesiku = $_SESSION['sesiku'];
$sesinama = $_SESSION['sesinama'];





//detail
$qku = mysqli_query($koneksi, "SELECT * FROM m_orang ".
						"WHERE kd = '$sesiku'");
$rku = mysqli_fetch_assoc($qku);
$ku_nip = cegah($rku['nip']);
$ku_nama = cegah($rku['nama']);
$ku_jabatan = cegah($rku['jabatan']);





//simpan
if ((isset($_GET['aksi']) && $_GET['aksi'] == 'simpan'))
	{
	//nilai
	$new_image_name = "$ku_nip-$tahun$bulan$tanggal.jpg";
	
	
	//copy...
	move_uploaded_file($_FILES["file"]["tmp_name"], "../filebox/selfie/".$new_image_name);
	
	
	
	//kd
	$xyz = md5("$sesiku$new_image_name");
	$filexnya = cegah($new_image_name);
	
	

	exit();
	}
	
	








//form
if ((isset($_GET['aksi']) && $_GET['aksi'] == 'form'))
	{
	//re-direct
	/*
	?>
	
	
	
	<script language='javascript'>
	//membuat document jquery
	$(document).ready(function(){
			window.location.href = "p_masuk.html"; 
	
	});
	
	</script>
	
	<?php
	*/


	exit();
	}
	
	



exit();	
?>
