Source Code Viewer

Viewing File: feedback.php

File: feedback.php
Title: RaggieSoft.com Assignments Server Feedback Page
File Size: 18.08 kb

Load any file into the Viewer:

<?php session_start(); ?>
<!DOCTYPE html>
<?php
	// Functions for all pages to access
	include("odu/it201/utilities/functions/functions.php");
	include_once("securimage/securimage.php"); // The CAPTCHA

	
	// Access the Classes in the functions list
	$general = new General;
	$research = new Research;
	$sqlAccess = new SQLAccess; // Not necessary yet
	$securimage = new Securimage(); // For our CAPTCHA
	
?>
<html>
    <head>
    	<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <link rel="stylesheet" href="odu/it201/utilities/css/normalize.css" />
        <link rel="stylesheet" href="odu/it201/utilities/font-awesome/css/font-awesome.min.css">
        <link rel="stylesheet" href="odu/it201/utilities/css/w3.css" />
		<title>RaggieSoft.com Assignments Server Feedback Page</title>
    </head>
    <body>
    	<article>
        <!-- Sidebar Navigation -->
			<nav class="w3-sidenav w3-collapse w3-white w3-card-2" style="width:200px;">
			  <h2 class="w3-center w3-purple w3-text-light-grey w3-text-shadow">Main Menu</h2>
			  <a href="javascript:void(0)" onclick="w3_close()" class="w3-closenav w3-large w3-hide-large">Close &times;</a>
			  <a class="w3-hover-light-grey" href="/index.php"><i class="fa fa-home"></i> Server Home</a> 
				<a class="w3-hover-light-grey" href="#" onclick="myAccFunc('cite')"><i class="fa fa-book"></i> Classes <i class="fa fa-caret-down"></i></a>
				<div id="cite" class="w3-accordion-content w3-white w3-card-4">
                  <!-- for the research essay, if you select an individual page, you'll have that paragraph with back/next/home buttons.  We will use isset($_GET['para']) to check -->
                  <a class="w3-hover-light-grey" href="index.php?school=odu&class=it201"><i class="fa fa-list-ul"></i> IT 201 (Intro to IT)</a>
                   <a class="w3-hover-light-grey" href="index.php?school=odu&class=it325"><i class="fa fa-list-ul"></i> IT 325 (Website Design)</a>
                    <a class="w3-hover-light-grey" href="index.php?school=odu&class=eng211"><i class="fa fa-list-ul"></i> ENG 211 (English Writing 2)</a>
                    <a class="w3-hover-light-grey" href="index.php?school=odu&class=oeas110"><i class="fa fa-list-ul"></i> OEAS 110 (Earth Science)</a>
				</div>
			  </div>
              <a class="w3-hover-light-grey" href="feedback.php"><i class="fa fa-commenting-o"></i> Feedback</a>
              <a class="w3-hover-light-grey" href="src.php?file=feedback.php"><i class="fa fa-file-code-o"></i> View PHP Source</a>
			</nav>
			<!-- End Sidebar Navigation -->
            <section class="w3-main" style="margin-left:200px">
			<?php
				$general->writeHeader("teal", "RaggieSoft Assignments Server", "Give Feedback");
			?>
        	
                <section class="w3-container story-content">
                    
                  
                    <?php
					if (!isset($_POST['submitted']))
					// Show our Feedback Form
					{
						?>
					<section class="w3-container w3-green">
                    	<h1>Please offer feedback for the student</h1>
                    </section>
                    <form action="feedback.php" method="post" class="w3-container">
                        <section class="w3-container">
                            <!-- Please enter your name -->
                            <section class="w3-container w3-half w3-light-blue w3-card-4">
                                <section class="w3-container w3-black">
                                    <h2>Please enter your Info</h2>
                                </section>
                                
                                <label class="w3-label w3-validate">First Name</label>
                                <input class="w3-input" type="text" name="first_name" autocorrect="off" required />
            
                                <label class="w3-label w3-validate">Last Name</label>
                                <input class="w3-input" type="text" name="last_name" autocorrect="off" required />
                                
                                 <label class="w3-label w3-validate">Email</label>
                                 <input class="w3-input" type="email" name="email_address" autocapitalize="off" autocomplete="off" required />
                           </section>
                           <section class="w3-container w3-half w3-light-blue w3-card-4">
                                <section class="w3-container w3-black">
                                    <h2>What school is this?</h2>
                                </section>
                                <input class="w3-radio" type="radio" name="school" value="odu" checked />
                                <label class="w3-label w3-validate">Old Dominion University</label> <br />
                                   
                                <input class="w3-radio" type="radio" name="school" value="tcc" />
                                <label class="w3-label w3-validate">Tidewater Community College</label> <br />
                                
                                <input class="w3-radio" type="radio" name="school" value="wwrc" disabled>
								<label class="w3-validate">Woodrow Wilson Rehabilitation Center</label>
                           </section>
						</section>
                        <section class="w3-container">
                        	<section class="w3-container w3-half w3-light-grey w3-card-4">
                            	<section class="w3-container w3-black">
                                	<h2>Written remarks</h2>
                                </section>
                                <p>What are your thoughts of this?</p>
                                <textarea class="w3-input w3-border" name="written_remarks" style="resize:none"></textarea>
                            </section>
                            <section class="w3-container w3-half w3-light-grey w3-card-4">
                            	<section class="w3-container w3-black">
                                	<h2>This is Feedback for</h2>
                                </section>
                                <input class="w3-check" type="checkbox" name="class_name[]" value="it201" />
                                <label class="w3-label w3-valide">IT 201 (Intro to IT)</label> <br />
                                
                                <input class="w3-check" type="checkbox" name="class_name[]" value="it325" />
                                <label class="w3-label w3-valide">IT 325 (Web Page Design)</label> <br />
                                
                                <input class="w3-check" type="checkbox" name="class_name[]" value="eng211" />
                                <label class="w3-label w3-valide">ENG 211 (English Writing 2)</label> <br />
                                
                                <input class="w3-check" type="checkbox" name="class_name[]" value="oeas110" />
                                <label class="w3-label w3-valide">OEAS 110 (Earth Science)</label> <br />
                                
                                <input class="w3-check" type="checkbox" name="class_name[]" value="form" />
                                <label class="w3-label w3-valide">This Feedback Form</label>
                            </section>
                        </section>
                         <section class="w3-container">
                        	<section class="w3-container w3-half w3-pink w3-card-4">
                            	<section class="w3-container w3-black">
                                	<h2>Solve the CAPTCHA</h2>
                                </section>
                                <p>Let's make sure you're not a robot.</p>
                                <img id="captcha" src="securimage/securimage_show.php" alt="CAPTCHA Image" title="CAPTCHA Image" />
                                <a title="Request Different Image" alt="Request Different Image" class="w3-btn" href="#" onclick="document.getElementById('captcha').src = 'securimage/securimage_show.php?' + Math.random(); return false"><i class="fa fa-refresh"></i></a>
                                <object type="application/x-shockwave-flash" data="/securimage/securimage_play.swf?audio_file=/securimage/securimage_play.php&amp;bgColor1=%23fff&amp;bgColor2=%23fff&amp;iconColor=%23777&amp;borderWidth=1&amp;borderColor=%23000" width="19" height="19">

                              <param name="movie" value="/securimage/securimage_play.swf?audio_file=/securimage/securimage_play.php&amp;bgColor1=%23fff&amp;bgColor2=%23fff&amp;iconColor=%23777&amp;borderWidth=1&amp;borderColor=%23000&" />
                            
                            </object>
                                <input class="w3-input" type="text" name="captcha_code" size="10" maxlength="6" autocomplete="off" autocapitalize="off" autocorrect="off" />
                            </section>
                            <section class="w3-container w3-half w3-pink w3-card-4">
                            	<section class="w3-container w3-black">
                                	<h2>Finish Up</h2>
                                </section>
                                <p>Ready to submit?</p>
                                <section class="w3-btn-group">
									<!-- Hidden Inputs for the Form Processor -->
                                    <input type="hidden" name="submitted" value="true" />
                                    
                                    <input class="w3-btn w3-indigo w3-hover-red" type="submit" value="Submit" style="width:50%;" />
                                	<input class="w3-btn w3-light-grey w3-hover-red" type="reset" value="Reset" style="width:50%;" />
                                </section>
                            </section>
                        </section>
                   </form>
                   <?php
					}
					else
					// Show a Thank You page
					
					// Start by checking the CAPTCHA
					{
						if ($securimage->check($_POST['captcha_code']) == false)
						{
						  // the code was incorrect
						  // you should handle the error so that the form processor doesn't continue
						
						  // or you can use the following code if there is no validation or you do not know how
						  echo "The security code entered was incorrect.<br /><br />";
						  echo "Please go <a href='javascript:history.go(-1)'>back</a> and try again.";
						  exit;
						}
						else
						{
							?>
							<p>Thank you (submit test success)!  In real life, this web server does have access to MySQL to store these record in a database, as well as phpMyAdmin to access these records.  In addition, there are PHP commands you can use so that someone with proper credentials could read the database.  Here is what you submitted <a class="w3-btn" href="feedback.php"><i class="fa fa-commenting-o"></i> Start over?</a></p>
                            
                            <!-- Let's show a table with entries: Field Name, Form Value, Human Value -->
                            <!-- The table layout is responsive of course -->
                            <section class="w3-responsive">
                            	<table class="w3-table w3-striped w3-hoverable w3-card-4">
                                	<tr class="w3-blue">
                                    	<th>Entry</th>
                                        <th>Form Value</th>
                                        <th>Human Readable Value</th>
                                    </tr>
                                    <tr>
                                    	<td>First Name</td>
                                        <td><?php echo $_POST['first_name'];?></td>
                                        <td>(none)</td>
                                    </tr>
                                    <tr>
                                    	<td>Last Name</td>
                                        <td><?php echo $_POST['last_name'];?></td>
                                        <td>(none)</td>
                                    </tr>
                                    <tr>
                                    	<td>Email Address</td>
                                        <td><?php echo $_POST['email_address'];?></td>
                                        <td>(none)</td>
                                    </tr>
                                    <tr>
                                    	<td>School</td>
                                        <td><?php echo $_POST['school']; ?></td>
                                        <td>
                                        <?php
										// We have to echo out a human readable version of the
										// school name
										switch($_POST['school'])
										{
											case "odu":
												echo "Old Dominion University";
												break;
											case "tcc":
												echo "Tidewater Community College";
												break;
											case "wwrc":
												echo "Woodrow Wilson Rehabilitation Center";
												break;
										}
										?>
                                        </td>
                                    </tr>
                                    <tr>
                                    	<td>Written Remarks</td>
                                        <td><?php echo $_POST["written_remarks"]; ?></td>
                                        <td>(none)</td>
                                    </tr>
                                    <tr>
                                    	<td>Feedback is For</td>
                                        <td>
                                        <?php
											// We need to echo out
											// the checkbox array
											// and print as a list
											if(isset($_POST['class_name']))
											{
												// Boxes are Checked
												// Now, read entries from the Array
												echo "<ul class=\"w3-ul w3-hoverable\">\n";
												echo "<li class=\"w3-light-blue\"><b>Form Value: class_name[]</b></li>\n";
												
												// Look for a Needle in a Haystack
												if(in_array("it201", $_POST['class_name']))
												{
													echo "<li>it201</li>\n";
												}
												if(in_array("it325", $_POST['class_name']))
												{
													echo "<li>it325</li>\n";
												}
												if(in_array("eng211", $_POST['class_name']))
												{
													echo "<li>eng211</li>\n";
												}
												if(in_array("oeas110", $_POST['class_name']))
												{
													echo "<li>oeas110</li>\n";
												}
												if(in_array("form", $_POST['class_name']))
												{
													echo "<li>form</li>\n";
												}
												echo "</ul>\n";
											}
											else
											{
												echo "(none)";
											}
										?>
                                        </td>
                                        <td>
                                        <?php
											// We need to echo out
											// the checkbox array
											// and print as a list
											if(isset($_POST['class_name']))
											{
												// Boxes are Checked
												// Now, read entries from the Array
												echo "<ul class=\"w3-ul w3-hoverable\">\n";
												echo "<li class=\"w3-light-blue\"><b>Human Readable Value</b></li>\n";
												
												// Look for a Needle in a Haystack
												if(in_array("it201", $_POST['class_name']))
												{
													echo "<li>IT 201 (Intro to IT)</li>\n";
												}
												if(in_array("it325", $_POST['class_name']))
												{
													echo "<li>IT 325 (Web Page Design)</li>\n";
												}
												if(in_array("eng211", $_POST['class_name']))
												{
													echo "<li>ENG 211 (English Writing 2)</li>\n";
												}
												if(in_array("oeas110", $_POST['class_name']))
												{
													echo "<li>OEAS 110 (Earth Science)</li>\n";
												}
												if(in_array("form", $_POST['class_name']))
												{
													echo "<li>This Feedback Form</li>\n";
												}
												echo "</ul>\n";
											}
											else
											{
												echo "(none)";
											}
										?>
                                        </td>
                                    </tr>
                                </table>
                            </section>
							<?php
						}
					}
					?>
                    
                </section>
                 <?php include("copyleft.php"); ?>
            </section>
           
        </article>
    </body>
    <script>
	<!--
	function myAccFunc(theAcc) {
    var x = document.getElementById(theAcc);
    if (x.className.indexOf("w3-show") == -1) {
        x.className += " w3-show";
        x.previousElementSibling.className += " w3-light-gray";
    } else { 
        x.className = x.className.replace(" w3-show", "");
        x.previousElementSibling.className = 
        x.previousElementSibling.className.replace(" w3-light-gray", "");
    }
}

