PHPR Script

Category: Programming Written by Naldi Hits: 379

* (Before Record Added) Record tolak jika tanggal sudah ada berdasarkan nomor badge :

global $conn;
$strSQLExists = "SELECT * FROM hr_timesheet 
WHERE date='".$values['date']."' AND badge_no ='".$values['badge_no']."'";
$rsExists = db_query($strSQLExists,$conn);
$data=db_fetch_array($rsExists);
if($data)
{
$message = "Timesheet for " . $values["date"] . " already exists.";
  return false;
} else {
  return true;
}