<?php

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

// استقبال وتشفير رقم الهاتف
$phone_number = filterRequest("phone_number");
$phone_number = $encryptionHelper->encryptData($phone_number);

// تنفيذ الاستعلام
$sql = "UPDATE phone_verification_passenger SET verified = 1 WHERE phone_number = :phone_number";
$stmt = $con->prepare($sql);
$stmt->bindParam(":phone_number", $phone_number);
$stmt->execute();

$affectedRows = $stmt->rowCount();

// إرجاع النتيجة
if ($affectedRows > 0) {
    jsonSuccess(["message" => "Phone number verified successfully"]);
} else {
    jsonError("No phone number found or verification failed");
}
?>