Linux moon.hostseba.com 4.18.0-553.51.1.lve.el8.x86_64 #1 SMP Tue May 6 15:14:12 UTC 2025 x86_64
LiteSpeed
Server IP : 103.174.152.68 & Your IP : 216.73.216.6
Domains :
Cant Read [ /etc/named.conf ]
User : julaysp1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
julaysp1 /
public_html /
admin /
order /
insert /
Delete
Unzip
Name
Size
Permission
Date
Action
.htaccess
237
B
-r-xr-xr-x
2025-09-01 07:26
bio_totto.php
1.39
KB
-rw-r--r--
2024-10-25 17:12
cancel_order.php
4.18
KB
-rw-r--r--
2024-10-28 09:26
error_log
1.22
KB
-rw-r--r--
2025-08-11 13:42
place_bio_order.php
502
B
-rw-r--r--
2024-10-25 15:16
received_order.php
1.18
KB
-rw-r--r--
2024-10-25 16:36
save_pdf.php
2.73
KB
-rw-r--r--
2024-10-28 09:09
Save
Rename
<?php header('Content-Type: application/json'); include_once("../../includes/configuration.php"); $data = json_decode(file_get_contents('php://input'), true); if (isset($data['id']) && isset($data['status'])) { $orderId = $data['id']; $status = "cancel"; // Step 1: Retrieve the order details (email, user_type, order_type, status, price) from order_list $sql = "SELECT email, user_type, order_type, status, price FROM order_list WHERE id = ?"; if ($stmt = $conn->prepare($sql)) { $stmt->bind_param('i', $orderId); $stmt->execute(); $stmt->bind_result($email, $userType, $orderType, $currentStatus, $price); if ($stmt->fetch()) { $stmt->close(); // Check if the current status is "pending" before processing the cancellation if ($currentStatus === "pending") { // Step 2: Retrieve the user's current balance $balanceQuery = "SELECT balance FROM users WHERE email = ?"; if ($balanceStmt = $conn->prepare($balanceQuery)) { $balanceStmt->bind_param('s', $email); $balanceStmt->execute(); $balanceStmt->bind_result($currentBalance); if ($balanceStmt->fetch()) { $balanceStmt->close(); // Calculate balance after adding the refunded amount $newBalance = $currentBalance + $price; // Step 3: Update the user's balance $updateBalanceQuery = "UPDATE users SET balance = ? WHERE email = ?"; if ($updateBalanceStmt = $conn->prepare($updateBalanceQuery)) { $updateBalanceStmt->bind_param('ds', $newBalance, $email); $updateBalanceStmt->execute(); $updateBalanceStmt->close(); } // Step 4: Update the order status to 'cancel' $updateOrderStatus = "UPDATE order_list SET status = ?, complete_time = NOW() WHERE id = ?"; if ($updateStmt = $conn->prepare($updateOrderStatus)) { $updateStmt->bind_param('si', $status, $orderId); if ($updateStmt->execute()) { // Step 5: Insert record into history_work $orderTime = date("Y-m-d H:i:s"); // Current time $orderTypeInsert = "ক্যানসেল হয়েছেঃ ".$orderType." ".$userType; $historyQuery = "INSERT INTO history_work (email, order_type, price, current_balance, balance_after_cut, order_time) VALUES (?, ?, ?, ?, ?, ?)"; if ($historyStmt = $conn->prepare($historyQuery)) { $historyStmt->bind_param('ssdsss', $email, $orderTypeInsert, $price, $currentBalance, $newBalance, $orderTime); $historyStmt->execute(); $historyStmt->close(); } echo json_encode(['status' => 'success', 'message' => 'Order canceled, price refunded, and history updated successfully.']); } else { echo json_encode(['status' => 'error', 'message' => 'Failed to cancel order.']); } $updateStmt->close(); } } } } else { // If the status is not "pending", prevent further cancellation attempts echo json_encode(['status' => 'error', 'message' => 'Order is already canceled or not eligible for cancellation.']); } } else { echo json_encode(['status' => 'error', 'message' => 'Order not found.']); } } else { echo json_encode(['status' => 'error', 'message' => 'Database error.']); } $conn->close(); } else { echo json_encode(['status' => 'error', 'message' => 'Invalid input data.']); } ?>