File manager - Edit - /home/autoph/public_html/api/aha/service_chat_byVehicle.php
Back
<?php include '../../../cfg/ahaconn.php'; $mykey =$_GET['keyID']; //echo "Arnel " . $mykey; if($mykey =="6e59e008b5348b452b615a3033729daae383carpus"){ $userID = $_GET['userID']; $sql = "SELECT * FROM `aha_general_notifications` WHERE `deleted` = 0 AND `aha_user_id`='$userID' AND notification_type='carplus' ORDER BY `read_by_user`,`id` DESC LIMIT 200"; $count = 0; $result = $conn->query($sql); if ($result->num_rows > 0) { $rows = array(); while($row = $result->fetch_assoc()) { if($row['read_by_user']==0){ $count= $count + 1; $new = "visible"; $old = ""; }else{ $old = "visible"; $new = ""; } if($count > 0){ $isVisible = 'true'; }else{ $isVisible = ''; } $rows[] = [$row,"newIcon"=>"$new","oldIcon"=>"$old"]; } header('Content-Type: application/json'); } echo json_encode([$rows,"Count" => "$count","isVisible" => "$isVisible"]); } if($mykey =="6e59e008b5348b452b615a3033729daae383service"){ $userID = $_GET['userID']; $sql = "SELECT * FROM `aha_general_notifications` WHERE `deleted` = 0 AND `aha_user_id`='$userID' AND notification_type='service' ORDER BY `read_by_user`,`id` DESC LIMIT 200"; $count = 0; $result = $conn->query($sql); if ($result->num_rows > 0) { $rows = array(); while($row = $result->fetch_assoc()) { if($row['read_by_user']==0){ $count= $count + 1; $new = "visible"; $old = ""; }else{ $old = "visible"; $new = ""; } if($count > 0){ $isVisible = 'true'; }else{ $isVisible = ''; } $rows[] = [$row,"newIcon"=>"$new","oldIcon"=>"$old"]; } header('Content-Type: application/json'); } echo json_encode([$rows,"Count" => "$count","isVisible" => "$isVisible"]); } if($mykey =="6e59e008b5348b452b615a3033729daae383promo"){ $userID = $_GET['userID']; $sql = "SELECT * FROM `aha_general_notifications` WHERE `deleted` = 0 AND `aha_user_id`='$userID' AND notification_type='promo' ORDER BY `read_by_user`,`id` DESC LIMIT 200"; $count = 0; $result = $conn->query($sql); if ($result->num_rows > 0) { $rows = array(); while($row = $result->fetch_assoc()) { if($row['read_by_user']==0){ $count= $count + 1; $new = "visible"; $old = ""; }else{ $old = "visible"; $new = ""; } if($count > 0){ $isVisible = 'true'; }else{ $isVisible = ''; } $rows[] = [$row,"newIcon"=>"$new","oldIcon"=>"$old"]; } header('Content-Type: application/json'); } echo json_encode([$rows,"Count" => "$count","isVisible" => "$isVisible"]); } if($mykey =="6e59e008b5348b452b615a3033729daae383"){ $userID = $_GET['userID']; $sql = "SELECT * FROM `aha_general_notifications` WHERE `deleted` = 0 AND `aha_user_id`='$userID' ORDER BY `read_by_user`,`id` DESC LIMIT 200"; $count = 0; $result = $conn->query($sql); if ($result->num_rows > 0) { $rows = array(); while($row = $result->fetch_assoc()) { if($row['read_by_user']==0){ $count= $count + 1; $new = "visible"; $old = ""; }else{ $old = "visible"; $new = ""; } if($count > 0){ $isVisible = 'true'; }else{ $isVisible = ''; } $rows[] = [$row,"newIcon"=>"$new","oldIcon"=>"$old"]; } header('Content-Type: application/json'); } echo json_encode([$rows,"Count" => "$count","isVisible" => "$isVisible"]); } if($mykey =="6e59e008b5348b452b615a3033729daae383UPDATE"){ $userID = $_GET['userID']; $msgID = $_GET['recordID']; $sql = "UPDATE aha_general_notifications SET `read_by_user`=1 WHERE `id`='$msgID'"; if ($conn->query($sql) === TRUE) { echo json_encode(["status" => "Update Complete."]); }else{ echo json_encode(["status" => "Error: Unable to update message"]); } } $conn->close(); ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings