Update: 2026-06-11 18:22:57
This commit is contained in:
45
walletintaleq.intaleq.xyz/v2/main/ride/kazan/add.php
Executable file
45
walletintaleq.intaleq.xyz/v2/main/ride/kazan/add.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
include "../../connect.php";
|
||||
|
||||
$kazan = filterRequest("kazan");
|
||||
$adminId = filterRequest("adminId");
|
||||
$latePrice = filterRequest("latePrice");
|
||||
$heavyPrice = filterRequest("heavyPrice");
|
||||
$naturePrice = filterRequest("naturePrice");
|
||||
$comfortPrice = filterRequest("comfortPrice");
|
||||
$speedPrice = filterRequest("speedPrice");
|
||||
$deliveryPrice = filterRequest("deliveryPrice");
|
||||
$freePrice = filterRequest("freePrice");
|
||||
$country = filterRequest("country");
|
||||
$fuelPrice = filterRequest("fuelPrice");
|
||||
|
||||
// Prepare an SQL statement with placeholders for the values
|
||||
$sql = "INSERT INTO `kazan`( `country`,`kazan`, `comfortPrice`, `speedPrice`, `deliveryPrice`, `freePrice`, `latePrice`, `heavyPrice`, `adminId`, `naturePrice`, `fuelPrice`) VALUES (:country,:kazan, :comfortPrice, :speedPrice, :deliveryPrice, :freePrice, :latePrice, :heavyPrice, :adminId, :naturePrice,:fuelPrice)";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
|
||||
// Bind the parameters to the SQL query
|
||||
$stmt->bindParam(':kazan', $kazan);
|
||||
$stmt->bindParam(':comfortPrice', $comfortPrice);
|
||||
$stmt->bindParam(':speedPrice', $speedPrice);
|
||||
$stmt->bindParam(':deliveryPrice', $deliveryPrice);
|
||||
$stmt->bindParam(':freePrice', $freePrice);
|
||||
$stmt->bindParam(':latePrice', $latePrice);
|
||||
$stmt->bindParam(':heavyPrice', $heavyPrice);
|
||||
$stmt->bindParam(':adminId', $adminId);
|
||||
$stmt->bindParam(':naturePrice', $naturePrice);
|
||||
$stmt->bindParam(':country', $country);
|
||||
$stmt->bindParam(':fuelPrice', $fuelPrice);
|
||||
|
||||
// Execute the statement
|
||||
if ($stmt->execute()) {
|
||||
// Print a success message
|
||||
printSuccess("Kazan saved successfully");
|
||||
} else {
|
||||
// Print a failure message
|
||||
printFailure("Failed to save Kazan");
|
||||
}
|
||||
|
||||
// Close the statement
|
||||
$stmt->close();
|
||||
?>
|
||||
27
walletintaleq.intaleq.xyz/v2/main/ride/kazan/get.php
Normal file
27
walletintaleq.intaleq.xyz/v2/main/ride/kazan/get.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
include "../../connect.php";
|
||||
$country = filterRequest("country");
|
||||
|
||||
$sql = " SELECT *
|
||||
FROM
|
||||
`kazan`
|
||||
WHERE `country`='$country'";
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute();
|
||||
|
||||
$row = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($row){
|
||||
// Fetch the record
|
||||
// $row = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
|
||||
printSuccess( $row);
|
||||
|
||||
}
|
||||
else{
|
||||
// Print a failure message
|
||||
|
||||
printFailure($message = "No Kazan record found");
|
||||
}
|
||||
?>
|
||||
72
walletintaleq.intaleq.xyz/v2/main/ride/kazan/update.php
Normal file
72
walletintaleq.intaleq.xyz/v2/main/ride/kazan/update.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
include "../../connect.php";
|
||||
|
||||
$id = filterRequest("id");
|
||||
|
||||
// Create an empty array to store the column-value pairs
|
||||
$columnValues = array();
|
||||
|
||||
// Check if each column is set in the request and add it to the array
|
||||
if (isset($_POST["kazan"])) {
|
||||
$kazan = filterRequest("kazan");
|
||||
$columnValues[] = "`kazan` = '$kazan'";
|
||||
}
|
||||
|
||||
if (isset($_POST["comfortPrice"])) {
|
||||
$comfortPrice = filterRequest("comfortPrice");
|
||||
$columnValues[] = "`comfortPrice` = '$comfortPrice'";
|
||||
}
|
||||
|
||||
if (isset($_POST["speedPrice"])) {
|
||||
$speedPrice = filterRequest("speedPrice");
|
||||
$columnValues[] = "`speedPrice` = '$speedPrice'";
|
||||
}
|
||||
|
||||
if (isset($_POST["deliveryPrice"])) {
|
||||
$deliveryPrice = filterRequest("deliveryPrice");
|
||||
$columnValues[] = "`deliveryPrice` = '$deliveryPrice'";
|
||||
}
|
||||
if (isset($_POST["freePrice"])) {
|
||||
$freePrice = filterRequest("freePrice");
|
||||
$columnValues[] = "`freePrice` = '$freePrice'";
|
||||
}
|
||||
if (isset($_POST["latePrice"])) {
|
||||
$latePrice = filterRequest("latePrice");
|
||||
$columnValues[] = "`latePrice` = '$latePrice'";
|
||||
}
|
||||
|
||||
if (isset($_POST["heavyPrice"])) {
|
||||
$heavyPrice = filterRequest("heavyPrice");
|
||||
$columnValues[] = "`heavyPrice` = '$heavyPrice'";
|
||||
}
|
||||
|
||||
if (isset($_POST["adminId"])) {
|
||||
$adminId = filterRequest("adminId");
|
||||
$columnValues[] = "`adminId` = '$adminId'";
|
||||
}
|
||||
|
||||
if (isset($_POST["createdAt"])) {
|
||||
$createdAt = filterRequest("createdAt");
|
||||
$columnValues[] = "`createdAt` = '$createdAt'";
|
||||
}
|
||||
|
||||
if (isset($_POST["naturePrice"])) {
|
||||
$naturePrice = filterRequest("naturePrice");
|
||||
$columnValues[] = "`naturePrice` = '$naturePrice'";
|
||||
}
|
||||
|
||||
// Construct the SET clause of the update query using the column-value pairs
|
||||
$setClause = implode(", ", $columnValues);
|
||||
|
||||
$sql = "UPDATE `kazan` SET $setClause WHERE `id` = '$id'";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute();
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
// Print a success message
|
||||
printSuccess($message = "Kazan data updated successfully");
|
||||
} else {
|
||||
// Print a failure message
|
||||
printFailure($message = "Failed to update kazan data");
|
||||
}
|
||||
Reference in New Issue
Block a user