<div id="ld" style="position:fixed; top:50%; left:50%"><img src="img/ld.gif"></div>			
<?php
	include "php_class/class_mysql.php";
	include "php_class/class_operator.php";
	$DataOperator = new dataOperator;
	
	$kodeOperator = $_POST['kodeOperator'];
	$namaoperator = $_POST['nama'];
	$pwd = $_POST['pwd'];
	$akses = $_POST['akses'];
	
	$fupload_name = $_FILES['foto']['name']; 
	$origin_file = $_FILES['foto']['tmp_name'];

	$namap = $fupload_name;
	$namap2 = str_replace("'", "", $namap);
	
		if (copy($origin_file,$_SERVER['DOCUMENT_ROOT']."/simadmin/img/$namap2")) {
			unlink($origin_file);
		}

	$DataOperator->edit_data_operator($kodeOperator, $namaoperator, $pwd, $akses, $namap2);
	
	include "php_class/class_log_sistem.php";
	$DataLogSistem = new DataLogSistem;
	$idOperator = $_SESSION['idOperator'];
	$namaOp = $_SESSION["NamaOperator"];
	$keterangan = "mengubah data operator : ".$namaoperator." oleh ".$namaOp."";
	$DataLogSistem->add_data_log_sistem($keterangan,$idOperator);
	
	echo "<script>window.location='".$base."data-operator'</script>"
?>
