File manager - Edit - /home/autoph/public_html/api/aha/load_myPromoCode.php
Back
<?php include '../../../cfg/ahaconn.php'; $mykey = $_GET['keyID']; //echo "Arnel " . $mykey; if($mykey =="code-6e59e008b5348b452b615a3033729daae383-promo"){ $userID = $_GET['userID']; // SQL query $sql = "SELECT t1.*,t2.id,t2.name FROM aha_promo_code t1 LEFT JOIN dealerships t2 ON t1.dealer_id = t2.id WHERE t1.aha_owner_id='$userID' AND t1.enabled=1"; $result = $conn->query($sql); $count=0; if ($result->num_rows > 0) { // Array to hold the results $rows = array(); // Fetch data from each row and add it to the array while($row = $result->fetch_assoc()) { $rows[] = $row; $count = $count + 1; } $stat = "You have ". $count ." active promo code in your account."; // Output the result in JSON format header('Content-Type: application/json'); echo json_encode([$rows,"Count" => "$count","status" => "$stat"]); } else { $stat = "You don't have any active Promo Code in your Account."; echo json_encode([$rows,"Count" => "$count","status" => "$stat"]); } } // Close connection $conn->close(); ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings