56 lines
1.3 KiB
PHP
56 lines
1.3 KiB
PHP
<?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();
|