Update: 2026-06-11 18:22:57
This commit is contained in:
51
walletintaleq.intaleq.xyz/v2/main/ride/driverWallet/addFromAdmin.php
Executable file
51
walletintaleq.intaleq.xyz/v2/main/ride/driverWallet/addFromAdmin.php
Executable file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
// Include the database connection file
|
||||
include "../../jwtconnect.php";
|
||||
//ride/driverWallet/add.php
|
||||
// Get the request parameters
|
||||
$driverID = filterRequest("driverID");
|
||||
$paymentID = filterRequest("paymentID");
|
||||
$amount = filterRequest("amount");
|
||||
$paymentMethod = filterRequest("paymentMethod");
|
||||
$phone = filterRequest("phone");
|
||||
|
||||
|
||||
// Add payment to the driver's wallet table
|
||||
$sql = "INSERT INTO `driverWallet` (
|
||||
`driverID`,
|
||||
`paymentID`,
|
||||
`amount`,
|
||||
`paymentMethod`
|
||||
) VALUES (
|
||||
:driverID,
|
||||
:paymentID,
|
||||
:amount,
|
||||
:paymentMethod
|
||||
);";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute(array(
|
||||
':driverID' => $driverID,
|
||||
':paymentID' => $paymentID,
|
||||
':amount' => $amount,
|
||||
':paymentMethod' => $paymentMethod
|
||||
));
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
// Print a success message
|
||||
printSuccess("Record saved successfully");
|
||||
$messageBody = "تم إضافة رصيد بقيمة $amount إلى محفظتك بنجاح."; // "Balance of $amount added successfully."
|
||||
|
||||
sendWhatsAppFromServer($phone, $messageBody);
|
||||
|
||||
// Mark the token as used in the database
|
||||
/* $stmt = $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE id = :tokenID");
|
||||
$stmt->execute(array(
|
||||
':tokenID' => $tokenData['id']
|
||||
));*/
|
||||
} else {
|
||||
// Print a failure message
|
||||
printFailure("Failed to save record");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user