File manager - Edit - /home/autoph/public_html/api/aha/Sales_ActiveProspect.php
Back
<?php include '../../../cfg/ahaconn.php'; $mykey = $_GET['keyID']; if($mykey == "TOKEN6e59e008b5348b452X615a3033729daae383LEADS"){ $userID = $_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 = ""; $result = $conn->query($sql); $currentDate = new DateTime(); if ($result->num_rows > 0) { // Array to hold the results $count = 0; $rows = array(); // Fetch data from each row and add it to the array while($row = $result->fetch_assoc()) { // Create DateTime object for a given date $futureDate = new DateTime($row['date']); // Get the difference $interval = $futureDate->diff($currentDate); if($interval->days >1){ $withS = 's'; }else{ $withS = ''; } $intervalDates = $interval->days ." day".$withS; if($intervalDates > 5){ $myCSS = 'daysRed'; }else{ $myCSS = 'daysGreen'; } $count =$count + 1; $rows[] = [$row,"days"=>"$intervalDates","myCSS"=>"$myCSS",]; } // Output the result in JSON format header('Content-Type: application/json'); echo json_encode([$rows,"Count" => "$count"]); } } // Close connection $conn->close(); ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings