format("Y-m-d"); $toTime =date('H:i:s'); $dateTime = $myDate . " ".$toTime; if(isset($_POST['done'])){ $clearanceIDc = mysql_escape_string($_POST['clearanceIDc']); $setNewDate = mysql_escape_string($_POST['dateOfRelease']); mysql_query("UPDATE `cl_clearance_header` SET `cl_h_hr_approval`='READY FOR RELEASE',`cl_date_of_release`='$setNewDate',`cl_lastpay_schedule_date`='$myDate',`cl_second_wave`='READY FOR RELEASE' WHERE `h_id`='$clearanceIDc'"); //########################################################################## // SEND SMS TO PAYROLL/ACCOUNTING OFFICER FOR PREPARATION OF CHECK=========== ============================================== // SEND SMS TO PAYROLL/ACCOUNTING OFFICER FOR PREPARATION OF CHECK========================================================= //########################################################################## $templateID = mysql_result(mysql_query("SELECT `cl_h_template_id` FROM `cl_clearance_header` WHERE `h_id`='$clearanceIDc'"),0); $CLempID = mysql_result(mysql_query("SELECT `cl_h_emp_id` FROM `cl_clearance_header` WHERE `h_id`='$clearanceIDc'"),0); $HRempID = mysql_result(mysql_query("SELECT `cl_hr_approval_id` FROM `cl_template_name` WHERE `id`='$templateID'"),0); $MyAPIcode = mysql_result(mysql_query("SELECT `SMSAPICode` FROM `asa_versioning_db` WHERE `type`='Live'"),0); $MyPasswd = mysql_result(mysql_query("SELECT `SMSAPIPass` FROM `asa_versioning_db` WHERE `type`='Live'"),0); $empMobile = mysql_result(mysql_query("SELECT `usr_mobile` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $HRMobile = mysql_result(mysql_query("SELECT `usr_mobile` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $empUFname = mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $empULname = mysql_result(mysql_query("SELECT `u_lname` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $SMSMessage = "Hi ".$empUFname."! Your last pay check will be released on ".$setNewDate.". Please call us to confirm the release time of your FINAL PAY. Thank you!"; $hrSMSMessage = "Release of ". $empUFname." ".$empULname."'s clearance form and last pay has been re-cheduled by Legal on ".$setNewDate.". Thank you!"; $result = itexmoAA($empMobile, $SMSMessage,$MyAPIcode, $MyPasswd); $result = itexmoAA($HRMobile, $hrSMSMessage,$MyAPIcode, $MyPasswd); if ($result == ""){ echo ''; }else if ($result == 0){ } else{ echo "Error Num ". $result . " was encountered!"; } //########################################################################## //########################################################################## //########################################################################## //########################################################################## $sendmailFname = mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $sendmailuLname = mysql_result(mysql_query("SELECT `u_lname` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $uEmail = mysql_result(mysql_query("SELECT `email` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $getRegisteredName =$sendmailFname; $from = "support@autohubgroup.com"; $to = $uEmail; $subject = "AHG CLEARANCE FORM"; $msgBox = "Hi ".$getRegisteredName."! Your clearance Form together with your last paycheck will be released on ".$setNewDate.".. Support Group"; $headers = "From:" . $from; mail($to,$subject,$msgBox, $headers); //########################################################################## //########################################################################## echo "
TRANS ID. | "; echo "EMP. ID. | "; echo "EMPLOYEE NAME | "; echo "POSITION | "; echo "CREATED | "; echo "CLEARED | "; echo "APPROVED | "; echo "STATUS | "; echo "SLA RATING | "; echo "FINAL PAY PROGRESS | "; echo "ALERT | "; echo ""; $getActiveClearance = mysql_query("SELECT * FROM `cl_clearance_header` WHERE `cl_h_hr_approval`='READY FOR RELEASE' AND `cl_h_comp_id` = '$compID'ORDER BY `cl_h_date_created` DESC"); while($row=mysql_fetch_array($getActiveClearance)){ $hDI = $row['h_id']; $chkComments = mysql_result(mysql_query("SELECT COUNT(f_id) FROM `cl_final_pay_comments` WHERE `cl_id`='$hDI'"),0); $uID = $row['cl_h_emp_id']; $pID = $row['cl_emp_position']; //START OF SLA CODE $olddate = $row['cl_sla_start']; $endDate = $row['cl_sla_end']; if($endDate != ""){ $myEndDate = strtotime($endDate); }else{ $myEndDate = time(); } $your_date = strtotime($olddate); $datediff = $myEndDate - $your_date; $totalCount = round($datediff / (60 * 60 * 24)); if($totalCount == 1){ $MyDay="Day"; }else{ $MyDay="Days"; } if($totalCount < 15 ){ $color = '#06561c'; } if($totalCount > 14 && $totalCount < 25 ){ $color = '#cb5f04'; } if($totalCount > 24 ){ $color = '#f50732 '; } //END OF SLA CODE $uFName=mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$uID'"),0); $uLName=mysql_result(mysql_query("SELECT `u_lname` FROM `vts_users` WHERE `u_id`='$uID'"),0); $uEMPID=mysql_result(mysql_query("SELECT `employee_id` FROM `vts_users` WHERE `u_id`='$uID'"),0); $uPosition=mysql_result(mysql_query("SELECT `position_title` FROM `db_positions` WHERE `pid`='$pID'"),0); $count = $count + 1; ?>
---|---|---|---|---|---|---|---|---|---|
".strtoupper($uEMPID)." | "; echo "".strtoupper($uLName).", ".strtoupper($uFName)." | "; echo "".strtoupper($uPosition)." | "; echo "".strtoupper($row['cl_h_date_created'])." | "; echo "".strtoupper($row['signatory_completion_date'])." | "; echo ""; $apprDate = $row['cl_approver_id_timestamp']; $exAprDate = explode(" ",$apprDate); echo $exAprDate[0]; echo" | "; echo "".strtoupper($row['cl_second_wave'])." | "; echo ""; $chkSLA = 30 - $totalCount; if($chkSLA < 0 ){ $consumedSLA = number_format((($chkSLA / 30) * 100),2); if($consumedSLA < -100){ $mySLA = '0.00%'; }else{ $mySLA = (100 + $consumedSLA)."%"; } }else{ $mySLA = '100%'; } echo "".$totalCount ." ".$MyDay." | Rating:(" .$mySLA.")"; echo" | "; echo ""; $snWave = $row['cl_second_wave']; switch($snWave){ case 'LAST PAY COMPUTATION': // echo "✅"; echo "⬜"; echo "⬜"; echo "⬜"; echo "⬜"; echo "⬜"; echo "⬜"; echo "⬜"; break; case 'LAST PAY APPROVAL': echo "✅"; echo "⬜"; echo "⬜"; echo "⬜"; echo "⬜"; echo "⬜"; echo "⬜"; break; case 'CHECK PREPARATION': echo "✅"; echo "✅"; echo "⬜"; echo "⬜"; echo "⬜"; echo "⬜"; echo "⬜"; break; case 'CHECK RELEASING': echo "✅"; echo "✅"; echo "✅"; echo "⬜"; echo "⬜"; echo "⬜"; echo "⬜"; break; case 'DOCUMENTS PREPARATION': echo "✅"; echo "✅"; echo "✅"; echo "✅"; echo "⬜"; echo "⬜"; echo "⬜"; break; case 'SCHEDULE OF RELEASE': echo "✅"; echo "✅"; echo "✅"; echo "✅"; echo "✅"; echo "✅"; echo "⬜"; break; case 'READY FOR RELEASE': echo "✅"; echo "✅"; echo "✅"; echo "✅"; echo "✅"; echo "✅"; echo "✅"; break; } echo" | "; echo "";
if($chkComments > 0){
echo "![]() ![]() | ";
echo "