Файловый менеджер - Редактировать - /home/d46091/ecogenix.in/toaster.php
Назад
<?php // Include database configuration include('./connection/config.php'); header('Content-Type: application/json'); // Get the last poll timestamp (sent by the client) $lastPollTime = isset($_GET['lastPollTime']) ? intval($_GET['lastPollTime']) : time() - 300; // Fetch new registrations since the last poll $query = " SELECT id, business_name AS name, business_state AS state, business_city AS district, business_pincode AS pincode, TIMESTAMPDIFF(MINUTE, created_at, NOW()) AS time_diff_minutes, sez = 'yes' AS recentlyAppliedForIEC FROM iec_form WHERE time_stamp < $lastPollTime ORDER BY time_stamp DESC "; // Execute the query $result = $conn->query($query); // Prepare the response data $data = []; while ($row = $result->fetch_assoc()) { $row['registrationtime'] = $row['time_diff_minutes'] . " minutes ago"; // Format time unset($row['time_diff_minutes']); // Remove the raw time difference value $data[] = $row; } // Send JSON response to the frontend echo json_encode([ "newRegistrations" => $data, "timestamp" => time() // Update the last poll timestamp ]); ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка