Initial commit with updated Auth and media ignored
This commit is contained in:
26
ride/firebase/getDriverToken.php
Normal file
26
ride/firebase/getDriverToken.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$captain_id = filterRequest("captain_id");
|
||||
|
||||
$sql = "SELECT * FROM `driverToken` WHERE `captain_id` = :captain_id";
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':captain_id', $captain_id, PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($data) {
|
||||
// فك تشفير token فقط
|
||||
foreach ($data as &$item) {
|
||||
$item['token'] = $encryptionHelper->decryptData($item['token']);
|
||||
// fingerPrint يبقى كما هو
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
'status' => 'success',
|
||||
'data' => $data
|
||||
]);
|
||||
} else {
|
||||
jsonError("No driver token found");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user