File manager - Edit - /home/autoph/public_html/connect/home/CL_UPLOAD_FINAL_PAY.php
Back
<?php include 'core/database/connect.php'; error_reporting(0); //########################################################################## // ITEXMO SEND SMS API - PHP - CURL-LESS METHOD // Visit www.itexmo.com/developers.php for more info about this API //########################################################################## //$MyAPIcode = "TR-AUTOH331398_2V9R5"; //$MyPasswd = "36k)y3(915"; function itexmo($number,$message,$MyAPIcode,$MyPasswd){ $url = 'https://www.itexmo.com/php_api/api.php'; $itexmo = array('1' => $number, '2' => $message, '3' => $MyAPIcode, 'passwd' => $MyPasswd ); $param = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($itexmo), ), ); $context = stream_context_create($param); return file_get_contents($url, false, $context); } //########################################################################## $myDate = date_create() ->format("Y-m-d"); if ( $_FILES['file']['error'] > 0 ){ echo 'Error: ' . $_FILES['file']['error'] . '<br>'; } else { $clearanceID = mysql_escape_string($_POST['clearanceID']); $addCompID = mysql_escape_string($_POST['addCompID']); $fullPath = $clearanceID . '_' . $_FILES['file']['name']; if(move_uploaded_file($_FILES['file']['tmp_name'], 'FILES/clearance/' .$fullPath)) { echo "File Uploaded Successfully"; } } //$imageLink = "https://www.autohub.ph/connect/home/uimages/pricelist/".$fullPath; $FileLink = "https://www.autohub.ph/connect/home/FILES/clearance/".$fullPath; //mysql_query("INSERT INTO vts_profile_images (cust_id, file_path) VALUES('$customerID','$fullPath')"); mysql_query("UPDATE `cl_clearance_header` SET `cl_h_hr_approval`='LASTPAY APPROVAL',`cl_computation_date`='$myDate',`cl_second_wave`='LASTPAY APPROVAL',`cl_final_computation`='$FileLink' WHERE `h_id`='$clearanceID'"); //########################################################################## // 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`='$clearanceID'"),0); $CLhrID = mysql_result(mysql_query("SELECT `cl_hr_approval_id` FROM `cl_template_name` WHERE `id`='$templateID'"),0); //$CLempID = mysql_result(mysql_query("SELECT `cl_h_emp_id` FROM `cl_template_name` WHERE `id`='$templateID'"),0); $CLempID = mysql_result(mysql_query("SELECT `cl_h_emp_id` FROM `cl_clearance_header` WHERE `h_id`='$clearanceID'"),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); $hroMobile = mysql_result(mysql_query("SELECT `usr_mobile` FROM `vts_users` WHERE `u_id`='$CLhrID'"),0); $empMobile = mysql_result(mysql_query("SELECT `usr_mobile` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $hFname = mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $hLname = mysql_result(mysql_query("SELECT `u_lname` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $hEmail = mysql_result(mysql_query("SELECT `email` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $SMSMessage = "Clearance Form of ".$hFname." ".$hLname." with FINAL PAY attachment has been routed to your for employee confirmation."; $SMSMessageEMP = "Your final pay computation has been submitted to HR for your signature. ."; $result = itexmo($hroMobile, $SMSMessage,$MyAPIcode, $MyPasswd);//SMS TO HR OFFICER $result = itexmo($empMobile, $SMSMessageEMP,$MyAPIcode, $MyPasswd);//SMS TO CLEARANCE OWNER if ($result == ""){ echo '<script>alert("No response from SMS server. SMS failed to send")</script>'; }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`='$CLhrID'"),0); $sendmailuLname = mysql_result(mysql_query("SELECT `u_lname` FROM `vts_users` WHERE `u_id`='$CLhrID'"),0); $sendmailFnameE = mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $sendmailuLnameE = mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $uEmail = mysql_result(mysql_query("SELECT `email` FROM `vts_users` WHERE `u_id`='$CLhrID'"),0); $uEmailE = mysql_result(mysql_query("SELECT `email` FROM `vts_users` WHERE `u_id`='$CLempID'"),0); $getRegisteredName = $sendmailFname ." ". $sendmailuLname ."!"; $getRegisteredNameE = $sendmailFnameE ." ". $sendmailuLnameE ."!"; $from = "support@autohubgroup.com"; $to = $uEmail; $toE = $uEmailE; $subject = "CLEARANCE UPDATE"; $msgBox = "Hi ".$getRegisteredName."! Clearance Form of ".$hFname." ".$hLname." with FINAL PAY attachment has been routed to your for employee confirmation. Support Group"; $msgBoxE = "Hi ".$getRegisteredNameE."! Your FINAL PAY computation has been submitted to HR for your signature. Please call your HR officer for more information Support Group"; $headers = "From:" . $from; mail($to,$subject,$msgBox, $headers); mail($toE,$subject,$msgBoxE, $headers); //########################################################################## //########################################################################## echo "<script>alert('Last pay computation has been uploaded and routed to HR for approval.')</script>"; //==================================================================================================// echo "<table>"; echo "<thead>"; echo "<th style='width:50px;border:0px solid white'>REC ID.</th>"; echo "<th style='width:80px;border:0px solid white'>EMP. ID.</th>"; echo "<th style='width:180px;border:0px solid white'>EMPLOYEE NAME</th>"; echo "<th style='width:100px;border:0px solid white'>POSITION</th>"; echo "<th style='width:100px;border:0px solid white'>CLEARANCE DATE</th>"; echo "<th style='width:100px;border:0px solid white'>RECEIVED DATE</th>"; echo "<th style='width:180px;border:0px solid white'>STATUS</th>"; echo "<th style='width:190px;border:0px solid white'>SLA RATING</th>"; echo "<th style='width:190px;border:0px solid white'>FINAL PAY PROGRESS</th>"; echo "<th style='width:50px;border:0px solid white'>ALERT</th>"; echo "</thead>"; $getActiveClearance = mysql_query("SELECT * FROM `cl_clearance_header` WHERE `cl_h_hr_approval`='LAST PAY COMPUTATION' AND `cl_h_comp_id` = '$addCompID' 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; ?><tr onclick="javascript:showAdminAccess(this);"><?php echo "<td style=';border:0px solid white;cursor:pointer;color:$color'>".strtoupper($row['h_id'])."</td>"; echo "<td style=';border:0px solid white;cursor:pointer;color:$color'>".strtoupper($uEMPID)."</td>"; echo "<td style=';border:0px solid white;cursor:pointer;color:$color'>".strtoupper($uLName).", ".strtoupper($uFName)."</td>"; echo "<td style=';border:0px solid white;cursor:pointer;color:$color'>".strtoupper($uPosition)."</td>"; echo "<td style=';border:0px solid white;cursor:pointer;color:$color'>".strtoupper($row['cl_h_date_created'])."</td>"; echo "<td style=';border:0px solid white;cursor:pointer;color:$color'>"; $apprDate = $row['cl_approver_id_timestamp']; $exAprDate = explode(" ",$apprDate); echo $exAprDate[0]; echo"</td>"; echo "<td style=';border:0px solid white;cursor:pointer;color:$color'>".strtoupper($row['cl_second_wave'])."</td>"; echo "<td style=';border:0px solid white;cursor:pointer;color:black'>"; $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 "<b>".$totalCount ." </b> <i style='font-family:Arial;font-size:10px'>".$MyDay."</i> | Rating:(" .$mySLA.")"; echo"</td>"; echo "<td style=';border:0px solid white;cursor:pointer;color:$color'>"; $snWave = $row['cl_second_wave']; switch($snWave){ case 'LAST PAY COMPUTATION': // echo "<b style='float:left;margin:2px'><abbr title='Waiting for Final Pay'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='PAYROLL: For computation of last pay'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Employee Confirmation'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='ACCNT: Preparation of Check Request'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='TREASURY: Preparation of Check'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Preparation of documents'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='LEGAL: For Scheduling'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Ready for Release'>⬜</abbr></b>"; break; case 'LAST PAY APPROVAL': echo "<b style='float:left;margin:2px'><abbr title='PAYROLL: For computation of last pay'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Employee Confirmation'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='ACCNT: Preparation of Check Request'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='TREASURY: Preparation of Check'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Preparation of documents'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='LEGAL: For Scheduling'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Ready for Release'>⬜</abbr></b>"; break; case 'CHECK PREPARATION': echo "<b style='float:left;margin:2px'><abbr title='PAYROLL: For computation of last pay'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Employee Confirmation'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='ACCNT: Preparation of Check Request'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='TREASURY: Preparation of Check'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Preparation of documents'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='LEGAL: For Scheduling'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Ready for Release'>⬜</abbr></b>"; break; case 'CHECK RELEASING': echo "<b style='float:left;margin:2px'><abbr title='PAYROLL: For computation of last pay'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Employee Confirmation'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='ACCNT: Preparation of Check Request'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='TREASURY: Preparation of Check'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Preparation of documents'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='LEGAL: For Scheduling'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Ready for Release'>⬜</abbr></b>"; break; case 'DOCUMENTS PREPARATION': echo "<b style='float:left;margin:2px'><abbr title='PAYROLL: For computation of last pay'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Employee Confirmation'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='ACCNT: Preparation of Check Request'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='TREASURY: Preparation of Check'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Preparation of documents'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='LEGAL: For Scheduling'>⬜</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Ready for Release'>⬜</abbr></b>"; break; case 'SCHEDULE OF RELEASE': echo "<b style='float:left;margin:2px'><abbr title='PAYROLL: For computation of last pay'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Employee Confirmation'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='ACCNT: Preparation of Check Request'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='TREASURY: Preparation of Check'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Preparation of documents'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='LEGAL: For Scheduling'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Ready for Release'>⬜</abbr></b>"; break; case 'READY FOR RELEASE': echo "<b style='float:left;margin:2px'><abbr title='PAYROLL: For computation of last pay'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Employee Confirmation'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='ACCNT: Preparation of Check Request'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='TREASURY: Preparation of Check'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Preparation of documents'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='LEGAL: For Scheduling'>✅</abbr></b>"; echo "<b style='float:left;margin:2px'><abbr title='HRD: Ready for Release'>✅</abbr></b>"; break; } echo"</td>"; echo "<td style=';border:0px solid white;cursor:pointer;color:$color'>"; if($chkComments > 0){ echo "<img src='images/notify_on_25.png'></img>"; }else{ echo "<img src='images/notify_off_25.png'></img>"; } echo"</td>"; echo "</tr>"; $compRate=0; } echo "</table>"; ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings