Repository navigation
Expand file tree
/
Copy pathguest.php
More file actions
134 lines (123 loc) · 8.36 KB
/
Copy pathguest.php
File metadata and controls
134 lines (123 loc) · 8.36 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
<div class="modal fade modal-lg" id="guestModal" role="dialog">
<!-- Event pop-up -->
<div class="top modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header bg-light text-dark">
<h1 class="modal-title fs-5 fw-bold" id="exampleModalToggleLabel">GUESTS</h1>
<button type="button" class="btn-close text-dark" data-bs-dismiss="modal" aria-label="Close">
<span style="display: flex; align-items: center; justify-content: center; height: 100%;">
×
</span>
</button>
</div>
<div class="modal-body bg-dark text-light">
<section class="table">
<div class="container-fluid">
<div class="card text-center">
<div class="card-header align-items-center d-flex">
<a href="#scanPrepaid.php" data-bs-target="#ScanPrepaidModal" data-bs-toggle="modal"
title="Scan Paid Tickets..." class="btn btn-dark">
<i class="fa-solid fa-plus fa-2x"></i>
<br><i class="fw-bold">Add Prepaid</i>
</a>
<h6 class="mx-2">
SHOW
<select class="text-center ScanValueE" id="ScanValueE" required name="eventId">
<option class="text-center" selected value="">All</option>
<!-- fetching the event that were created by the user -->
<?php include_once 'conn.php';
$UserId = $_SESSION['user']['id']; //getting the user id
$sql = "SELECT * FROM event WHERE UserId = '$UserId'";
$result = mysqli_query($con, $sql); //excuting the query
while ($row = mysqli_fetch_assoc($result)) {
$eId = $row["id"];
$sqlSeat = "SELECT * FROM seat WHERE eventId = '$eId'";
$result_sqlSeat = mysqli_query($con, $sqlSeat); //excuting the query
$count = mysqli_num_rows($result_sqlSeat);
$row_sqlSeat = mysqli_fetch_assoc($result_sqlSeat);
echo "<option class='fw-bold text-center' value=" . $row_sqlSeat["eventId"] . ">" . $row["Name"] . "</option>"; //showing all the events that you have created seats for
}
?>
</select>
GUESTS
</h6>
</div>
<div class="card-body overflow-auto">
<table
class=" table table-resopnsive table-bordered fs-6 table-striped justify-content-center ">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Guest Name</th>
<th scope="col">Status</th>
<th scope="col">Event Name</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM event WHERE UserId = '$UserId'";
$result = mysqli_query($con, $sql); //excuting the query
$scope = 0;
while ($row = mysqli_fetch_assoc($result)) {
$eId = $row["id"]; //id of the event
$eName = $row["Name"]; //name of the event
$sqlSeat = "SELECT * FROM seat WHERE eventId = '$eId'";
$result_sqlSeat = mysqli_query($con, $sqlSeat); //excuting the query
$count = mysqli_num_rows($result_sqlSeat);
$row_sqlSeat = mysqli_fetch_assoc($result_sqlSeat);
if (isset($row_sqlSeat)) {
$seatId = $row_sqlSeat["id"];
// echo $seatId;
$sqlSeat = "SELECT * FROM ticket WHERE SeatId = '$seatId'";
$result1 = mysqli_query($con, $sqlSeat);
// selecting from the image
while ($row1 = mysqli_fetch_assoc($result1)) {
$scope++;
?>
<tr class="text-start" id="<?php echo $row1["id"]; ?>">
<th scope="row">
<?php echo $scope; ?>
</th>
<td>
<?php echo $row1["GuestName"]; ?>
</td>
<td>
<?php echo $row1["status"]; ?>
</td>
<td>
<?php echo $row1["tranDate"]; ?>
</td>
<td>
<?php echo $row1["tranTime"]; ?>
</td>
<td>
<?php echo $eName; ?>
</td>
<th scope="col" class="d-flex" disabled>
<a href="#" class="editbtn btn d-inline">
<span class="m-1" title="Edit Event"><i
class="fa-regular fa-pen-to-square"></i></span>
</a>
<a href="#" class="deletebtn btn d-inline">
<span class="m-1" title="Delete Event"><i
class="fa-regular fa-trash-can"></i></span>
</a>
</th>
</tr>
<?php }
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</section>
</div>
<div class="modal-footer justify-content-center">
<P class="fs-5">Customer satisfaction is our GOAL!</P>
</div>
</div>
</div>
</div>