-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_order_status.php
28 lines (25 loc) · 1011 Bytes
/
check_order_status.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
session_start();
require 'db-connect.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$email = $_POST['email'];
// Query untuk mendapatkan status pesanan berdasarkan email
$query = "SELECT email, status FROM `order` WHERE email = ?";
$stmt = $koneksi->prepare($query);
$stmt->execute([$email]);
$orders = $stmt->fetchAll(PDO::FETCH_ASSOC);
if ($orders) {
$status_message = "";
foreach ($orders as $order) {
$status_message .= "Email: " . htmlspecialchars($order['email']) . "\n";
$status_message .= "Status: " . htmlspecialchars($order['status']) . "\n\n";
}
$status_message = urlencode($status_message);
header("Location: index.php?page=check_order_status&status_message=$status_message");
} else {
$status_message = urlencode("No orders found for the provided email address.");
header("Location: index.php?page=check_order_status&status_message=$status_message");
}
exit();
}
?>