-
Notifications
You must be signed in to change notification settings - Fork 0
/
addLocation.php
142 lines (125 loc) · 5.99 KB
/
addLocation.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
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<style>
a {
text-decoration: none;
}
</style>
<meta charset="utf-8">
<title>Room Reservation System IIITA</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="_css/main.css">
<link rel="stylesheet" href="_css/base.css">
<script src="_js/modernizr.js"></script>
<link rel="icon" type="image/png" href="images/iiita.png" />
<link rel="stylesheet" type="text/css" href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<?php include("model/query.php");
session_start();
if ($_SESSION['userType'] == 2 || $_SESSION['userType'] == 3) {
header('Location: bookinglog.php');
} ?>
</head>
<body id="top">
<header class="s-header header">
<div class="header__logo">
<a class="logo" href="adminhome.php">
<img src="images/iiita.png" alt="Homepage">
</a>
</div>
<a class="header__toggle-menu" href="#0" title="Menu"><span>Menu</span></a>
<nav class="header__nav-wrap">
<h2 class="header__nav-heading h6">Navigate to</h2>
<ul class="header__nav">
<?php
if ($_SESSION['userType'] != 3) {
echo "<li><a href='adminhome.php' style='text-decoration:none'>Home</a></li>
<li class='has-children'>
<a href='#0' style='text-decoration:none'>Booking</a>
<ul class='sub-menu'>
<li><a href='facultynewbookings.php' style='text-decoration:none'>New Booking</a></li>
<li><a href='adminCancelBookings.php' style='text-decoration:none'>Cancel Booking</a></li>
</ul>
</li>";
} ?>
<li><a href="bookinglog.php" title="" style="text-decoration:none">Booking Log</a></li>
<li><a href="calendar.php" title="" style="text-decoration:none">Calendar</a></li>
<?php
if ($_SESSION['userType'] == 1) {
echo "<li class='has-children current'>
<a href='#0' title=''style='text-decoration:none'>Adding</a>
<ul class='sub-menu'>
<li><a href='addDepartment.php'style='text-decoration:none'>Department</a></li>
<li><a href='addCourse.php'style='text-decoration:none'>Course</a></li>
<li><a href='addRoom.php'style='text-decoration:none'>Room</a></li>
<li><a href='addLocation.php'style='text-decoration:none'>Location</a></li>
</ul>
</li>";
}
?>
<li class="has-children" style="vertical-align:middle">
<a href="#0" title="" style="text-decoration:none"><img src="./images/person-circle.svg"
width="32" /></a>
<ul class="sub-menu">
<li><a href="profile.php" style="text-decoration:none">Profile</a></li>
<li><a href="controller/logout.php" style="text-decoration:none">Logout</a></li>
</ul>
</li>
</ul>
<a href="#0" title="Close Menu" class="header__overlay-close close-mobile-menu">Close</a>
</nav>
</header>
<section class="s-content s-content--top-padding s-content--narrow">
<div class="limiter">
<div class="container-login100" style="gap:2rem">
<div class="wrap-login100 p-t-30 p-b-50">
<span class="login100-form-title p-b-41" style=" color: #fad02c;">
New Location
<br><br>
</span>
<form class="login100-form validate-form p-b-33 p-t-5" action="controller/addLoc.php" method="post">
<div>
<input id="dept" class="input100" type="text" name="loc" placeholder="Location" required>
<span class="stopp" id="deptSpan"></span>
</div>
<br><br>
<div class="container-login100-form-btn m-t-32">
<button class="login100-form-btn" type="submit" value="submit">
CONFIRM
</button>
</div>
</form>
</div>
<div style="overflow: scroll;margin:0;height:60rem" class="row login102-form">
<h1 style=" color: #fad02c;padding:1rem">All Locations</h1>
<form action="controller/deleteLoc.php" method="post">
<table class="login100-form validate-form p-b-33 p-t-5">
<tr>
<th>Location</th>
<th>Delete</th>
</tr>
<?php
$deptList = getAllLocations();
foreach ($deptList as $b) {
?>
<tr>
<td><?php echo $b['name']; ?></td>
<td><button type="submit" name="id" value="<?php echo $b['id'] ?>"><img
src="./images/delete.png" style="width:24px;cursor:pointer" /></button>
</td>
</tr>
<?php }
?>
</table>
</form>
</div>
</div>
</div>
</section>
<script src="_js/jquery-3.2.1.min.js"></script>
<script src="_js/main.js"></script>
</body>
</html>