<?
session_start();
include"../plg/ses.php";
include"../plg/kon.php";

$id = $_POST['idx'];
$lama = $_POST['lama'];
$baru = $_POST['baru'];
$baru2 = $_POST['baru2'];


/*
if($fok==''){
  $foktan = "0";
}
*/
$sqld = "select * from user where pass='$lama' and user='$id'";
$resd = $conn->query($sqld);
while($d = $resd->fetch_assoc()){
  $usrlama = $d['pass'];
}

if($usrlama != $lama){
  header("location:gantipass.php?txtlama=PASSWORD LAMA SALAH !...");
}
else{
  $sql = "update user set pass='$baru' where user='$id'";
  $res = $conn->query($sql);
  header("location:https://simkp.adhigunaputera.co.id/simkp/area.php");
}

?>
