File manager - Edit - /home/autoph/public_html/connect/CLR_recommendClearance.php
Back
<?php include '../../cfg/asaconn.php'; $myTS = date_create() ->format("Y-m-d h:i:s"); $mykey = $_GET['ApiKey']; //========================================================= if($mykey == 10101080000000000028991100){ //SIGN CLEARANCE FORM $userID= $_REQUEST['empID']; $hID= $_REQUEST['hID']; $keyCode= $_REQUEST['keyCode']; $aprCount = 0; $status =""; $read ="SELECT * FROM cl_clearance_header WHERE `h_id`='$hID' LIMIT 1"; $resultA = $conn->query($read); if($resultA->num_rows > 0) { while($rRow = $resultA->fetch_assoc()){ $ckhA = $rRow['cl_recommender_a_id']; $ckhB = $rRow['cl_recommender_b_id']; if($ckhA == $userID){ $sqlA="UPDATE cl_clearance_header SET `cl_recommender_a_timestamp` = '$myTS' WHERE h_id=$hID"; if ($conn->query($sqlA) === TRUE) { $aprCount = $aprCount + 1; $statusA = "For Endorsement A"; }else{ $statusA= $conn->error; } } if($ckhB == $userID){ $sqlB = "UPDATE cl_clearance_header SET `cl_recommender_b_timestamp` = '$myTS' WHERE `h_id`=$hID"; if ($conn->query($sqlB) === TRUE) { $aprCount = $aprCount + 1; $statusB = "For Endorsement B"; } else{ $statusB = $conn->error; } } } $sql ="SELECT * FROM cl_clearance_header WHERE `h_id`='$hID' LIMIT 1"; $resultB = $conn->query($sql); while($row = $resultB->fetch_assoc()){ $ckhAT = $row['cl_recommender_a_timestamp']; $ckhBT = $row['cl_recommender_b_timestamp']; if($ckhAT != "" && $ckhBT != ""){ $sqlAB = "UPDATE cl_clearance_header SET cl_h_hr_approval = 'FINAL APPROVAL',cl_second_wave = 'FINAL APPROVAL' WHERE `h_id`='$hID'"; if ($conn->query($sqlAB) === TRUE) { $statusM = "Final Approval"; } } } }else{ $status ="Error: No record found."; } echo json_encode(["statusB" => "$statusB","statusA" => "$statusA","statusM"=>"$statusM"]); } ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings