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

$searchPhone = '0992952235';
echo "Searching for: $searchPhone\n";

$variants = [$searchPhone, '963' . substr($searchPhone, 1), '+963' . substr($searchPhone, 1)];

foreach ($variants as $v) {
    echo "Checking variant: $v\n";
    $enc = $encryptionHelper->encryptData($v);
    
    $stmt = $con->prepare("SELECT id, phone, first_name FROM driver WHERE phone = ? OR phone = ?");
    $stmt->execute([$v, $enc]);
    $res = $stmt->fetch();
    
    if ($res) {
        echo "FOUND! ID: {$res['id']}, Name: {$res['first_name']}, Phone in DB: {$res['phone']}\n";
        exit;
    }
}

echo "NOT FOUND in driver table.\n";
