<?
session_start();
include"../plg/ses.php";
include"../plg/kon.php";
$txtlama = $_GET['txtlama'];
if($prof=='admin'){
  $menu = "../menu.php";
}else{
  $menu = "../menu2.php";
}
?>

<head>
 <meta charset="UTF-8">
 <?include"../css2/flexigrid.php";?>
 <!--<link rel="stylesheet" type="text/css" href="../css/flexigrid.css" />-->
 <script type="text/javascript" src="../plg/jquery.min.js"></script>
 <!--<script type="text/javascript" src="flexigrid.js"></script>-->
 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
 <script src='https://kit.fontawesome.com/a076d05399.js' crossorigin='anonymous'></script>
 <?include"flexigrid.php";?>
 <link rel="stylesheet" href="kucingstrap.css">
 <script src="../plg/kucingstrap.js"></script>
 <link rel="stylesheet" href="../plg/w3.css">
 <link rel="icon" href="../plg/logoagp.png">

 <title>AGP SIMKP</title>
</head>

<body>
<?include"$menu";?>
<center>
 <div class="w3-container" style="width:80%" id="">

   <div class="w3-card-4">
    <div class="w3-container w3-green">
      <h4>GANTI PASSWORD</h4>
    </div>
    <form action="updatepass.php" method="post" id="frmpswd">
    <form class="w3-container">
      <input type="hidden" name="idx" value="<?=$user?>"/>
      <p>
      <label>PASSWORD LAMA</label>
      <input class="w3-input w3-border w3-card-2 w3-center" type="password" name="lama" style="width:70%" id="lama" value="">
      <i class="w3-text-red w3-small">&nbsp&nbsp;<?=$txtlama?>&nbsp;&nbsp;</i>
      </p>

      <p>
      <label>PASSWORD BARU</label>
      <input class="w3-input w3-border w3-card-2 w3-center" type="password" name="baru" style="width:70%" id="baru" value="">
      <i class="w3-text-red w3-small" id="tba"></i>
      </p>

    <p>
    <label>PASSWORD BARU (LAGI)</label>
    <input class="w3-input w3-border w3-card-2 w3-center" type="password" name="baru2" style="width:70%" id="baru2" value="">
    <i class="w3-text-red w3-small" id="tba2"></i>
    </p>
    </form>
    <p>
    <div class="w3-btn w3-green w3-card-2 w3-round-large" onclick="gantipwd()">SAVE</div>
    </p>
    <hr/>
  </div>
</form>
   <br/>
 </div>
</center>
 <div id="id01" class="w3-modal">
     <div class="w3-modal-content" style="width:70%;">
       <div class="w3-container">
         <span onclick="keluar()" class="w3-button w3-display-topright w3-red"><b>&times;</b></span>
         <br/><hr/>
         <iframe style="border:1px solid white;width:100%;height:500px;" id="rangka"></iframe>
       </div>
     </div>
   </div>
</body>
</html>
<script>
function gantipwd(){
  la = document.getElementById('lama').value;
  ba = document.getElementById('baru').value;
  ba2 = document.getElementById('baru2').value;
  if(ba==''){
    document.getElementById('tba').innerHTML="PASSWORD BARU TIDAK BOLEH KOSONG !...";
  }
  else if(ba !== ba2){
    document.getElementById('tba2').innerHTML="KOLOM BARU 1 DAN 2 TIDAK SAMA !...";
  }
  else{
    document.getElementById('frmpswd').submit();
  }
}
</script>
