-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoll.php
248 lines (190 loc) · 8.81 KB
/
poll.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
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<?php
//poll page to show user. will generate actual poll from user_poll
//do not require user account
$defaultAllowNoUser = true;
require("garage/passport.php");
$ppaccesscode = mysqli_real_escape_string($conne, $_POST['authkey']);
if($ppaccesscode > ""){
$pollref = mysqli_real_escape_string($conne, $_GET['id']); #turn ref into ordinary text
$geteventname = mysqli_query($conne,"SELECT * FROM events WHERE refs = '$pollref' LIMIT 1");
while($rowfep = mysqli_fetch_array($geteventname)){
$eventpollcheck = $rowfep['pollcheck']; //check for if poll
$eventauthkey = $rowfep['authkey'];
$resulttitle = mysqli_query($conne,"SELECT * FROM poll WHERE refs = '$pollref' LIMIT 1");
$polltitle = 0;
while($rowtitle = mysqli_fetch_array($resulttitle))
{$polltitle = 1;
$eventnamepre = $rowtitle['question'];
}
if($polltitle == 0){
$neventname = "Take a Poll";
}else{
$neventname = "Poll - " . substr($eventnamepre, 0, 14) . "...";}
}
}
else if(isset($_GET['id'])){
$pollref = mysqli_real_escape_string($conne, $_GET['id']); #turn ref into ordinary text
$geteventname = mysqli_query($conne,"SELECT * FROM events WHERE refs = '$pollref' LIMIT 1");
while($rowfep = mysqli_fetch_array($geteventname)){
$eventpollcheck = $rowfep['pollcheck']; //check for if poll
$resulttitle = mysqli_query($conne,"SELECT * FROM poll WHERE refs = '$pollref' LIMIT 1");
$polltitle = 0;
while($rowtitle = mysqli_fetch_array($resulttitle))
{$polltitle = 1;
$eventnamepre = $rowtitle['question'];
}
if($polltitle == 0){
$neventname = "Take a Poll";
}else{
$neventname = "Poll - " . substr($eventnamepre, 0, 14) . "...";}
} }
else{
header('Location: me');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="manifest" href="/manifest.json">
<meta name="description" content="Cast a vote on your event questions.">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"/>
<?php
echo"<title>$neventname</title>";
require("./garage/resources.php"); ?>
<?php require("./garage/validuser.php"); ?>
<style>
body{
background-color: #f5f5f5;
}
</style>
</head>
<body>
<div id="gtr" onclick="closecloseb()"></div>
<?php require("./garage/absolunia.php"); ?>
<?php require("./garage/deskhead.php"); ?>
<?php require("./garage/desksearch.php"); ?>
<?php require("./garage/deskpop.php"); ?>
<?php $pagename = "<button class='hbut' id='mbut' aria-label='vrixe' onclick='window.history.back()'><i class='material-icons' style='vertical-align: top;'>keyboard_arrow_left</i>$neventname</button>";
require("./garage/mobilehead.php"); ?>
<?php
require("./garage/subhead.php");?>
<?php require("./garage/thesearch.php"); ?>
<br>
<div class="postcen">
<?php
echo "<div id='result'></div>";
//from where it is users plan or others invite or plan. we dont show users invite cus we have that in analytics page already
if($eventpollcheck > ""){
$result = mysqli_query($conne,"SELECT * FROM poll WHERE refs = '$pollref' LIMIT 1");
$founds = 0;
while($row = mysqli_fetch_array($result))
{$founds = 1;
//go to fetch from events
$findpollevent = mysqli_query($conne,"SELECT * FROM events WHERE refs = '$pollref' LIMIT 1");
$foundspollevent = 0;
while($rowpe = mysqli_fetch_array($findpollevent))
{$foundspollevent = 1;
$eventimage = $rowpe['imgname'];
$eventname = $rowpe['event'];
$hype = $rowpe['hype'];
if ($username == $rowpe['hype'] or $username > "" and $username == $rowpe['cua'] or $username > "" and $username == $rowpe['cub'] or $username > "" and $username == $rowpe['cuc'] or $username > "" and $username == $rowpe['cud'] or $username > "" and $username == $rowpe['cue'] or $username > "" and $username == $rowpe['cuf'] ){
$governoronpage = true;
}
else{
$governoronpage = false;
}
}
$r = $row['refs'];
$privateref = $r; //for privatebox plug
$pposter = $hype; //for privatebox plug
$ispollpri = $row['pollpri'];
$pollquestion = $row['question'];
$answerone = $row['answerone'];
$answertwo = $row['answertwo'];
$answerthree = $row['answerthree'];
$answerfour = $row['answerfour'];
$answerfive = $row['answerfive'];
$pollcomments = $row['comments'];
$pollusers = $row['users'];
$av = $row['av']; if($av == 0){$avven = "";}else if($av == 1){$avven = "vote";}else{$avven = "votes";}
$bv = $row['bv']; if($bv == 0){$bvven = "";}else if($bv == 1){$bvven = "vote";}else{$bvven = "votes";}
$cv = $row['cv']; if($cv == 0){$cvven = "";}else if($cv == 1){$cvven = "vote";}else{$cvven = "votes";}
$dv = $row['dv']; if($dv == 0){$dvven = "";}else if($dv == 1){$dvven = "vote";}else{$dvven = "votes";}
$ev = $row['ev']; if($ev == 0){$evven = "";}else if($ev == 1){$evven = "vote";}else{$evven = "votes";}
if($governoronpage == "true"){//poll owner is here
require("garage/user_poll.php");
}
else if($ispollpri == "true" and $ppaccesscode == ""){
//ask for a password
$sendformto = "/poll/$pollref";
require("garage/privatebox.php");
echo"<script type='text/javascript' src='/garage/scripts/redeye.js?v=$vv'></script>";
}
else if($ispollpri == "true" and $ppaccesscode > ""){
//verify password that was later sent
if($eventauthkey == $ppaccesscode){
require("garage/user_poll.php");
}
else{
//ask for a password again
$privateBoxError = "Your access code is incorrect. Please check and retry";
$sendformto = "/poll/$pollref";
require("garage/privatebox.php");
echo"<script type='text/javascript' src='/garage/scripts/redeye.js?v=$vv'></script>";
}
}
else if ($ispollpri == "false"){
//poll is not private show poll
require("garage/user_poll.php");
}
else{
echo "
<div class='pef' style='display:inline-block'>
<div class='blfhead'>...no poll here</div><br><br>
<img alt='$pollref' src='/images/essentials/nodata.svg' class='everybodyimg'><br>
<h class='miniss'>What is happening here?</h><br><h class='disl'>We got the link, we have every other file but looks like this poll does not exist or has been deleted.</h> <br><br>
<h class='miniss'>What can I do?</h><br><h class='disl'>Please confirm with the creators. You can also send us a report and we'll check this for you.</h> <br><br>
<a href='/help/feedbacks'><button class='copele'>FEEDBACK</button></a><br><br>
<h class='miniss'>What is Vrixe?</h><br>
<i class='material-icons' style='color:#065cff;'>add_to_home_screen</i><br>
<h class='miniss'>Keep Vrixe with you <br><a href='/aboutvrixe'><button class='control'> LEARN MORE</button></a></h><br><br>
<div class='blfheadalt'></div>
</div><br><br><br>";
}
}
if ($founds == 0) {
echo "
<div class='pef' style='display:inline-block'>
<div class='blfhead'>...poll not found</div><br><br>
<img alt='$code' src='/images/essentials/nodata.svg' class='everybodyimg'><br>
<h class='miniss'>What is happening here?</h><br><h class='disl'>We did not find any poll with the reference provided. Poll might have been deleted.</h> <br><br>
<h class='miniss'>What can I do?</h><br><h class='disl'>Please check your link or confirm with the creator. You can also send us a report and we'll check this for you.</h> <br><br>
<a href='/help/feedbacks'><button class='copele'>FEEDBACK</button></a><br><br>
<h class='miniss'>What is Vrixe?</h><br>
<i class='material-icons' style='color:#065cff;'>add_to_home_screen</i><br>
<h class='miniss'>Keep Vrixe with you <br><a href='/aboutvrixe'><button class='control'> LEARN MORE</button></a></h><br><br>
<div class='blfheadalt'></div>
</div><br><br><br>";
}
}//end of if pollcheck is there
else{
echo "
<div class='pef' style='display:inline-block'>
<div class='blfhead'>...no poll here</div><br><br>
<img alt='$pollref' src='/images/essentials/nodata.svg' class='everybodyimg'><br>
<h class='miniss'>What is happening here?</h><br><h class='disl'>We got the link, we have every other file but looks like this poll does not exist or has been deleted.</h> <br><br>
<h class='miniss'>What can I do?</h><br><h class='disl'>Please confirm with the creators. You can also send us a report and we'll check this for you.</h> <br><br>
<a href='/help/feedbacks'><button class='copele'>FEEDBACK</button></a><br><br>
<h class='miniss'>What is Vrixe?</h><br>
<i class='material-icons' style='color:#065cff;'>add_to_home_screen</i><br>
<h class='miniss'>Keep Vrixe with you <br><a href='/aboutvrixe'><button class='control'> LEARN MORE</button></a></h><br><br>
<div class='blfheadalt'></div>
</div><br><br><br>";
}
?><br><br>
<br><br>
</div>
<div id="offline" onclick="document.getElementById('offline').style.display='none';">Offline!<br><span id="smoff">Some features will not be available</span></div>
</body>
</html>