File manager - Edit - /home/autoph/public_html/api/aha/aha_slider.php
Back
<?php include '../../../cfg/ahaconn.php'; $mykey = $_GET['keyID']; if($mykey =="6e59e008b5348b452b615a3033729daae383"){ // SQL query $sql = "SELECT * FROM aha_slider_content WHERE deleted = 0 AND `start_date` < '$curDate' AND `end_date` > '$curDate' AND type='slider' AND `is_video`=0"; $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()) { $rows[] = $row; } // Output the result in JSON format header('Content-Type: application/json'); echo json_encode($rows); } else { echo json_encode($rows); } } if($mykey =="Load6e59e008b5348b452b615a3033729daae383-reels"){ // SQL query $sql = "SELECT t1.*,t2.id AS dID, t2.name AS dName FROM aha_slider_content t1 LEFT JOIN dealerships t2 ON t1.dealer_id = t2.id WHERE deleted = 0 AND `start_date` < '$curDate' AND `end_date` > '$curDate' ORDER BY t1.id DESC"; $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['is_video']==0){ $viewVideo=""; $viewImage = "Visible"; }else{ $viewVideo="Visible"; $viewImage = ""; } if($row['likes'] > 999){ $shortCount = number_format(($row['likes']/1000),2,'.',',') ."K"; }else{ $shortCount =$row['likes']; } $rows[] = [ 'id' => $row['id'], 'dealer_id' => $row['dealer_id'], 'image_path' => $row['image_path'], 'slider_title' => $row['slider_title'], 'slider_description' => $row['slider_description'], 'slider_link' => $row['slider_link'], 'deleted' => $row['deleted'], 'start_date' => $row['start_date'], 'end_date' => $row['end_date'], 'views' => $row['views'], 'likes' => $shortCount, 'dID' => $row['dID'], 'stepI' => $row['slider_title'], 'dName' => $row['dName'], 'viewVideo' => $viewVideo, 'viewImage' => $viewImage // Add more fields as needed ]; } // Output the result in JSON format header('Content-Type: application/json'); echo json_encode($rows); } else { echo json_encode($rows); } } // Close connection $conn->close(); ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings