forked from Vimall03/Alimento
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout.php
124 lines (109 loc) · 4.03 KB
/
checkout.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
session_start();
//connect to database
include 'partials/_dbconnect.php';
$order=$_SESSION['Order'];
$amount=$_SESSION['amount'];
$userId= $_SESSION['user_id'];
$oid = mt_rand(10000, 99999);
$_SESSION['orderid'] = str_pad($oid, 5, '0', STR_PAD_LEFT);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Checkout</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href=".css">
<link rel="stylesheet" href="main.css">
</head>
<body>
<nav class="nav">
<div class="nav__wrapper grid">
<div class="grid__span2 nav__logo-wrap">
<a href="home.php">
<img class="nav__logo-img" src="images/logo/Logo.png">
</a>
</div>
<div class="grid__span10 nav__links-wrap">
<ul class="nav__links">
<li class="nav__link">
<a href="track_order.php">
<img class="nav__link-icon" style="width: 1.8rem" src="images/favicons/tableware_50px.png">
<span class="nav__link-item">Orders</span>
</a>
</li>
<li class="nav__link">
<a href="#contact">
<img class="nav__link-icon" src="images/favicons/phone_32px.png">
<span class="nav__link-item">Contact </span>
</a>
</li>
<li class="nav__link">
<a href="user_logout.php">
<img class="nav__link-icon" style="width: 1.9rem" src="images/favicons/user_male_circle_32px.png">
<span class="nav__link-item">Logout</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
<br>
<br>
<br>
<br>
<br>
<br>
<div class="container mt-5">
<div class="row">
<div class="col-md-6">
<h2>Shipping Details</h2>
<form action="pay.php" method="post">
<div class="form-group">
<label for="phone">Phone</label>
<input type="text" class="form-control" id="phone" name="phone" required>
</div>
<div class="form-group">
<label for="address1">Address Line 1</label>
<input type="text" class="form-control" id="address1" name="address1" required>
</div>
<div class="form-group">
<label for="address2">Address Line 2</label>
<input type="text" class="form-control" id="address2" name="address2">
</div>
<div class="form-group">
<label for="pincode">Pincode</label>
<input type="text" class="form-control" id="pincode" name="address3" required>
</div>
</div>
<div class="col-md-6">
<h2>Order Summary</h2>
<div class="card">
<div class="card-body">
<h5 class="card-title">Order ID: <?php echo $oid; ?></h5>
<ul class="list-group mb-3">
<li class="list-group-item d-flex justify-content-between align-items-center">
<?php foreach ($order as $item) {
echo $item;
echo '<span class="badge badge-primary badge-pill"></span><br>';} ?>
</li>
</ul>
<p>Total: <b >Rs. <?php echo $amount; ?></b></p>
</div>
</div>
</div>
</div>
<div class="row mt-5">
<div class="col-md-12">
<button class="btn btn-primary btn-lg float-right">Place Order</button>
</form>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>