-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestaurants.php
More file actions
160 lines (147 loc) · 6.62 KB
/
restaurants.php
File metadata and controls
160 lines (147 loc) · 6.62 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
<?php include('functions.php'); ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>HACK UMASS VI</title>
<link rel="stylesheet" href="restaurants.css">
<link rel="stylesheet" type="text/css" href="style-detail.css">
<link rel="stylesheet" type="text/css" href="modal.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class = "wrapper" style="padding-bottom: 50px">
<?php if (isset($_SESSION['user'])) { ?>
<div class="header">
<a href="home.php"><img src="let's%20see.png" class="logo"></a>
<p class="login">
Welcome <strong><?php echo $_SESSION['user']['first']; ?> <?php echo $_SESSION['user']['last']; ?></strong> |
<button name="logout">Logout</button>
</p>
</div>
<?php
}
else{
?>
<div class="header">
<a href="home.php"><img src="let's%20see.png" class="logo"></a>
<button type="submit" class="button view_data">Login</button>
</div>
<?php
}
?>
<div class="sections">
<ul>
<li class="sidemenu" style="background-color: #453F78; color:white">Restaurants</li>
<a href="attractions.php"><li class="sidemenu">Attractions</li></a>
<a href="events.php"><li class="sidemenu">Events</li></a>
<a href=""><li class="sidemenu">Convenience Stores</li></a>
<a href=""><li class="sidemenu">Hotels</li></a>
<br>
<a href=""><li class="sidemenu">Schools</li></a>
<a href=""><li class="sidemenu">Hospitals</li></a>
<a href=""><li class="sidemenu">Personal Care</li></a>
<a href=""><li class="sidemenu">Leisure</li></a>
</ul>
</div>
<div class="floaters">
<?php
$query="SELECT * FROM restuarants_bars";
$sql=mysqli_query($db,$query);
while($res=mysqli_fetch_assoc($sql)){
?>
<div class="innerfloaters">
<h2 align = "center">
<?php $name = $res['Name']; ?>
<?php echo "<td><a href=\"res-info.php?ID=" . $res['ID'] . "\">$name</a></td>"; ?>
</h2>
<br>
<img src="<?php echo $res["img_link"]; ?>" class="icon">
<div style="float:left; margin-left:20px;">
Operating hours: <?php echo $res["Hours"]; ?>
<br>
<br>
Location: <?php echo $res["Location"]; ?>
</div>
<p style="float: right; margin-right: 25px;">Rating: <?php echo $res["Ratings"]; ?>/10</p>
</div>
<?php
}
?>
</div>
<div class="push"></div>
</div>
<!--<div class="foot">
Created With Love By:
<br>
Anushree Jana;
Shreya Sawant;
Akash Munjial
</div>-->
<!--<footer>
<div style="height: 80px">
<a href=""><div class="foot button" style="float: left">About</div></a>
<a href=""><div class="foot button" style="float: left">Contact</div></a>
<a href="Readme.txt"><div class="foot button" style="float: right">Legal</div></a>
</div>
</footer>-->
<!--ajax for modal -->
<script>
$(document).ready(function(){
$('.view_data').click(function(){
$.ajax({
method:"post",
success:function(data){
$('#dataModal').modal("show");
}
});
});
});
</script>
<!-- Modal for login -->
<div id="dataModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title" align="center">Login:</h4>
</div>
<div class="modal-body" id="success-fail">
<form method="post">
<p> <?php echo display_error(); ?></p>
<div class="input-group">
<label>Username</label>
<input type="text" name="susername">
</div>
<div class="input-group">
<label>Password</label>
<input type="password" name="spassword">
</div>
<div class="input-group">
<button type="submit" class="btn" name="login_btn">Login</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!--<footer>
<div style="height: 80px">
<a href=""><div class="foot button" style="float: left">About</div></a>
<a href=""><div class="foot button" style="float: left">Contact</div></a>
<a href="Readme.txt"><div class="foot button" style="float: right">Legal</div></a>
</div>
</footer>-->
<div class="foot">
Created With Love By:
Anushree Jana;
Shreya Sawant;
Akash Munjial<br>
<a href="about.php"><div style="float: left;margin-left: 600px;"><strong>About</strong></div></a>
<a href=""><div style="float: left; margin-left: 50px;"><strong>Contact</strong></div></a>
<a href="Readme.txt"><div style="float: left; margin-left: 200 px">   <strong>Legal</strong></div></a>
</div>
</body>
</html>