-
Notifications
You must be signed in to change notification settings - Fork 1
/
askforhelp.php
468 lines (356 loc) · 16.3 KB
/
askforhelp.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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
<?php
require_once "./configs/dbconnection.php";
session_start();
require_once "./configs/sessioncontrol.php";
$UserType = $_SESSION["control"]["UserType"];
if($UserType=="Admin"){
header("Location: admindashboard.php");
}else if($UserType=="superadmin"){
header("Location: superadmin-dash.php");
}else{}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="apple-touch-icon" sizes="76x76" href="../assets/img/apple-icon.png">
<link rel="icon" type="image/png" href="../assets/img/favicon.png">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>
Voter | Ask for Help
</title>
<link rel="icon" href="../assets/img/brand/favicon.png" type="image/png">
<!-- Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700">
<!-- Icons -->
<link rel="stylesheet" href="../assets/vendor/nucleo/css/nucleo.css" type="text/css">
<link rel="stylesheet" href="../assets/vendor/@fortawesome/fontawesome-free/css/all.min.css" type="text/css">
<!-- Page plugins -->
<!-- Argon CSS -->
<link rel="stylesheet" href="../assets/css/argon.css?v=1.2.0" type="text/css">
<script type="text/javascript" src = "../js/ckeditor/ckeditor.js"></script>
</head>
<body>
<div class="main-panel bg-gradient-primary">
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-secondary ">
<div class="container-fluid">
<div class="navbar-wrapper">
<a class="navbar-brand text-white ml-4 mt-4 font-weight-bold" style="font-size:30px" href="javascript:void(0)">Get Help </a>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation" data-target="#navigation-example">
<span class="sr-only">Toggle navigation</span>
<span class="navbar-toggler-icon icon-bar"></span>
<span class="navbar-toggler-icon icon-bar"></span>
<span class="navbar-toggler-icon icon-bar"></span>
</button>
<div class="collapse navbar-collapse justify-content-end">
<a class="navbar-brand align-items-center ml-auto" href="#">
<!-- <img src="../assets/img/theme/team-4.jpg" width="30" height="30" class="d-inline-block align-top avatar avatar-sm rounded-circle" alt=""> -->
<span class="menu-collapsed text-white font-weight-bold" style="font-size:15px">Welcome <?php if(isset($_SESSION["control"])){
print $_SESSION["control"]["OtherNames"];
}
?></span>
</a>
<ul class="navbar-nav">
</ul>
</div>
</div>
</nav>
<!-- End Navbar -->
</div>
<div class="main-content ">
<div class="content mt-4">
<div class="container-fluid">
<div class="row">
<!-- Add EVM Form -->
<div class="col-xl-12 order-xl-1">
<div class="card bg-white">
<div class="container-fluid">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-8 mt-5">
<form method="POST" autocomplete = "off" enctype="multipart/form-data" autofocus action="">
<div class="form-group">
<label for="fullName">Full Name</label>
<input value=" <?php if(isset($_SESSION["control"])){
print $_SESSION["control"]["OtherNames"];
}
?>" class="form-control form-control-md" name="fullName" type="text" id="fullName" required autofocus />
</div>
<div class="form-group">
<label for="voternumber">Voter Number</label>
<input value=" <?php if(isset($_SESSION["control"])){
print $_SESSION["control"]["UserID"];
}
?>" class="form-control form-control-md" name="voternumber" type="text" id="voternumber" required />
</div>
<div class="form-group">
<label for="email">Email Address</label>
<input value=" <?php if(isset($_SESSION["control"])){
print $_SESSION["control"]["Email"];
}
?>" class="form-control form-control-md" name="email_address" type="email" id="email" required />
</div>
<div class="form-group">
<label for="issueTopic">Issue Topic</label>
<input placeholder="Enter your Issue Topic" class="form-control form-control-md" name="issueTopic" type="text" id="issueTopic" required />
</div>
<div class="form-group">
<label for="message">Issue Description</label>
<textarea placeholder="Please describe the issue in detail" class="form-control form-control-md" name="message" id="message" required style="height:170px" ></textarea>
<script>
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace( 'message' );
</script>
</div>
<div class="text-center" >
<button type="submit" name="askforhelp" class="btn btn-primary mt-4">Ask For Help</button>
</div>
</form>
</div>
<div class="col-md-4 pt-5 mp-5">
<h2>Talk to us</h2>
Phone: (+254) (0)710-9278003<br />
E-mail: <a href="mailto:nyathirakanga@gmail.com">christine.kanga@strathmore.com</a><br />
<br /><br />
<b>Headquarter:</b><br />
Secure Vote Inc, <br />
Kanairo <br />
Phone: ((+254) (0)710-9278003<br />
<a href="mailto:nyathirakanga@gmail.com">christine.kanga@strathmore.com</a><br />
Facebook:<a href ="https://www.facebook.com/chris.kay.754703" >Facebook</a> </br>
Instagram:<a href="https://www.instagram.com/christinenyathira/?hl=en">Instagram </a>
</br>
Twitter:<a href="https://twitter.com/nyathiraa">Twitter</a>
</div>
</div>
<hr />
</div>
</div>
</div>
</div>
</div>
</div> <!-- end of main content-->
<!-- Footer -->
<footer class="py-5" id="footer-main">
<div class="container">
<div class="row align-items-center justify-content-xl-between">
<div class="col-xl-6">
<div class="copyright text-center text-xl-left text-muted">
© 2021 <a href="" class="font-weight-bold ml-1" target="_blank">Nyathira Kanga</a>
</div>
</div>
<div class="col-xl-6">
<ul class="nav nav-footer justify-content-center justify-content-xl-end">
<li class="nav-item">
<a href="aboutus.php" class="nav-link" target="_blank">About Us</a>
</li>
<li class="nav-item">
<a href="askforhelp.php" class="nav-link" target="_blank">Ask for Help</a>
</li>
<li class="nav-item">
<a href="https://github.com/creativetimofficial/argon-dashboard/blob/master/LICENSE.md" class="nav-link" target="_blank">MIT License</a>
</li>
</ul>
</div>
</div>
</div>
</footer>
</div>
<!-- Core JS Files -->
<script src="../assets/js/core/jquery.min.js"></script>
<script src="../assets/js/core/popper.min.js"></script>
<script src="../assets/js/core/bootstrap-material-design.min.js"></script>
<script src="https://unpkg.com/default-passive-events"></script>
<script src="../assets/js/plugins/perfect-scrollbar.jquery.min.js"></script>
<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
<!-- Google Maps Plugin -->
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE"></script>
<!-- Chartist JS -->
<script src="../assets/js/plugins/chartist.min.js"></script>
<!-- Notifications Plugin -->
<script src="../assets/js/plugins/bootstrap-notify.js"></script>
<!-- Control Center for Material Dashboard: parallax effects, scripts for the example pages etc -->
<script src="../assets/js/material-dashboard.js?v=2.1.0"></script>
<!-- Material Dashboard DEMO methods, don't include it in your project! -->
<script src="../assets/demo/demo.js"></script>
<script>
$(document).ready(function() {
$().ready(function() {
$sidebar = $('.sidebar');
$sidebar_img_container = $sidebar.find('.sidebar-background');
$full_page = $('.full-page');
$sidebar_responsive = $('body > .navbar-collapse');
window_width = $(window).width();
$('.fixed-plugin a').click(function(event) {
// Alex if we click on switch, stop propagation of the event, so the dropdown will not be hide, otherwise we set the section active
if ($(this).hasClass('switch-trigger')) {
if (event.stopPropagation) {
event.stopPropagation();
} else if (window.event) {
window.event.cancelBubble = true;
}
}
});
$('.fixed-plugin .active-color span').click(function() {
$full_page_background = $('.full-page-background');
$(this).siblings().removeClass('active');
$(this).addClass('active');
var new_color = $(this).data('color');
if ($sidebar.length != 0) {
$sidebar.attr('data-color', new_color);
}
if ($full_page.length != 0) {
$full_page.attr('filter-color', new_color);
}
if ($sidebar_responsive.length != 0) {
$sidebar_responsive.attr('data-color', new_color);
}
});
$('.fixed-plugin .background-color .badge').click(function() {
$(this).siblings().removeClass('active');
$(this).addClass('active');
var new_color = $(this).data('background-color');
if ($sidebar.length != 0) {
$sidebar.attr('data-background-color', new_color);
}
});
$('.fixed-plugin .img-holder').click(function() {
$full_page_background = $('.full-page-background');
$(this).parent('li').siblings().removeClass('active');
$(this).parent('li').addClass('active');
var new_image = $(this).find("img").attr('src');
if ($sidebar_img_container.length != 0 && $('.switch-sidebar-image input:checked').length != 0) {
$sidebar_img_container.fadeOut('fast', function() {
$sidebar_img_container.css('background-image', 'url("' + new_image + '")');
$sidebar_img_container.fadeIn('fast');
});
}
if ($full_page_background.length != 0 && $('.switch-sidebar-image input:checked').length != 0) {
var new_image_full_page = $('.fixed-plugin li.active .img-holder').find('img').data('src');
$full_page_background.fadeOut('fast', function() {
$full_page_background.css('background-image', 'url("' + new_image_full_page + '")');
$full_page_background.fadeIn('fast');
});
}
if ($('.switch-sidebar-image input:checked').length == 0) {
var new_image = $('.fixed-plugin li.active .img-holder').find("img").attr('src');
var new_image_full_page = $('.fixed-plugin li.active .img-holder').find('img').data('src');
$sidebar_img_container.css('background-image', 'url("' + new_image + '")');
$full_page_background.css('background-image', 'url("' + new_image_full_page + '")');
}
if ($sidebar_responsive.length != 0) {
$sidebar_responsive.css('background-image', 'url("' + new_image + '")');
}
});
$('.switch-sidebar-image input').change(function() {
$full_page_background = $('.full-page-background');
$input = $(this);
if ($input.is(':checked')) {
if ($sidebar_img_container.length != 0) {
$sidebar_img_container.fadeIn('fast');
$sidebar.attr('data-image', '#');
}
if ($full_page_background.length != 0) {
$full_page_background.fadeIn('fast');
$full_page.attr('data-image', '#');
}
background_image = true;
} else {
if ($sidebar_img_container.length != 0) {
$sidebar.removeAttr('data-image');
$sidebar_img_container.fadeOut('fast');
}
if ($full_page_background.length != 0) {
$full_page.removeAttr('data-image', '#');
$full_page_background.fadeOut('fast');
}
background_image = false;
}
});
$('.switch-sidebar-mini input').change(function() {
$body = $('body');
$input = $(this);
if (md.misc.sidebar_mini_active == true) {
$('body').removeClass('sidebar-mini');
md.misc.sidebar_mini_active = false;
$('.sidebar .sidebar-wrapper, .main-panel').perfectScrollbar();
} else {
$('.sidebar .sidebar-wrapper, .main-panel').perfectScrollbar('destroy');
setTimeout(function() {
$('body').addClass('sidebar-mini');
md.misc.sidebar_mini_active = true;
}, 300);
}
// we simulate the window Resize so the charts will get updated in realtime.
var simulateWindowResize = setInterval(function() {
window.dispatchEvent(new Event('resize'));
}, 180);
// we stop the simulation of Window Resize after the animations are completed
setTimeout(function() {
clearInterval(simulateWindowResize);
}, 1000);
});
});
});
</script>
<script>
$(document).ready(function() {
// Javascript method's body can be found in assets/js/demos.js
md.initDashboardPageCharts();
});
</script>
</body>
<style>
</style>
</html>
<script src="../assets/js/core/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/7.11.0/sweetalert2.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/7.11.0/sweetalert2.all.min.js"></script>
<?php
error_reporting(0);
require_once "./configs/dbconnection.php";
if (isset($_POST["askforhelp"])){
$fullName= mysqli_real_escape_string($conn, $_POST[fullName]);
$voternumber= mysqli_real_escape_string($conn, $_POST[voternumber]);
$email_address = mysqli_real_escape_string($conn, $_POST[email_address]);
$issueTopic= mysqli_real_escape_string($conn, $_POST[issueTopic]);
$message= mysqli_real_escape_string($conn, $_POST[message]);
$askforhelp = "INSERT INTO issues (UserNames,VoterID,Email,IssueTopic,IssueDesc,AccessTime) VALUES ('$fullName', '$voternumber','$email_address','$issueTopic','$message',UNIX_TIMESTAMP())" ;
if($conn->query($askforhelp) === TRUE){
echo '
<script type="text/javascript">
$(document).ready(function(){
swal({
title: "Issue Sent ",
text: "Our administrators will get back to you shortly",
type: "success"
}).then(function() {
window.location = "voter-dash.php";
});
});
</script>
';
exit();
}else{
echo '
<script type="text/javascript">
$(document).ready(function(){
swal({
title: "Error!",
text: "Issuer could not be sent",
type: "error".'. $conn->error;'
}).then(function() {
window.location = "voter-dash.php";
});
});
</script>
';
}
}
?>