-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfirmorder.php
More file actions
100 lines (95 loc) · 2.83 KB
/
confirmorder.php
File metadata and controls
100 lines (95 loc) · 2.83 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
<link rel="stylesheet" href="style.css?v=<?php echo time(); ?>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
a {
color: black;
font-size:1.6rem;
font-weight:700;
}
a:hover {
color: white;
}
main{
margin-top:5%;
}
</style>
</head>
<body>
<div class="grid-container">
<header>
<div class="brand"> <img src="images/logo.png" alt="logo"></div>
<div class="top">
<a href="index.php">Home</a>
<a href="return.php">Contact us</a>
<a href="orderinput.php">Orders</a>
<a href="viewcart.php"><i class="fa fa-shopping-cart fa_custom fa-1x"></i></a>
</div>
</header>
<main id="main-container">
<center>
<?php
session_start();
$name=$_SESSION["productname"];
$uniqueid=$_SESSION["uniqueid"];
echo "<h1>".$name."</h1>";
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "products";
$conn1 = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn1->connect_error) {
die("Connection failed: " . $conn1->connect_error);
}
$customername = $_POST["customer-name"];
$email = $_POST["email"];
$phonenumber = $_POST["phone-number"];
$address = $_POST["address"];
$sql = "UPDATE orders SET
`customername`='$customername',
`email`='$email',
`address`='$address',
`phone-number`='$phonenumber',
`place-order`='True'
WHERE uniqueid='$uniqueid'";
if($conn1->query($sql)===TRUE){
echo "<h2>Order Placed Successfully</h2>";
}
else{
echo "oops we ran into problem".$conn1->error;
}
?>
<br>
<button class="back home" onclick="window.location.href='index.php'">Continue Shopping</button>
</center>
</main>
<div>
<footer class="site-footer ">
<div class="row">
<div class="foot-col-3">
<h6>About</h6>
<p class="text-justify"><i>Copyright to Ozone Pvt Ltd.</i>All rights reserved @2021</p>
</div>
<div class="foot-col-3">
<h6>Useful Links</h6>
<ul class="footer-links">
<li>Coupons</li>
<li>Return policy</li>
<li>Terms and Conditions</li>
</ul>
<ul class="social-icons">Follow us
<li><a class="facebook" href="#"><i class="fa fa-facebook"></i></a></li>
<li><a class="twitter" href="#"><i class="fa fa-twitter"></i></a></li>
<li><a class="dribbble" href="#"><i class="fa fa-dribbble"></i></a></li>
<li><a class="linkedin" href="#"><i class="fa fa-linkedin"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>