Update: 2026-06-11 18:22:57
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
include "../../connect.php";
|
||||
|
||||
$email = filterRequest('email');
|
||||
$driverID = filterRequest('id');
|
||||
|
||||
|
||||
$sql = "SELECT
|
||||
driver.id,
|
||||
driver.phone,
|
||||
driver.email,
|
||||
driver.gender,
|
||||
driver.birthdate,
|
||||
driver.site,
|
||||
driver.first_name,
|
||||
driver.last_name,
|
||||
driver.bankCode,
|
||||
driver.accountBank,
|
||||
driver.education,
|
||||
driver.employmentType,
|
||||
driver.maritalStatus,
|
||||
driver.created_at,
|
||||
driver.updated_at,
|
||||
phone_verification.is_verified
|
||||
FROM
|
||||
driver
|
||||
LEFT JOIN phone_verification ON phone_verification.phone_number = driver.phone
|
||||
WHERE
|
||||
driver.email = :email AND driver.id = :id AND `phone_verification`.`is_verified`='1' ";
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':email', $email);
|
||||
$stmt->bindParam(':id', $driverID);
|
||||
$stmt->execute();
|
||||
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$count = $stmt->rowCount();
|
||||
|
||||
if ($count > 0) {
|
||||
|
||||
echo json_encode([
|
||||
"status" => "success",
|
||||
"count" => $count,
|
||||
"data" => $data
|
||||
]);
|
||||
|
||||
} else {
|
||||
// The user does not exist
|
||||
// echo json_encode([
|
||||
// "status" => "Failure",
|
||||
// "data" => "User does not exist."
|
||||
// ]);
|
||||
printFailure("User does not exist.");
|
||||
}
|
||||
$stmt = null; // Close the statement
|
||||
$con = null; // Close the connection
|
||||
exit();
|
||||
Reference in New Issue
Block a user