-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewevent.php
More file actions
152 lines (122 loc) · 4.39 KB
/
viewevent.php
File metadata and controls
152 lines (122 loc) · 4.39 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
<?php
session_start();
include("lib/connection.php");
if (empty($_SESSION['memberId']))
{
header("Location: index.php");
exit();
}
$eventNumber = $_REQUEST['event'];
$eventNumber = mysqli_real_escape_string($mysqli, $eventNumber);
$_SESSION['eventId'] = $eventNumber;
$sql = "SELECT * FROM event WHERE eventId='$eventNumber' ";
$res = $mysqli->query($sql);
$count = $res->num_rows;
if ($count == 1)
{
$data=$res->fetch_array();
$title = $data['title'];
$date = $data['dat'];
$from = $data['fromTime'];
$till = $data['till'];
$location = $data['location'];
$desc = $data['description'];
$stat = $data['verificationStatus'];
// echo "Title : $title </br>";
// echo "Date : $date </br>";
// echo "From : $from</br>";
// echo "till : $till </br>";
// echo "location : $location </br>";
// echo "description : $desc </br>";
// echo "Verification : $stat";
}
else if ($count == 0)
{
$message = "There was no event selected.";
$_SESSION['message'] = $message;
header("Location: landing.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Events Portal</title>
<link rel="stylesheet" type="text/css" href="eventaddmodStyle.css">
<style>
.wrapper{
margin: 0 auto -51px;
}
h2{
color: #0094ff;
font-size: 27px;
margin-bottom: 0px;
overflow: hidden;
}
h4{
font-size: 21px;
color: #606060;
margin-bottom: 5px;
}
form{
position: static;
background-color: #fff;
margin: 0;
border: none;
box-shadow: none;
padding: 0;
width: auto;
}
#subBtn{
margin: 20px auto 5px 166px;
}
.deny{
background-color: #e60808;
}
.allow{
background-color: #23bc0c;
}
</style>
</head>
<body>
<div class="wrapper">
<header></header>
<div style="position: absolute; height: 265px; width: 532px; margin: auto; left: 0; right: 0; top: 0; bottom: 0px;">
<form>
<h2><?php echo $title;?></h2>
<div style="border: 1px solid #b2b0b0; box-shadow: 0 0 10px darkgrey; padding: 10px; height: 150px; width: 510px;">
<div style="float: left; margin-right: 20px; width: 140px;">
<h4><?php echo $date; ?></h4>
<h4 style="display: inline-block;"><?php echo $from; ?></h4>
<h5 style="display: inline-block; margin: 0 3px; font-size: 18px;">-</h5>
<h4 style="display: inline-block;"><?php echo $till; ?></h4>
<h4><?php echo $location; ?></h4>
</div>
<div style="float: left; border: 1px solid darkgrey; width: 338px; height: 138px; overflow-y: scroll; padding: 5px;">
<p><?php echo $desc; ?></p>
</div>
</div>
<input type="submit" id="subBtn" value="Permission control">
</form>
</div>
</div>
<div class="footer">
<p style="margin-top: 7px;"></p>
</div>
<script type="text/ecmascript">
var status; // 0 - Currently denied (button will grant permission) | 1 - Currently approved (button will deny permission)
status = 1;// this was just for testing! remove it
var btn = document.getElementById('subBtn');
window.onload = function () {
if (status == 0) {
btn.style.backgroundColor = "#23bc0c";
btn.value = "Grant permission";
}
else {
btn.style.backgroundColor = "#e60808";
btn.value = "Deny permission";
}
}
</script>
</body>
</html>