In our HR system i put a validation user have to put a note minimum 8 letters. but what if they don't put they can't punch in. but what they are doing is they are put 8 white space they can punch in :( so i want restrict them to put note avoid white space
if(empty($openPunch)){
$currentTime = $req->time;
if (strtotime($currentTime) >= strtotime('09:30')){
if(strlen($req->note) < 8){
$time = (strtotime($currentTime) - strtotime('09:30'));
$minutes = floor($time / 60);
$minute = $minutes%60;
$hours = floor($time / 3600);
return new IceResponse(IceResponse::ERROR,"Today you are late ".$hours.":".$minute." Hours You Can't Punch in without Fill the Correct Reason");
}
}
$openPunch = new Attendance();
}