function myDropFunc() {
    var x = document.getElementById("demoDrop");
    if (x.className.indexOf("w3-show") == -1) {
        x.className += " w3-show";
        x.previousElementSibling.className += " w3-green";
    } else { 
        x.className = x.className.replace(" w3-show", "");
        x.previousElementSibling.className = 
        x.previousElementSibling.className.replace(" w3-green", "");
    }
}

function w3_open() {
    document.getElementsByClassName("w3-sidenav")[0].style.display = "block";
}
function w3_close() {
    document.getElementsByClassName("w3-sidenav")[0].style.display = "none";
}

var slideIndex = 1;
showDivs(slideIndex);

function plusDivs(n) {
  showDivs(slideIndex += n);
}

function currentDiv(n) {
  showDivs(slideIndex = n);
}

function showDivs(n) {
  var i;
  var x = document.getElementsByClassName("bus-slideshow");
  var dots = document.getElementsByClassName("image-index");
  if (n > x.length) {slideIndex = 1}    
  if (n < 1) {slideIndex = x.length} ;
  for (i = 0; i < x.length; i++) {
     x[i].style.display = "none";  
  }
  for (i = 0; i < dots.length; i++) {
     dots[i].className = dots[i].className.replace(" w3-white", "");
  }
  x[slideIndex-1].style.display = "block";  
  dots[slideIndex-1].className += " w3-white";
}
	// -->
	</script>
</html>