Initial commit with updated Auth and media ignored
This commit is contained in:
45
Admin/driver/getDriverGiftPayment.php
Executable file
45
Admin/driver/getDriverGiftPayment.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$phone = filterRequest("phone");
|
||||
|
||||
// Encrypt phone
|
||||
$encphone = $encryptionHelper->encryptData($phone);
|
||||
|
||||
$sql = "SELECT
|
||||
*
|
||||
FROM
|
||||
`driver`
|
||||
WHERE
|
||||
phone = :encPhone";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
|
||||
// FIX 1: Bind AFTER preparing the statement
|
||||
// FIX 2: Use the same placeholder name (:encPhone)
|
||||
$stmt->bindParam(':encPhone', $encphone, 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");
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user