public function test_findStudentAccount($value, $ans, $note) { require_once '../Controller/StudentController.php'; $studentController = new StudentController(); $result = $studentController->findStudentAccount($value); $result = trim($result); //$result = str_replace(PHP_EOL,null,$result); $ans = trim($ans); //$ans = str_replace(PHP_EOL,null,$ans); /* print_r($ans); echo "\n"; print_r($result); exit(); */ if (strcmp($result, $ans) == 0) { $ans = "PASSED"; } else { $ans = "FAILED"; } $test = "<br />\n\t\t\t\t\tTesting findStudentAccount() <br /><b>note:</b> {$note}\n\t\t\t\t\t<br />\n\t\t\t\t\tWith: " . $value . "\n\t\t\t\t\t<br />\n\t\t\t\t\tTest: " . $ans . "<br />"; return $test; }
require 'Controller/StudentController.php'; $studentController = new StudentController(); session_start(); if (isset($_POST['textbox_newPass']) || isset($_POST['textbox_secretAns'])) { if (isset($_POST['textbox_newPass']) && isset($_POST['textbox_secretAns'])) { $email = $_SESSION['forgotPassword']; $found = $studentController->resetPassword($email, $_POST['textbox_secretAns'], $_POST['textbox_newPass']); } else { $found = "You must fill both Secret Answer and New Password feilds before proceeding"; } if (isset($_SESSION['forgotPassword'])) { unset($_SESSION['forgotPassword']); } } else { if (isset($_POST['textbox_txt'])) { $found = $studentController->findStudentAccount($_POST['textbox_txt']); } else { $found = $studentController->CreateForgotPage(); } } $title = "Forgot Password"; $content = $found; //include 'Styles/ManageTemplate.php'; include 'template.php'; ?>