-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaynow.php
175 lines (145 loc) · 6.31 KB
/
paynow.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?php include "session.php";
if (isset($_GET['id'])) {
$id = $conn->quote($_GET['id']);
$sql = "SELECT * FROM producttb WHERE id=$id";
$result = $conn->query($sql) or die('bad query');
$row = $result->fetch(PDO::FETCH_ASSOC);
} else {
header("location:project");
}
if (!isset($user['id'])) {
$_SESSION['error'] = 'Signin First !!!';
header("location:Signin");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include "meta.php" ?>
<title>
PayNow || Unibooks
</title>
<!-- Fonts and icons -->
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900|Roboto+Slab:400,700" />
<!-- Nucleo Icons -->
<link href="assets/css/nucleo-icons.css" rel="stylesheet" />
<link href="assets/css/nucleo-svg.css" rel="stylesheet" />
<!-- Font Awesome Icons -->
<script src="https://kit.fontawesome.com/e9de02addb.js" crossorigin="anonymous"></script>
<!-- Material Icons -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons+Round" rel="stylesheet">
<!-- CSS Files -->
<link id="pagestyle" href="assets/css/material-dashboard.css?v=3.0.4" rel="stylesheet">
<link id="pagestyle" href="assets/css/profile.css" rel="stylesheet">
<script src="https://js.paystack.co/v1/inline.js"></script>
<script src="https://checkout.flutterwave.com/v3.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-12 vw-80">
<div class="card">
<div class=" card-body ">
<form id="payForm">
<div class="input-group input-group-outline my-3">
<label for="email">Email Address</label>
<input type="email" class="form-control w-100" id="email-address" value="<?php echo $user['email']; ?>" required />
</div>
<div class="input-group input-group-outline my-3">
<input type="hidden" id="amount" value="<?php echo $row['product_price']; ?>" />
<input type="hidden" name="phone" id="phone" value="<?php echo $user['phone'] ?>" required />
<input type="hidden" name="book" id="book-id" value="<?php echo $row['id'] ?>" required />
</div>
<div class="input-group input-group-outline my-3">
<label for="first-name">First Name</label>
<input type="text" class="form-control w-100" value="<?php echo $user['firstname']; ?>" id="first-name" />
</div>
<div class="input-group input-group-outline my-3">
<label for="last-name">Last Name</label>
<input type="text" class="form-control w-100" value="<?php echo $user['lastname']; ?>" id="last-name" />
</div>
<div class="my-3">
<label for="payment">Form of Payment</label>
<div class="form-check">
<input id="credit" name="paymentMethod" type="radio" class="form-check-input" checked required>
<label class="form-check-label" onclick="paystack()" for="credit">Paystack</label>
</div>
<div class="form-check">
<input id="debit" name="paymentMethod" type="radio" class="form-check-input" required>
<label class="form-check-label" onclick="flutterwave()" for="debit">Flutterwave</label>
</div>
<div class="form-check">
<input id="paypal" name="paymentMethod" type="radio" class="form-check-input" required>
<label class="form-check-label" onclick="bank_transfer()" for="paypal">Bank Transfer</label>
</div>
</div>
<div class="form-submit">
<div id="paystack">
<button type="submit" class="btn btn-dark btn-large mt-4" onclick="payWithPaystack()"> Pay </button>
<a href="#" class="btn btn-dark btn-large mt-4" onclick="history.back()">Cancel</a>
</div>
<div style="display: none;" id="flutterwave">
<button type="submit" class="btn btn-dark btn-large mt-4" onclick="payNow()"> Pay</button>
<a href="#" class="btn btn-dark btn-large mt-4" onclick="history.back()">Cancel</a>
</div>
<div style="display: none;" id="bank_transfer">
<button type="submit" class="btn btn-dark btn-large mt-4"> Pay</button>
<a href="#" class="btn btn-dark btn-large mt-4" onclick="history.back()">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script>
var link = <?php echo $row['id']; ?>
let div = document.getElementById('paystack');
let display = 0;
let div2 = document.getElementById('flutterwave');
let div3 = document.getElementById('bank_transfer');
function paystack() {
div.style.display = 'block';
div2.style.display = 'none';
div3.style.display = 'none';
}
function flutterwave() {
div.style.display = 'none';
div2.style.display = 'block';
div3.style.display = 'none';
}
function bank_transfer() {
div3.style.display = 'block';
div2.style.display = 'none';
div.style.display = 'none';
}
</script>
<script src="assets/js/checkout.js"></script>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid py-4">
<!-- footer -->
<div class="container-fluid bg- mt-5 ">
<footer class="py-3 my-4 ">
<ul class="nav justify-content-center border-bottom pb-3 mb-3">
<li class="nav-item"><a href="about_us" class="nav-link px-2 text-light">Home</a></li>
<li class="nav-item"><a href="#" class="nav-link px-2 text-light">More Website</a></li>
<li class="nav-item"><a href="donate" class="nav-link px-2 text-light">Donate</a></li>
<li class="nav-item"><a href="faq" class="nav-link px-2 text-light">FAQs</a></li>
<li class="nav-item"><a href="about_us" class="nav-link px-2 text-light">About Us</a></li>
</ul>
<p class="text-center text-muted">©
<script>
document.write(new Date().getFullYear())
</script> Testech, Ltd
</p>
</footer>
</div>
<!-- footer -->
</div>
</body>
</html>