-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpaymentinfocash.php
More file actions
166 lines (141 loc) · 6.69 KB
/
paymentinfocash.php
File metadata and controls
166 lines (141 loc) · 6.69 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
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start();
include 'config.php';
$user_id = $_SESSION['user_id'];
$concert_id = $_GET['concert_id'];
$selectuser = mysqli_query($conn, "SELECT * FROM `user_form` WHERE id = '$user_id'") or die('query failed');
$selectconcert = mysqli_query($conn, "SELECT * FROM `tblconcert` WHERE concert_id = '$concert_id'") or die('query failed');
$totalPrice = isset($_GET['total_price']) ? $_GET['total_price'] : 0;
$selectedSeatsCount = isset($_GET['count']) ? $_GET['count'] : 0;
$transactionNumber = isset($_GET['transaction_no']) ? $_GET['transaction_no'] : null;
if(mysqli_num_rows($selectuser) > 0) {
$fetchuser = mysqli_fetch_assoc($selectuser);
} else {
$fetchuser = null;
}
if(mysqli_num_rows($selectconcert) > 0) {
$fetchcon = mysqli_fetch_assoc($selectconcert);
} else {
$fetchcon = null;
}
if(isset($_GET['selected_seats'])) {
$selectedSeats = urldecode($_GET['selected_seats']);
} else {
$selectedSeats = "No seats selected";
}
?>
<!DOCTYPE html>
<html lang="en" title="Coding design">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<title>Payment Information</title>
<link rel="icon" type="image/x-icon" href="css/images/logo.png">
<link rel="stylesheet" href="css/paymentinfo.css">
</head>
<body>
<main class="table">
<section class="table__header">
<h1><i class="fas fa-ticket-alt"></i> Ticket Information</h1>
</section>
<form id="paymentForm" method="post" action="ticketshistory.php" class="hidden">
<div class="table-container">
<section class="table__body">
<table>
<thead>
<tr>
<th colspan="2">
<img src="css/images/cash.png" id="seatimage" alt="Concert Map">
</th>
</tr>
<tr>
<th><i class="fas fa-music"></i> Concert Information:
<?php echo $fetchcon['concert_name'] ?>
</th>
<th><i class="far fa-calendar-alt"></i> Concert Date:
<?php echo date('F j, Y', strtotime($fetchcon['concert_date'])); ?><br>
<?php echo date('h:i A', strtotime($fetchcon['concert_time'])); ?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td><i class="fas fa-user"></i> Ticket Buyer:
<?php echo $fetchuser['fullname'] ?>
</td>
<td><i class="fas fa-phone"></i> Phone Number: (+63)
<?php echo $fetchuser['phonenum'] ?>
</td>
</tr>
<tr>
<td><i class="fas fa-chair"></i> Chosen Seats:
<?php echo $selectedSeats ?>
</td>
<td><i class="fas fa-sort-numeric-up-alt"></i> Quantity:
<?php echo $selectedSeatsCount ?>
</td>
</tr>
<tr>
<td><i class="fas fa-home"></i> User Address:
<?php echo $fetchuser['address'] ?>
</td>
<td><i class="fas fa-map-marker-alt"></i> Venue:
<?php echo $fetchcon['concert_venue'] ?>
</td>
</tr>
<tr>
<td><i class="far fa-clock"></i>
<?php
date_default_timezone_set('Asia/Singapore');
$current_time = date("h:i:s A");
echo "Current Time (Singapore): ".$current_time ?>
</td>
<td><i class="fas fa-microphone"></i> Artist:
<?php echo $fetchcon['concert_artist'] ?>
</td>
</tr>
<tr>
<td><i class="fas fa-money-bill"></i> Total Price: <span id="result">₱
<?php echo number_format($totalPrice, 2) ?>
</td>
<td><i class="far fa-calendar-alt"></i> Payment Date:
<?php echo date("Y/m/d") ?>
</td>
</tr>
<tr>
<td><i class="fas fa-credit-card"></i> Payment Mode: Cash
</td>
<td><i class="fas fa-credit-card"></i> Transaction Number:
<?php echo $transactionNumber; ?>
</td>
</tr>
</tbody>
</table>
<div class="qr-code" id="qrCodeContainer">
<!-- Placeholder for the QR code image -->
</div>
</section>
<a href="home.php" class="button">Back To Main Menu</a>
<input type="submit" name="cancel" class="button" value="Cancel Payment"
style="background-color:crimson;">
</form>
</main>
<?php
?>
<script>
const qrContainer = document.getElementById("qrCodeContainer");
const qrValue = "<?php echo $transactionNumber; ?>";
const qrSize = 300; // Set your desired size in pixels
// Generate QR Code using Google Charts API
const qrCodeUrl = `https://chart.googleapis.com/chart?chs=${qrSize}x${qrSize}&cht=qr&chl=${qrValue}`;
const qrCodeImage = document.createElement("img");
qrCodeImage.src = qrCodeUrl;
// Append the QR code image to the container
qrContainer.appendChild(qrCodeImage);
</script>
</body>
</html>