Files
intaleq_v3_pure_php/Admin/driver/getDriverGiftPayment.php
Hamza-Ayed 24d38160c0 admin 9
2026-04-30 17:34:02 +03:00

42 lines
1016 B
PHP
Executable File

<?php
require_once __DIR__ . '/../../connect.php';
$phone = filterRequest("phone");
// Encrypt phone
$encphone = $encryptionHelper->encryptData($phone);
error_log("[GIFT_CHECK] Received Phone: " . $phone);
error_log("[GIFT_CHECK] Encrypted Phone: " . $encphone);
$sql = "SELECT * FROM `driver` WHERE phone = :encPhone OR phone = :rawPhone";
$stmt = $con->prepare($sql);
$stmt->bindParam(':encPhone', $encphone, PDO::PARAM_STR);
$stmt->bindParam(':rawPhone', $phone, PDO::PARAM_STR);
$stmt->execute();
if ($stmt->rowCount() > 0) {
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
// Decrypt sensitive fields
foreach ($rows as &$row) {
if (!empty($row['phone'])) {
$row['phone'] = $encryptionHelper->decryptData($row['phone']);
}
if (!empty($row['name_arabic'])) {
$row['name_arabic'] = $encryptionHelper->decryptData($row['name_arabic']);
}
}
jsonSuccess($rows);
} else {
jsonError("No recent driver location activity found");
}
?>