-
Notifications
You must be signed in to change notification settings - Fork 0
/
orders.php
109 lines (85 loc) · 3.73 KB
/
orders.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if (!isset($user_id)) {
header('location:login.php');
};
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ourtos</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css">
<link rel="stylesheet" href="bootstrap-icons/bootstrap-icons.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php include 'header.php'; ?>
<center>
<h1 style="margin-top:18px;margin-bottom:18px;">COMPRA EFECTUADA</h1>
</center>
<style type="text/css">
.vendas{ background: #c5dee996;
border: 2px solid #bcbcbc;
font-size: 18px;
max-width: 677px;
margin: 10px auto 33px;
padding: 20px;
line-height: 30px;
border-radius: 6px;
}
</style>
<?php
if(isset($_SESSION['prdt'])){
$total_products = $_SESSION['prdt'];
$user_id = $_SESSION['user_id'];
$order_query = mysqli_query($conn, "SELECT * FROM `orders` WHERE `total_products` = '{$total_products}' AND `user_id` = '{$user_id}'") or die ('query failed');
?>
<?php
while($dds = mysqli_fetch_assoc($order_query)){
$stto = ($dds['payment_status'] == 'Pendente') ? '<span style="color:red;">'.$dds['payment_status'].'</span>': '<span style="color:#8e44ad;">'.$dds['payment_status'].'</span>';
?>
<div class="vendas">
<p>Data: <span style="color:#8e44ad"><?=$dds['placed_on']?></span>
<br>Nome: <span style="color:#8e44ad"><?=$dds['name']?> </span>
<br> Número: <span style="color:#8e44ad"><?=$dds['number']?></span>
<br> Email: <span style="color:#8e44ad"><?=$dds['email']?></span>
<br> Endereço: <span style="color:#8e44ad"><?=$dds['address']?></span>
<br> Método de Pagamento: <span style="color:#8e44ad"><?=$dds['method']?></span>
<br> Produtos: <span style="color:#8e44ad"><?=$dds['total_products']?></span>
<br> Total a Pagar: <span style="color:#8e44ad">Kz <?=formatar($dds['total_price'])?></span>
<br> Estado de Pagamento: <?=$stto?> </p>
</div>
<?php
}
?>
<?php
unset($_SESSION['prdt']);
}else{
$order_query = mysqli_query($conn, "SELECT * FROM `orders` WHERE `user_id` = '{$user_id}'") or die ('query failed');
while($dds = mysqli_fetch_assoc($order_query)){
$stto = ($dds['payment_status'] == 'Pendente') ? '<span style="color:red;">'.$dds['payment_status'].'</span>': '<span style="color:#8e44ad;">'.$dds['payment_status'].'</span>';
?>
<div class="vendas">
<p>Data: <span style="color:#8e44ad"><?=$dds['placed_on']?></span>
<br>Nome: <span style="color:#8e44ad"><?=$dds['name']?> </span>
<br> Número: <span style="color:#8e44ad"><?=$dds['number']?></span>
<br> Email: <span style="color:#8e44ad"><?=$dds['email']?></span>
<br> Endereço: <span style="color:#8e44ad"><?=$dds['address']?></span>
<br> Método de Pagamento: <span style="color:#8e44ad"><?=$dds['method']?></span>
<br> Produtos: <span style="color:#8e44ad"><?=$dds['total_products']?></span>
<br> Total a Pagar: <span style="color:#8e44ad">Kz <?=formatar($dds['total_price'])?></span>
<br> Estado de Pagamento: <?=$stto?> </p>
</div>
<?php
}
}
include 'footer.php';
?>
<script src="js/script.js"></script>
</body>
</html>