-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatt-info.php
More file actions
177 lines (167 loc) · 6.97 KB
/
att-info.php
File metadata and controls
177 lines (167 loc) · 6.97 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
<?php include('att-id.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="res-info.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>
<?php if (isset($_SESSION['user'])) { ?>
<div class="header">
<a href="home.php"><img src="let's%20see.png" style="max-width:200px;
max-height:70px;
float: left;
margin-left: 20px;
margin-top: 5px;"></a>
<p class="login">
Welcome <strong><?php echo $_SESSION['user']['first']; ?> <?php echo $_SESSION['user']['last']; ?></strong>
</p>
</div>
<?php
}
else{
?>
<div class="header">
<a href="home.php"><img src="let's%20see.png" style="max-width:200px;
max-height:70px;
float: left;
margin-left: 20px;
margin-top: 5px;"></a>
<button type="submit" class="button view_data">Login</button>
</div>
<?php
}
?>
<div class="sections">
<ul>
<a href="restaurants.php"><li class="sidemenu">Restaurants</li></a>
<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>
<form method="post">
<div>
<h2><?php echo $row['Name']; ?> </h2>
<img src="<?php echo $row['img_link']; ?>"/>
<div class="button" style="margin-right: 32%; margin-top: 10px;">
<?php echo "<td><a href=\"att-connect.php?ID=" . $id . "\">Connect!</a></td>"; ?>
</div>
<br>
<br>
<br>
<br>
<br>
<div class="texter">
<p style="float: left"> Location: <?php echo $row['Location']; ?></p>
<p style="float: left"> Hours: <?php echo $row['Hours']; ?></p>
<p style="float: right; margin-right: 30px"> Rating: <?php echo $row['Ratings']; ?></p>
</div>
<br>
<br>
<div class="texter">
<p> Description: "<?php echo $row['Description']; ?>" </p>
<br>
</div>
</div>
</form>
<div class="texter">
<table>
<tr><p style="font-size: 30px;">Reviews</p></tr>
<?php
$query="SELECT * FROM att WHERE event_id='$id' AND comment IS NOT NULL";
$sql=mysqli_query($db,$query);
while($res=mysqli_fetch_assoc($sql))
{
$user_id = $res['user_id'];
$q="SELECT * FROM user WHERE id='$user_id'";
$s=mysqli_query($db,$q);
while($r=mysqli_fetch_assoc($s)){
?>
<tr><p><?php echo $r['username']; ?>:<?php echo $res['comment']; ?></p></tr>
<?php
}
}
?>
</table>
<form method="post">
<input type="text" name="comment">
<input type="submit" value="Submit" name="Submit">
</form>
</div>
<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>
<?php
if(isset($_POST['Submit'])){
$comment = e($_POST['comment']);
$user_id = $_SESSION['user']['id'];
$query= "INSERT INTO att (comment, event_id, user_id) VALUES('$comment','$id','$user_id')";
mysqli_query($db,$query);
?>
<script>
location.href = location.href;
</script>
<?php
}
?>
<!--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" style="color:black">
<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>
</body>
</html>