<?php
	include ("../inc/koneksi.php");
	include('../inc/password.php');

	$nama = $_POST['nama'];
	$id = $_POST['id'];
	$alamat = $_POST['alamat'];
	$telp = $_POST['telp'];
	//$lang = $_POST['lang'];
	
	$pass_hash = password_hash($id, PASSWORD_BCRYPT);

	$wrong = "";
	
	//simpan ke dalam mhs
	$query = "INSERT INTO petugas (id_petugas,nama,alamat,telp,password) 
								VALUES ('$id','$nama','$alamat','$telp','$pass_hash')";		
	mysql_query($query) or die (mysql_error());


	if($wrong == "")
		$url = "index.php?act=petugas_input&ket=berhasil";
	else
		$url = "index.php?act=petugas_input&ket=$wrong";

	echo "<script language=\"javascript\">
		window.location='../$url';
	</script>";

?>