Esempio n. 1
0
                        echo "No Sessions logged</br>";
                    } else {
                        //show sessions if it exists
                        $found = show_sessions(0, $student, $db);
                        //show all sessions without radio buttons
                    }
                } elseif ($actionvalue == 3) {
                    $_SESSION['option'] = "studentinfo";
                    $info = unserialize($_SESSION['info']);
                    $student = $info->getStudent();
                    ?>
					<form name = "infoform"
					action = "Assignment2.php"
					method = "POST">
					<?php 
                    $found = show_sessions(2, $student, $db);
                    //show all sessions with radio buttons
                    ?>
						<input type="submit" value ="Add Note">
					</form>
					<?php 
                    $_SESSION['option'] = "addnotes";
                    //go to add notes
                } elseif ($actionvalue == 4) {
                    $_SESSION['option'] = "studentinfo";
                    $info = unserialize($_SESSION['info']);
                    $student = $info->getStudent();
                    $result = $db->query("select 1 from Notes");
                    if ($result == false) {
                        echo "No Notes logged</br>";
                        ?>
Esempio n. 2
0
                    //open file for appending
                    fwrite($fp, $printString);
                    //append date and psid
                    fclose($fp);
                    echo "Session logged for {$studentPsid} at {$currDate}<br/>";
                    $infoString = serialize($info);
                    $_SESSION['student'] = $infoString;
                } elseif ($actionvalue == 2) {
                    $_SESSION['option'] = "studentinfo";
                    $info = unserialize($_SESSION['student']);
                    $found = show_sessions(0, $info);
                    //show all sessions without radio buttons
                } elseif ($actionvalue == 3 || $actionvalue == 4) {
                    $_SESSION['option'] = "studentinfo";
                    $info = unserialize($_SESSION['student']);
                    $found = show_sessions(1, $info);
                    //show all sessions with radio buttons
                } else {
                    echo "Error occured try again<br/>";
                    advisor_action();
                    //error, prompt again
                }
                if ($actionvalue == 1 || $actionvalue == 2 || $found == 0) {
                    //nothing else to do here, go back to studentinfo for another action
                    ?>
					<form name = "infoform"
							action = "Assignment1.php"
							method = "POST">
						<input type="hidden" name="psid" value="$studentPsid">
						<input type="submit" value ="Back to Student Info">
					</form>