File manager - Edit - /home/autoph/public_html/api/aha/aha_getrewardsPoints.php
Back
<?php include '../../../cfg/ahaconn.php'; $mykey =$_GET['keyID']; //echo "Arnel " . $mykey; if($mykey =="6e59e008b5348b452b615a3033729daae383"){ $userID = $_GET['userID']; // SQL query $sql = "SELECT SUM(added_points) AS myRewardPoints FROM `aha_rewards_trans` WHERE `deleted` = 0 AND `expiry_date`='' AND `asa_user_id`='$userID'"; $result = $conn->query($sql); 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()) { if($row['read_by_user']==0){ $count= $count + 1; } if($count > 0){ $isVisible = 'true'; }else{ $isVisible = ''; } $myRewardsPoints = number_format(($row['myRewardPoints']),0,'',','); } // Output the result in JSON format header('Content-Type: application/json'); //echo json_encode($rows); echo json_encode(["myRewardsPoints" => "$myRewardsPoints","dashBoardView" => "$isVisible"]); } else { echo "0 results"; } } $conn->close(); ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings