File manager - Edit - /home/autoph/public_html/api/aha/SA_Dashboard.php
Back
<?php include '../../../cfg/ahaconn.php'; $mykey =$_GET['keyID']; if($mykey == "TOKEN6e59e008b5348b452b615a3033729daae383"){ $userID = $_GET['userID']; $saID = $_GET['userID']; //get HR user Record ID //include '../../../cfg/connhr.php'; //$getUserID = "SELECT * FROM `users` WHERE `asa_app_user_id`='$userID'"; //$quser = mysqli_query($connhr,$getUserID); //while($usr = mysqli_fetch_array($quser)){ // $saID = $usr['id']; // } // SQL query $sql = "SELECT * FROM service_bookings WHERE service_status_id < 15 AND assigned_service_advisor = '$saID'"; $result = $conn->query($sql); $Incoming =""; $openUR=""; $ForRelease=""; $WaitingParts=""; $ForPayment=""; if ($result->num_rows > 0) { // Array to hold the results $Incoming = 0; $openUR = 0; $WaitingParts = 0; $ForPayment = 0; $ForRelease = 0; $rows = array(); // Fetch data from each row and add it to the array while($row = $result->fetch_assoc()) { if($row['service_status_id'] == 2){ //&& $row['service_status_id'] < 3 $Incoming = $Incoming + 1; }else if($row['service_status_id'] > 2 && $row['service_status_id'] < 13){ $openUR = $openUR + 1; }else if($row['service_status_id']==10){ $WaitingParts = $WaitingParts + 1; }else if($row['service_status_id']==13){ $ForPayment = $ForPayment + 1; }else if($row['service_status_id']==14){ $ForRelease = $ForRelease + 1; } } $rows[] =$selectedFields; // Output the result in JSON format } header('Content-Type: application/json'); echo json_encode(["incoming" => "$Incoming", "OpenUR" => "$openUR", "WatingParts" => "$WaitingParts", "forPayment" => "$ForPayment", "forRelease" => "$ForRelease"]); } // Close connection $conn->close(); ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings