-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorderPlaced.php
More file actions
83 lines (69 loc) · 2.08 KB
/
Copy pathorderPlaced.php
File metadata and controls
83 lines (69 loc) · 2.08 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Congratulations Page</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
body{ font: sans-serif; text-align: center;}
/* Style for buttons */
button {
padding: 10px;
margin: 5px;
background-color: #3498db;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #2980b9;
}
table {
border-collapse: collapse;
width: 100%;
}
table, th, td {
border: 1px solid #ddd;
}
th, td {
padding: 10px;
text-align: left;
}
</style>
</head>
<h1 align="center">Poller</h1>
<body>
<?php
// Initialize the session
session_start();
// Check if the user is already logged in, if yes then redirect them to welcome page
if(!isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] !== true){
header("location: welcome.php");
exit;
}
// Include config file
require_once "config.php";
// Create connection
$conn = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$current_username = $_SESSION["username"];
//echo $current_username;
$getUserInfo = "SELECT currency from User WHERE username = '$current_username'";
$purse = $conn->query($getUserInfo);
$purse = $purse->fetch_assoc();
$purse = $purse["currency"];
?>
<p align="right"><strong><font size="+1"><?= $current_username?> $<?= $purse ?> </font></strong></p>
<p align="center"> Order placed successfully! <p>
<div>
<a href="order_page.php" class="btn btn-warning"> Return to orders page </a>
<a href="surveyList.php" class="btn btn-warning"> Take a Survey </a>
<a href="welcome.php" class="btn btn-warning"> Go to Home </a>
</div>
</body>
</html>