-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathviewslot.php
More file actions
211 lines (171 loc) · 6.01 KB
/
Copy pathviewslot.php
File metadata and controls
211 lines (171 loc) · 6.01 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
$conn = mysqli_connect("localhost","root","","eventadministration") or die($conn);
$query="DELETE
from slot
WHERE EventDate < CURDATE() and available = 1";
$res= mysqli_query($conn, $query);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View slot</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
<meta content="" name="description">
<link href="img/favicon.png" rel="icon">
<link href="img/apple-touch-icon.png" rel="apple-touch-icon">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Montserrat:300,400,500,700" rel="stylesheet">
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="lib/animate/animate.min.css" rel="stylesheet">
<link href="lib/ionicons/css/ionicons.min.css" rel="stylesheet">
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="lib/lightbox/css/lightbox.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<style>
body{
background: url("img/black.jpg");
background-size:cover;
background-repeat:repeat-y;
color:white;
}
.box{
background: rgba(0,0,0,0.1);
}
.add_employee_form span{
color:red;
}
p{
color:red;
}
.form-control input[type="text"]
{
color: blue;
}
#myInput {
background-image: url('/css/searchicon.png'); /* Add a search icon to input */
background-position: 10px 12px; /* Position the search icon */
background-repeat: no-repeat; /* Do not repeat the icon image */
width: 100%; /* Full-width */
font-size: 16px; /* Increase font-size */
padding: 12px 20px 12px 40px; /* Add some padding */
border: 1px solid #ddd; /* Add a grey border */
margin-bottom: 12px; /* Add some space below the input */
}
#myTable {
border-collapse: collapse; /* Collapse borders */
width: 100%; /* Full-width */
border: 1px solid #ddd; /* Add a grey border */
font-size: 18px; /* Increase font-size */
}
#myTable th, #myTable td {
text-align: left; /* Left-align text */
padding: 12px; /* Add padding */
}
#myTable tr {
/* Add a bottom border to all table rows */
border-bottom: 1px solid #ddd;
}
#myTable tr.header, #myTable tr:hover {
/* Add a grey background color to the table header and on hover */
background-color: black;
}
.box{border:1px solid lightgrey;padding:20px;border-radius:5px;}
.box-sm{border:1px solid lightgrey;padding:5px;border-radius:5px;background-color:white;}
</style>
</head>
<body>
<br><br><br><br><br>
<header id="header">
<div class="container-fluid">
<div id="logo" class="pull-left">
<h1><a href="#intro" class="scrollto">View Available Slots</a></h1>
</div>
<?php
$oid = $_GET["oid"];
echo" <nav id='nav-menu-container'>
<ul class='nav-menu'>
<li class='menu-active'><a href='welcomeorganizer.php?oid=". $oid . "'>Organizer Home</a></li>
<li class='menu-active'><a href='addevent.php?oid=". $oid . "'>Add Event</a></li>
<li><a href='logout2.php'>Logout</a></li>
</ul>
</nav>";
?>
</div>
</header>
<br><br>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search Venue">
<table id="myTable">
<tr class="header">
<th style="width:20%;">Date</th>
<th style="width:20%;">Venue</th>
<th style="width:20%;">Start Time</th>
<th style="width:20%;">End time</th>
<th style="width:20%;">Location</th>
<th style="width:20%;">Capacity</th>
</tr>
<?php
$que = "SELECT EventDate,StartTime,EndTime,SlotID,VenueName,VenueLocation,VenueCapacity
FROM slot join venue_ on slot.VenueID=venue_.VenueID
WHERE available = 1
order by EventDate asc";
$res = mysqli_query($conn,$que);
while($row = mysqli_fetch_assoc($res))
{
echo "<tr>
<th scope='row'>". date('j F, y',strtotime($row['EventDate'])) . "</th>
<td>". $row['VenueName'] . "</td>
<td>". date('h:i a', strtotime($row['StartTime'])) . "</td>
<td>". date('h:i a', strtotime($row['EndTime'])) . "</td>
<td>". $row['VenueLocation'] . "</td>
<td>". $row['VenueCapacity'] . "</td>
<td> <a href='bookevent.php?id=". $row['SlotID'] . "&oid=".$oid."'>Book</a> </td>
</tr>";
}
?>
</table>
<script>
function myFunction() {
// Declare variables
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
// Loop through all table rows, and hide those who don't match the search query
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[0];
if (td) {
txtValue = td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
</script>
</body>
</html>