-
Notifications
You must be signed in to change notification settings - Fork 0
/
Event-Reservation-Select.php
73 lines (72 loc) · 2.33 KB
/
Event-Reservation-Select.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
<?php
include('Connection.php');
session_start();
//$sql = "SELECT * FROM events where course = 'BSIT' and situation = 'Verified' order by date";
$sql = "SELECT *,ap_reservation_main.ID as 'Reserve' FROM ((events INNER JOIN activityproposal ON events.id = activityproposal.events_id)
INNER JOIN ap_reservation_main ON ap_reservation_main.ap_id = activityproposal.ap_id)
inner join student_council on student_council.idstudent_council = events.student_council_idstudent_council
where student_council.organization_ID = '".$_SESSION['OrgID']."'";
// SELECT *, users.Department FROM events INNER JOIN users ON events.created = users.ID where users.Department = "BSN" and Situation = 'Verified' order by date
$result = mysqli_query($conn, $sql);
if(mysqli_num_rows($result) > 0 )
{
echo '<div class = "table-responsive">';
echo '<table class = "table">
<thead>
<tr>
<th colspan = "5" class = "text-center">List of <kbd>Reservation</kbd></th>
</tr>
<tr>
<th>Title</th>
<th>Date</th>
<th>Place</th>
<th>Status</th>
<th>Function</th>
</tr>
</thead>';
while($row = mysqli_fetch_array($result))
{
if($row["reservation_status"] == 'Returned')
{
$stat = 'danger';
}
elseif ($row["reservation_status"] == 'Pending')
{
$stat = 'info';
}
else
{
$stat = 'success';
}
echo '<tr class = "'.$stat.'">
<td class = "user_id">' .$row["title"].'</td>
<td class ="firstname" >'.substr($row["start"],0,10).'</td>
<td class ="firstname" >'.$row["place"].'</td>
<td class ="firstname" >'.$row["reservation_status"].'</td>
<td>
<a name = "btn_makeAP" id = "btn_viewAP" data-toggle="modal" data-target="#viewActivtyProposalForm"
data-id5="'.$row["ap_id"].'" class="btn btn-sm btn-info">
<span class="glyphicon glyphicon-eye-open"></span> View Activity Proposal</a>
<a name = "btn_makeAP" id = "btn_makeReservation"
data-id5="'.$row["Reserve"].'" class="btn btn-sm btn-primary">
<span class="glyphicon glyphicon-pencil"></span> Make Reservation</a>
</td>
</tr>';
}
}
else
{
echo '<table class = "table">
<thead>
<tr>
<th colspan = "3" class = "text-center">List of <kbd>Reservation</kbd></th>
<tr>
</thead>
';
echo '<tr>
<td colspan = "3" class = "text-center"> No Reservation made yet </td>
</tr>';
}
echo '</table>';
echo '</div>';
?>