<?php require_once ('../../php/connect.php'); ?>
<?php require ("secure.php");?>
<?php
date_default_timezone_set("America/Chicago");
$todaydate = date("Y-m-d");
$output = '';
if(isset($_POST["export_pdf"]))
{
$Search = $_POST["cid"];
$query_New_Evaluation = "SELECT * FROM SMB_EvalAnswers WHERE eid='$Search' GROUP BY aid";
$New_Evaluation = mysqli_query($SMB, $query_New_Evaluation);
$totalRows_New_Evaluation = mysqli_num_rows($New_Evaluation);
if($totalRows_New_Evaluation > 0){
while($row_New_Evaluation = mysqli_fetch_assoc($New_Evaluation)){
$GetAID = $row_New_Evaluation['aid'];
echo $GetAID;
$query_login = "SELECT * FROM users WHERE cid = '$Search' AND evaluation = '1' AND id='$GetAID' ORDER BY id ASC";
$login = mysqli_query($SMB, $query_login);
$totalRows_login = mysqli_num_rows($login);
if($totalRows_login > 0){
while($row_login = mysqli_fetch_assoc($login)){
$Course_Type = $row_login['type'];
$AID = $row_login['aid'];
$CID = $row_login['cid'];
$FirstName = $row_login['first_name'];
$LastName = $row_login['last_name'];
$query_Course = "SELECT * FROM Courses WHERE id='$Search'";
$Course = mysqli_query($SMB, $query_Course);
$row_Course = mysqli_fetch_assoc($Course);
$totalRows_Course = mysqli_num_rows($Course);
$ID = $row_Course['id'];
$Start_Date = date('F d, Y', strtotime($row_Course['start_date']));
$End_Date = date('F d, Y', strtotime($row_Course['end_date']));
$location = $row_Course['location'];
$Address = $row_Course['street_address'];
$City = $row_Course['city'];
$State = $row_Course['state'];
$Zip = $row_Course['zip_code'];
if($Start_Date == $End_Date){
$ShowDate = $Start_Date;
}
else {
$ShowDate = $Start_Date.' - '.$End_Date;
}
$ShowLocation = '<p>'.$ShowDate.'</br>
'.$location.'</br>
'.$Address.'</br>
'.$City.', '.$State.' '.$Zip.'</p>';
$query_Type = "SELECT * FROM SMB_Courses WHERE id='$Course_Type'";
$Type = mysqli_query($SMB, $query_Type);
$row_Type = mysqli_fetch_assoc($Type);
$totalRows_Type = mysqli_num_rows($Type);
$typeID = $row_Type['id'];
$Objectives = $row_Type['syllabus'];
$CourseTitle = $row_Type['name'];
// Rate Questions
$query_Questions = "SELECT * FROM SMB_EvalQuestions WHERE typeID='$Course_Type' AND type='Rate' ORDER BY sort ASC";
$Questions = mysqli_query($SMB, $query_Questions);
$totalRows_Questions = mysqli_num_rows($Questions);
if($totalRows_Questions > 0){
while($row_Questions = mysqli_fetch_assoc($Questions)){
$Question_ID = $row_Questions['id'];
$Question_Question = $row_Questions['question'];
$Evaluation_Output .='<tr>
<td width="50%" align="left" valign="middle" class="content">'.$Question_Question.'</td>';
$query_Answers = "SELECT * FROM SMB_EvalAnswers WHERE aid='$AID' AND eid='$CID' AND QID='$Question_ID'";
$Answers = mysqli_query($SMB, $query_Answers);
$totalRows_Answers = mysqli_num_rows($Answers);
if($totalRows_Answers > 0){
while($row_Answers = mysqli_fetch_assoc($Answers)){
$Answer_ID = $row_Answers['id'];
$Answer_Rating = $row_Answers['rate'];
if($Answer_Rating == 1){
$One_Rating = 'checked = "checked"';
}
else {
$One_Rating = '';
}
if($Answer_Rating == 2){
$Two_Rating = 'checked = "checked"';
}
else {
$Two_Rating = '';
}
if($Answer_Rating == 3){
$Three_Rating = 'checked = "checked"';
}
else {
$Three_Rating = '';
}
if($Answer_Rating == 4){
$Four_Rating = 'checked = "checked"';
}
else {
$Four_Rating = '';
}
if($Answer_Rating == 5){
$Five_Rating = 'checked = "checked"';
}
else {
$Five_Rating = '';
}
$Evaluation_Output .= '<td width="10%" align="center" valign="middle" class="content"><input type="radio" name="E1['.$Question_ID.']" id="radio" value="1" '.$One_Rating.'></td>
<td width="10%" align="center" valign="middle" class="content"><input type="radio" name="E1['.$Question_ID.']" id="radio2" value="2" '.$Two_Rating.'></td>
<td width="10%" align="center" valign="middle" class="content"><input type="radio" name="E1['.$Question_ID.']" id="radio3" value="3" '.$Three_Rating.'></td>
<td width="10%" align="center" valign="middle" class="content"><input type="radio" name="E1['.$Question_ID.']" id="radio4" value="4" '.$Four_Rating.'></td>
<td width="10%" align="center" valign="middle" class="content"><input name="E1['.$Question_ID.']" type="radio" id="radio5" value="5" '.$Five_Rating.'></td>
</tr>';
}}
}
$Evaluation_Output .= '</tr>';
}
// Comment Questions
$query_Comments = "SELECT * FROM SMB_EvalQuestions WHERE typeID='$Course_Type' AND type='Comment' ORDER BY sort ASC";
$Comments = mysqli_query($SMB, $query_Comments);
$totalRows_Comments = mysqli_num_rows($Comments);
if($totalRows_Comments > 0){
while($row_Comments = mysqli_fetch_assoc($Comments)){
$Comments_ID = $row_Comments['id'];
$Comments_Question = $row_Comments['question'];
$Comments_Output .='<tr>
<td colspan="6" align="left" valign="top" class="content"><strong>'.$Comments_Question.'</strong>';
$query_Comment_Answers = "SELECT * FROM SMB_EvalAnswers WHERE aid='$AID' AND eid='$CID' AND QID='$Comments_ID'";
$Comment_Answers = mysqli_query($SMB, $query_Comment_Answers);
$totalRows_Comment_Answers = mysqli_num_rows($Comment_Answers);
if($totalRows_Comment_Answers > 0){
while($row_Comment_Answers = mysqli_fetch_assoc($Comment_Answers)){
$Comment_Answers_ID = $row_Comment_Answers['id'];
$Comment_Answers_Text = $row_Comment_Answers['comments'];
$Comments_Output .= '<br>'.$Comment_Answers_Text.'';
}}
}
$Comments_Output .= '</td></tr>';
}
$New_Evaluation_Output .= '<table width="90%" align="center" cellpadding="2" cellspacing="2" class="tblBrd">
<tbody>
<tr>
<td><table width="100%" cellspacing="4" cellpadding="4">
<tbody>
<tr>
<td height="500" align="center" valign="top" bgcolor="#F8F8F8"><table width="100%" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td height="25" colspan="6" align="center" valign="middle" class="pageHdr"><h1>Course Evaluation</h1></td>
</tr>
<tr>
<td height="50" colspan="6" align="center" valign="top" class="content"><h3>Attendee: '.$FirstName.' '.$LastName.'</h3></td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content"><h2>'.$CourseTitle.'</h2><?php echo $ShowLocation; ?></td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content">'.$Objectives.' </td>
</tr>
<tr>
<td width="50%" align="left" valign="middle" nowrap="nowrap" class="content"><em><strong>Please evaluate this course</strong></em></td>
<td width="10%" align="center" valign="top" nowrap="nowrap" class="content"><strong>1<br>
</strong><span class="content_small">(Very <em>Poor</em>)</span></td>
<td width="10%" align="center" valign="top" nowrap="nowrap" class="content"><strong>2</strong><br>
<span class="content_small">(<em>Poor</em>)</span></td>
<td width="10%" align="center" valign="top" nowrap="nowrap" class="content"><strong>3</strong><br>
<span class="content_small">(<em>Fair</em>)</span></td>
<td width="10%" align="center" valign="top" nowrap="nowrap" class="content"><strong>4</strong><br>
<span class="content_small">(<em>Good</em>)</span></td>
<td width="10%" align="center" valign="top" nowrap="nowrap" class="content"><strong>5<br>
</strong><span class="content_small">(<em>Excellent</em>) </span></td>
</tr>
'.$Evaluation_Output.'
'.$Comments_Output.'
</tbody>
</table> </td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>';
}}
}
}
// Old Evaluation
$query_login = "SELECT * FROM users WHERE cid = '$Search' AND evaluation = '1' ORDER BY id ASC";
$login = mysqli_query($SMB, $query_login);
$totalRows_login = mysqli_num_rows($login);
if($totalRows_login > 0){
while($row_login = mysqli_fetch_assoc($login)){
$Course_Type = $row_login['type'];
$AID = $row_login['aid'];
$CID = $row_login['cid'];
$FirstName = $row_login['first_name'];
$LastName = $row_login['last_name'];
$query_Content = "SELECT * FROM Evaluation WHERE aid='$AID'";
$Content = mysqli_query($SMB, $query_Content);
$totalRows_Content = mysqli_num_rows($Content);
if($totalRows_Content > 0){
while($row_Content = mysqli_fetch_assoc($Content)){
$E1 = $row_Content['E1'];
$E2 = $row_Content['E2'];
$E3 = $row_Content['E3'];
$E4 = $row_Content['E4'];
$E5 = $row_Content['E5'];
$E6 = $row_Content['E6'];
$E7 = $row_Content['E7'];
$E8 = $row_Content['E8'];
$E9 = $row_Content['E9'];
$E10 = $row_Content['E10'];
$E11 = $row_Content['E11'];
$E12 = $row_Content['E12'];
$E13 = $row_Content['E13'];
$E14 = $row_Content['E14'];
$query_Type = "SELECT * FROM SMB_Courses WHERE id='$Course_Type'";
$Type = mysqli_query($SMB, $query_Type);
$totalRows_Type = mysqli_num_rows($Type);
if($totalRows_Type > 0){
while($row_Type = mysqli_fetch_assoc($Type)){
$Objectives = $row_Type['syllabus'];
$CourseTitle = $row_Type['name'];
$query_Course = "SELECT * FROM Courses WHERE id='$CID'";
$Course = mysqli_query($SMB, $query_Course);
$totalRows_Course = mysqli_num_rows($Course);
if($totalRows_Course > 0){
while($row_Course = mysqli_fetch_assoc($Course)){
$ID = $row_Course['id'];
$Start_Date = date('F d', strtotime($row_Course['start_date']));
$File_Date = date('m-d-Y', strtotime($row_Course['start_date']));
$location = $row_Course['location'];
$Address = $row_Course['street_address'];
$City = $row_Course['city'];
$State = $row_Course['state'];
$Zip = $row_Course['zip_code'];
$ShowLocation = '<p><strong>'.$CourseTitle.'</strong></br>
'.$location.'</br>'.$Address.'</br>'.$City.', '.$State.' '.$Zip.'</p>';
$ShowAttendee = '<p><strong>Attendee: '.$LastName.', '.$FirstName.'</strong></br></p>';
$FileName = $CourseTitle."-".$File_Date.".pdf";
$output .= '<table width="90%" align="center" cellpadding="2" cellspacing="2" class="tblBrd">
<tbody>
<tr>
<td><table width="100%" cellspacing="4" cellpadding="4">
<tbody>
<tr>
<td height="500" align="center" valign="top" bgcolor="#F8F8F8"><table width="100%" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td colspan="6" align="center" valign="top" class="pageHdr"><h1>Course Evaluation</h1></td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content">'.$ShowLocation.' </td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content">'.$ShowAttendee.' </td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content">'.$Objectives.'</td>
</tr>
<tr>
<td align="left" valign="middle" nowrap="nowrap" class="content"><em><strong>Please evaluate this course</strong></em></td>
<td width="50%" colspan="5" align="center" valign="middle" class="content"><strong>Rating</strong></br> <em>( <strong>1</strong> - Very Poor, <strong>2</strong> - Poor, <strong>3</strong> - Fair, <strong>4</strong> - Good, <strong>5</strong> - Excellent)</em></td>
</tr>
<tr>
<td width="50%" align="left" valign="middle" class="content">Meeting site was adequate in size, comfortable, and convenient</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E1'].'</td>
</tr>
<tr>
<td align="left" valign="middle" class="content">Course administration was efficient and friendly</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E2'].'</td>
<tr>
<td align="left" valign="middle" class="content">Course objectives were consistent with the course as advertised</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E3'].'</td> </tr>
<tr>
<td align="left" valign="middle" class="content">COURSE OBJECTIVE #1 was adequately addressed and achieved</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E4'].'</td> </tr>
<tr>
<td align="left" valign="middle" class="content">COURSE OBJECTIVE #2 was adequately addressed and achieved</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E5'].'</td> </tr>
<tr>
<td align="left" valign="middle" class="content">COURSE OBJECTIVE #3 was adequately addressed and achieved</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E6'].'</td> </tr>
<tr>
<td align="left" valign="middle" class="content">Course material was up-to-date, well-organized, and presented in sufficient depth</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E7'].'</td> </tr>
<tr>
<td align="left" valign="middle" class="content">Instructor demonstrated a comprehensive knowledge of the subject</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E8'].'</td> </tr>
<tr>
<td align="left" valign="middle" class="content">Instructor appeared to be interested and enthusiastic about the subject</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E9'].'</td>
</tr>
<tr>
<td align="left" valign="middle" class="content">Audio-visual materials used were relevant and of high quality</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E10'].'</td>
</tr>
<tr>
<td align="left" valign="middle" class="content">Handout materials enhanced course content</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E11'].'</td>
</tr>
<tr>
<td align="left" valign="middle" class="content">Overall, I would rate this course:</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E12'].'</td>
</tr>
<tr>
<td align="left" valign="middle" class="content">Overall, I would rate this instructor:</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E13'].'</td>
</tr>
<tr>
<td align="left" valign="middle" class="content">Overall, this course met my expectations:</td>
<td width="50%" colspan="5" align="center" valign="middle" class="content">'.$row_Content['E14'].'</td>
</tr>
<tr>
<td colspan="6" align="left" valign="middle" class="signLine"> </td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content"><strong>The best thing about this course was:</strong></td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content">'.$row_Content['Q1'].'</td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content"><strong>If I could change one thing about this course, I would:</strong></td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content">'.$row_Content['Q2'].'</td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content"><strong>Is there anything that could have been explained in greater detail?</strong></td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content">'.$row_Content['Q3'].'</td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content"><strong>Please make any additional comments:</strong></td>
</tr>
<tr>
<td colspan="6" align="left" valign="top" class="content">'.$row_Content['comments'].'</td>
</tr>
</tbody>
</table> </td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>';
}
}}
}}
}}
}}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>SMB Course All Evaluations</title>
<link rel="stylesheet" type="text/css" href="../css/evaluation.css">
</head>
<body onload="window.print()">
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td><?php echo $output; ?>
<?php echo $New_Evaluation_Output; ?></td>
</tr>
</tbody>
</table>
</body>
</html> |