Update: 2026-06-11 18:22:57
This commit is contained in:
31
walletintaleq.intaleq.xyz/v2/main/ride/promo/get.php
Normal file
31
walletintaleq.intaleq.xyz/v2/main/ride/promo/get.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
include "../../connect.php";
|
||||
|
||||
|
||||
$promo_code = filterRequest("promo_code");
|
||||
|
||||
$sql = "SELECT
|
||||
`id`,
|
||||
`promo_code`,
|
||||
`amount`,
|
||||
`description`,
|
||||
`validity_start_date`,
|
||||
`validity_end_date`
|
||||
FROM
|
||||
`promos`
|
||||
WHERE
|
||||
`promo_code` = '$promo_code' AND CURDATE() BETWEEN validity_start_date AND validity_end_date;";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($result) {
|
||||
// Print all promo records
|
||||
printSuccess( $result);
|
||||
} else {
|
||||
// Print a failure message
|
||||
printFailure($message = "Failed to retrieve promo records");
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user