����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 216.73.216.198 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/proc/thread-self/root/var/www/html/rockyo/ajax/ |
Upload File : |
<?php // Conexión a la base de datos $host = "localhost"; $db = "rockio"; $user = "root"; $pass = "Hues198020"; try { $pdo = new PDO("mysql:host=$host;dbname=$db;charset=utf8", $user, $pass); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Consulta para monedero_1 (DISP_980b15498cd4) $stmt1 = $pdo->prepare(" SELECT monedero_1, timestamp FROM contadores WHERE device = 'DISP_980b15498cd4' ORDER BY timestamp DESC LIMIT 1 "); $stmt1->execute(); $monedero1 = $stmt1->fetch(PDO::FETCH_ASSOC); // Consulta para monedero_2 (DISP_6f65061590) $stmt2 = $pdo->prepare(" SELECT monedero_2, timestamp FROM contadores WHERE device = 'DISP_6f65061590' ORDER BY timestamp DESC LIMIT 1 "); $stmt2->execute(); $monedero2 = $stmt2->fetch(PDO::FETCH_ASSOC); if ($monedero1 && $monedero2) { echo json_encode([ "success" => true, "data" => [ "monedero_1" => $monedero1['monedero_1']-1085, "monedero_2" => $monedero2['monedero_2']-14, "timestamp_1" => $monedero1['timestamp'], "timestamp_2" => $monedero2['timestamp'] ] ]); } else { echo json_encode([ "success" => false, "message" => "No se encontraron datos para uno o ambos dispositivos." ]); } } catch (PDOException $e) { echo json_encode([ "success" => false, "message" => "Error de conexión: " . $e->getMessage() ]); } ?>