-
Notifications
You must be signed in to change notification settings - Fork 0
/
payment_success.php
151 lines (88 loc) · 2.88 KB
/
payment_success.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
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
<?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>sky Store</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">online shp</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");
}
}
}
?>