<?php
require_once __DIR__ . '/../../connect.php';

$device_number = filterRequest("device_number"); 

$sql = "SELECT
    *
FROM
    `adminUser`
WHERE
    `device_number` = '$device_number'";

$stmt = $con->prepare($sql);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);

if (count($result) === 1) {
    // Print the first record as a success message
    jsonSuccess($result[0]);
} else {
    // Print a failure message
    jsonError($message = "Failed to retrieve Password or user name incorrect");
}
?>