forked from COP-4710/Event_Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheventdetails.php
More file actions
165 lines (161 loc) · 5.4 KB
/
eventdetails.php
File metadata and controls
165 lines (161 loc) · 5.4 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
<?php
session_start();
include("config.php");
?>
<!DOCTYPE html>
<html lang =\"en\">
<head>
<title>
Event Details
</title>
<style>
/* Set the size of the div element that contains the map */
#map {
height: 400px; /* The height is 400 pixels */
width: 400px; /* The width is the width of the web page */
}
section {
width: 100%;
height: 100vh;
background: url(bg.jpg);
background-size: cover;
}
section .window {
color: white;
margin: auto;
padding: 30px;
text-align: center;
width: 500px;
height: 500px;
background-color: rgba(0,0,0,0.7);
}
section .window ul {
overflow-y: auto;
}
</style>
<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">
</head>
<body>
<section>
<div class = 'window'>
<h2>
<?php echo $_SESSION["event_name"]; ?>
</h2>
<h2>
<?php echo $_SESSION["start"]; ?> - <?php echo $_SESSION["end"]; ?>
</h2>
</br>
<p>
Location: <?php echo $_SESSION["event_name"]; ?>
</p>
</br>
<p>
<?php echo $_SESSION["description"]; ?>
</p></br>
<ul>
<?php
// Need to modify variables here
$sql ="SELECT *FROM comment where eventid = '{$_SESSION["eventid"]}' ORDER BY timestamp ASC";
$result =$db->query($sql);
if ($_SESSION['option-button'] == 1){
$sql ="SELECT *FROM comment where eventid = '{$_SESSION["eventid"]}' ORDER BY timestamp ASC";
$result =$db->query($sql);
while($_SESSION['comments'] = $result->fetch_assoc()){
echo " <li>
<input type='hidden' name='commentid' value={$_SESSION['comments']['commentid']}>
<h3>{$_SESSION['comments']['username']} </h3>
<h4>{$_SESSION['comments']['rating']} </h4>
<p>{$_SESSION['comments']['description']}</p>
</li>"; }
echo "<form action = 'makecomment.php' method='post'>
<!--<input type='hidden' name='uid' value='Anonymous'>-->
<textarea name='description'>Type comment here</textarea>
<select name='rating'>
<option value='1'>Rating 1</option>
<option value='2'>Rating 2</option>
<option value='3'>Rating 3</option>
<option value='4'>Rating 4</option>
<option value='5'>Rating 5</option>
</select>
<button name='submit' type='submit'>Comment</button>
</form>";
}
//RSO
if ($_SESSION['option-button'] == 2){
$sql ="SELECT *FROM commentRSO where RSOe = '{$_SESSION["eventid"]}' ORDER BY timestamp ASC";
$result =$db->query($sql);
while($_SESSION['comments'] = $result->fetch_assoc()){
echo " <li>
<input type='hidden' name='commentid' value={$_SESSION['comments']['commentid']}>
<h3>{$_SESSION['comments']['username']} </h3>
<h4>{$_SESSION['comments']['rating']} </h4>
<p>{$_SESSION['comments']['description']}</p>
</li>"; }
echo "<form action = 'makecommentRSO.php' method='post'>
<!--<input type='hidden' name='uid' value='Anonymous'>-->
<textarea name='description'>Type comment here</textarea>
<select name='rating'>
<option value='1'>Rating 1</option>
<option value='2'>Rating 2</option>
<option value='3'>Rating 3</option>
<option value='4'>Rating 4</option>
<option value='5'>Rating 5</option>
</select>
<button name='submit' type='submit'>Comment</button>
</form>";
}
//private
if ($_SESSION['option-button'] == 3)
{
$sql ="SELECT *FROM commentPrivate where PRIVATEe = '{$_SESSION["eventid"]}' ORDER BY timestamp ASC";
$result =$db->query($sql);
while($_SESSION['comments'] = $result->fetch_assoc()){
echo " <li>
<input type='hidden' name='commentid' value={$_SESSION['comments']['commentid']}>
<h3>{$_SESSION['comments']['username']} </h3>
<h4>{$_SESSION['comments']['rating']} </h4>
<p>{$_SESSION['comments']['description']}</p>
</li>";}
echo "<form action = 'makecommentPrivate.php' method='post'>
<!--<input type='hidden' name='uid' value='Anonymous'>-->
<textarea name='description'>Type comment here</textarea>
<select name='rating'>
<option value='1'>Rating 1</option>
<option value='2'>Rating 2</option>
<option value='3'>Rating 3</option>
<option value='4'>Rating 4</option>
<option value='5'>Rating 5</option>
</select>
<button name='submit' type='submit'>Comment</button>
</form>";
}
?>
</ul>
<!--<div id="map"></div>
<script>
// Initialize and add the map
function initMap() {
// The location of Uluru
var uluru = {lat: -25.344, lng: 131.036};
// The map, centered at Uluru
var map = new google.maps.Map(
document.getElementById('map'), {zoom: 8, center: uluru});
// The marker, positioned at Uluru
var marker = new google.maps.Marker({position: uluru, map: map});
}
</script>-->
<!--Load the API from the specified URL
* The async attribute allows the browser to render the page while the API loads
* The key parameter will contain your own API key (which is not needed for this tutorial)
* The callback parameter executes the initMap() function
-->
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAvv1p-Vio3fDx_nIWCsBCMRWLcf0wH5hE&callback=initMap">
</script>
<!--This is for a map-->
<script>
</script>
</div>
</section>
</body>
</html>