-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
100 lines (59 loc) · 1.64 KB
/
index.php
File metadata and controls
100 lines (59 loc) · 1.64 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
<?php
$pageTitle = 'Give Us Your Feedback';
require_once 'core/init.php';
$trainerList = Database::getAll('trainers');
$errorList = array();
if (isset($_POST['submit']))
{
$trainerName = Clean::input($_POST['trainer']);
$like = '' . Clean::input($_POST['like']);
$understand = '' . Clean::input($_POST['understand']);
$likeComment = Clean::input($_POST['likeComment']);
$dontLikeComment = Clean::input($_POST['dontLikeComment']);
$trainerImproveOn = Clean::input($_POST['trainerImproveOn']);
$milestoneImproveOn = Clean::input($_POST['milestoneImproveOn']);
if (!(empty($trainerName) || empty($likeComment) || empty($dontLikeComment) || empty($trainerImproveOn) || empty($milestoneImproveOn)))
{
if (isset($like) && $like == 'on')
{
$isLiked = 1;
}
else
{
$isLiked = 0;
}
if (isset($understand) && $understand == 'on')
{
$isUnderstand = 1;
}
else
{
$isUnderstand = 0;
}
$array = array(
'feedback_trainer' => $trainerName,
'feedback_like' => $isLiked,
'feedback_understand' => $isUnderstand,
'feedback_likecomment' => $likeComment,
'feedback_dontlikecomment' => $dontLikeComment,
'feedback_trainerimproveon' => $trainerImproveOn,
'feedback_milestone' => $milestoneImproveOn,
);
if (Database::insert('feedbackinfo', $array))
{
Redirect::to('/?status=success');
}
else
{
$errorList[] = 'There was an error submitting results. Try again later';
}
}
else
{
$errorList[] = "Fields with * must be filled in";
}
}
require_once header;
require_once homeView;
require_once footer;
?>