<?php
  include "include/dbcon.php";
?>
<?php
  $tstamp = time();
  $hid = $_POST["pid"];
  $pstatus = $_POST["pstatus"];
  if($pstatus=="1"){
    $pstatus="1";
  }else{
    $pstatus="0";
  }
?>
<?php
    $query = "UPDATE ".$CLIENTID."_attendace_staff 
	            SET userID='$pstatus'
              WHERE
                id='$hid'";
    if( mysqli_query($conn,$query) ){
		  header("location: main.php?pg=stf");
    }else{
	  echo "error to record, pls try again";
	}
?>