-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeedback.php
More file actions
executable file
·222 lines (216 loc) · 6.99 KB
/
feedback.php
File metadata and controls
executable file
·222 lines (216 loc) · 6.99 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
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
<?
/**
* Feedback.php
*
* Display feedback form to users.
* Stores feedback in database and emails
* to admins.
*
* Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
* Last Updated: August 19, 2004
*/
include("include/session.php");
include("include/functions.php");
/**
* User not an administrator, redirect to main page
* automatically.
*/
if(!$session->logged_in){
$url = curPageUrl();
header("Location: main.php?returl=$url");
}
else{
/**
* Logged in user is viewing page, so display all
* forms.
*/
$title = "Give Feedback";
//add form validation javascript to the head of the page
$extraHeadData = "<script src='http://code.jquery.com/jquery-latest.js'></script>".
"<link rel='stylesheet' href='http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.css' type='text/css' media='screen' />".
"<script type='text/javascript' src='http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js'></script>".
"<script type='text/javascript' src='http://dev.jquery.com/view/trunk/plugins/metadata/jquery.metadata.js'></script>".
"<script>".
"$(document).ready(function(){".
"$('#feedbackform').validate({".
"rules: {".
"vidused: 'required',".
"dates: 'required',".
"goal: 'required',".
"location: 'required',".
"audience: 'required',".
"time: 'required',".
"length: 'required',".
"vidrole: 'required',".
"vidhelpful:'required',".
//"yvonneused: 'required',".
"yvonneuseful: {required: '#yvonneyes:checked'},".
"continue:'required',".
"},".
"messages: {".
"yvonneuseful: 'This is required since you used Yvonne`s Journal',".
"}".
"})".
"});".
"</script>";
include 'head.php';
/**
* The user has submitted the feedback form and the
* results have been processed.
*/
if(isset($_SESSION['fbsuccess'])){
/* Feedback submission was successful */
if($_SESSION['fbsuccess']){
echo "<h1>Feedback Submitted!</h1>";
echo "<p>Thank you <b>".$session->username."</b>, your feedback is greatly appreciated. ";
}
/* Feedback submission failed */
else{
echo "<h1>Feedback Submission Failed</h1>";
echo "<p>We're sorry, but an error has occurred and the feedback you submitted was lost. "
."<br />Please try again at a later time.</p>";
}
unset($_SESSION['fbsuccess']);
}
/**
* The user has not filled out the feedback form yet.
* Below is the page with the feedback form.
*/
else{
?>
<h1>CMP Video Users Feedback Form</h1>
<h2>*Please note that all fields are required.</h2>
<?
if($form->num_errors > 0){
echo "<td><font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font></td>";
}
?>
<form action="process.php" method="POST" id="feedbackform">
<fieldset>
<div id="formvidused" class="forminput">
<label class="formlabellong">
Which video did you use? (Title Slide? Chapter?):
</label>
<div class="formfieldlower">
<input type="text" name="vidused" maxlength="50" value="<? echo $form->value("vidused"); ?>">
<? echo $form->error("vidused"); ?>
</div>
</div>
<div id="formdates" class="forminput"><!--*********************ADD DATE VALIDATION HERE********************************************-->
<label class="formlabellong">
Dates of use:
</label>
<div class="formfieldlower">
<input type="text" name="dates" maxlength="50" value="<? echo $form->value("dates"); ?>">
<? echo $form->error("dates"); ?>
</div>
</div>
<div id="formgoal" class="forminput">
<label class="formlabellong">
Goal/Purpose for use:
</label>
<div class="formfieldlower">
<input type="text" name="goal" maxlength="150" value="<? echo $form->value("goal"); ?>">
<? echo $form->error("goal"); ?>
</div>
</div>
<div id="formlocation" class="forminput">
<label class="formlabellong">
Location of use:
</label>
<div class="formfieldlower">
<input type="text" name="location" maxlength="100" value="<? echo $form->value("location"); ?>">
<? echo $form->error("location"); ?>
</div>
</div>
<div id="formaudience" class="forminput">
<label class="formlabellong">
Audience (teachers, administrators, parents, students, etc.):
</label>
<div class="formfieldlower">
<input type="text" name="audience" maxlength="100" value="<? echo $form->value("audience"); ?>">
<? echo $form->error("audience"); ?>
</div>
</div>
<div id="formtime" class="forminput">
<label class="formlabellong">
Time of viewing (during/after school; day of week):
</label>
<div class="formfieldlower">
<input type="text" name="time" maxlength="100" value="<? echo $form->value("time"); ?>">
<? echo $form->error("time"); ?>
</div>
</div>
<div id="formlength" class="forminput">
<label class="formlabellong">
Length of session:
</label>
<div class="formfieldlower">
<input type="text" name="length" maxlength="100" value="<? echo $form->value("length"); ?>">
<? echo $form->error("length"); ?>
</div>
</div>
</fieldset>
<fieldset>
<div id="formvidrole" class="forminput">
<label class="formlabellong">
What role did the videos play in accomplishing your goals:
</label>
<div class="formfieldlower">
<textarea name="vidrole" rows="10" cols="50"></textarea>
<? echo $form->error("vidrole"); ?>
</div>
</div>
<div id="formvidhelpful" class="forminput">
<label class="formlabellong">
In what ways was the video helpful? Problematic? Try to be as specific as you can.
</label>
<div class="formfieldlower">
<textarea name="vidhelpful" rows="10" cols="50"></textarea>
<? echo $form->error("vidhelpful"); ?>
</div>
</div>
<div id="formyvonne" class="forminput">
<label class="formlabellong">
Did you use Yvonne's Journal
</label>
<label for="yvonneyes">
<input id="yvonneyes" type = "radio" name ="yvonneused" value= "yes">Yes</input>
</label>
<label for="yvonneno">
<input id="yvonneno" type = "radio" name ="yvonneused" value= "no">No</input>
</label>
<? echo $form->error("yvonneused"); ?>
</div>
<div id="formyvonneuseful" class="forminput">
<label class="formlabellong">
If so, was it useful?
</label>
<div class="formfieldlower">
<textarea name="yvonneuseful" rows="10" cols="50"></textarea>
<? echo $form->error("yvonneuseful"); ?>
</div>
</div>
</fieldset>
<fieldset>
<div id="formcontinue" class="forminput">
<label class="formlabellong">
Next steps: Do you plan to continue using the videos? If so, what will be the goal(s) and structure for their use?
</label>
<div class="formfieldlower">
<textarea name="continue" rows="10" cols="50"></textarea>
<? echo $form->error("continue"); ?>
</div>
</div>
</fieldset>
<div class="return">
<input type="hidden" name="subfeedback" value="1">
<input id="submit" type="submit" value="Submit">
</div>
</form>
<div style="clear:both"></div>
<?
}
include 'foot.php';
}
?>