Repository navigation
Expand file tree
/
Copy pathorder_successful.php
More file actions
174 lines (170 loc) · 4.75 KB
/
Copy pathorder_successful.php
File metadata and controls
174 lines (170 loc) · 4.75 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?php
session_start();
if(!isset($_SESSION["uid"])){
header("location:index.php");
}
if (isset($_GET["st"])) {
# code...
$trx_id = $_GET["tx"];
$p_st = $_GET["st"];
$amt = $_GET["amt"];
$cc = $_GET["cc"];
$cm_user_id = $_GET["cm"];
$c_amt = $_COOKIE["ta"];
if ($p_st == "Completed") {
include_once("db.php");
$sql = "SELECT p_id,qty FROM cart WHERE user_id = '$cm_user_id'";
$query = mysqli_query($con,$sql);
if (mysqli_num_rows($query) > 0) {
# code...
while ($row=mysqli_fetch_array($query)) {
$product_id[] = $row["p_id"];
$qty[] = $row["qty"];
}
for ($i=0; $i < count($product_id); $i++) {
$sql = "INSERT INTO orders (user_id,product_id,qty,trx_id,p_status) VALUES ('$cm_user_id','".$product_id[$i]."','".$qty[$i]."','$trx_id','$p_st')";
mysqli_query($con,$sql);
}
$sql = "DELETE FROM cart WHERE user_id = '$cm_user_id'";
if (mysqli_query($con,$sql)) {
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ecommerce</title>
<link rel="stylesheet" href="css/bootstrap.min.css"/>
<script src="js/jquery2.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="main.js"></script>
<style>
table tr td {padding:10px;}
</style>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a href="#" class="navbar-brand">Ecommerce</a>
</div>
<ul class="nav navbar-nav">
<li><a href="index.php"><span class="glyphicon glyphicon-home"></span>Home</a></li>
<li><a href="profile.php"><span class="glyphicon glyphicon-modal-window"></span>Product</a></li>
</ul>
</div>
</div>
<p><br/></p>
<p><br/></p>
<p><br/></p>
<div class="container-fluid">
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<div class="panel panel-default">
<div class="panel-heading"></div>
<div class="panel-body">
<h1>Thankyou </h1>
<hr/>
<p>Hello <?php echo "<b>".$_SESSION["name"]."</b>"; ?>,Your payment process is
successfully completed and your Transaction id is <b><?php echo $trx_id; ?></b><br/>
you can continue your Shopping <br/></p>
<a href="index.php" class="btn btn-success btn-lg">Continue Shopping</a>
</div>
<div class="panel-footer"></div>
</div>
</div>
<div class="col-md-2"></div>
</div>
</div>
</body>
</html>
<?php
}
}else{
header("location:index.php");
}
}
}
?><html>
<head>
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,400i,700,900&display=swap" rel="stylesheet">
</head>
<style>
body {
text-align: center;
padding: 40px 0;
background: #EBF0F5;
}
h1 {
color: #88B04B;
font-family: "Nunito Sans", "Helvetica Neue", sans-serif;
font-weight: 900;
font-size: 40px;
margin-bottom: 10px;
}
p {
color: #404F5E;
font-family: "Nunito Sans", "Helvetica Neue", sans-serif;
font-size:20px;
margin: 0;
}
i {
color: #9ABC66;
font-size: 100px;
line-height: 200px;
margin-left:-15px;
}
.card {
background: white;
padding: 60px;
border-radius: 4px;
box-shadow: 0 2px 3px #C8D0D8;
display: inline-block;
margin: 0 auto;
}
.heading a.continue:link, .heading a.continue:visited {
text-decoration: none;
font-family: 'Montserrat', sans-serif;
letter-spacing: -0.015em;
font-size: 0.75em;
padding: 1em;
color: #fff;
background: #82ca9c;
font-weight: bold;
border-radius: 50px;
float: right;
text-align: right;
-webkit-transition: all 0.25s linear;
-moz-transition: all 0.25s linear;
-ms-transition: all 0.25s linear;
-o-transition: all 0.25s linear;
transition: all 0.25s linear;
}
.heading a.continue:after {
content: "\276f";
padding: 0.5em;
position: relative;
right: 0;
-webkit-transition: all 0.15s linear;
-moz-transition: all 0.15s linear;
-ms-transition: all 0.15s linear;
-o-transition: all 0.15s linear;
transition: all 0.15s linear;
}
.heading a.continue:hover, .heading a.continue:focus, .heading a.continue:active {
background: #f69679;
}
.heading a.continue:hover:after, .heading a.continue:focus:after, .heading a.continue:active:after {
right: -10px;
}
</style>
<body>
<div class="card">
<div style="border-radius:200px; height:200px; width:200px; background: #F8FAF5; margin:0 auto;">
<i class="checkmark">✓</i>
</div>
<h1>Your order placed Successfully</h1>
<p>We received your purchase request;<br/> We'll be in touch with you shortly!</p>
</div>
</body>
</html>