<?php
include "connect.php";
$nik   = $_POST['nik'];
$nama   = $_POST['nama'];
$jabatan  = $_POST['jabatan'];
$telp   = $_POST['telp'];
$alamat     = $_POST['alamat'];
$tmpFile   = fopen($_FILES['photo']['tmp_name'], 'rb');
$fileData  = fread($tmpFile, filesize($_FILES['photo']['tmp_name']));
$fileData  = addslashes($fileData);
$kota_lhr = $_POST['kota_lhr'];
$tgl_lhr = $_POST['tgl_lhr'];
$tgl_msk = $_POST['tgl_msk'];
//update data
$updatestaf ="update staf set nama='$nama',jabatan='$jabatan',telp='$telp',alamat='$alamat',photo='$fileData',kota_lhr='$kota_lhr',tgl_lhr='$tgl_lhr',tgl_msk='$tgl_msk' where nik='$nik'";
  $hasilstaf = mysql_query($updatestaf);
  if ($hasilstaf)
{
header("location:tampilstaf.php");
}
else
{
echo "Poses Update Gagal";
}
//}
?>

