// session_start(); include 'TPGP_db.php'; // self post data $iCancel = $_POST['Cancel']; $classId = $_POST['theClassId']; $unitId = $_POST['theUnitId']; $unit = $_POST['theUnit']; $lesson = $_POST['theLesson']; $classId = stripslashes($classId); $unitId = stripslashes($unitId); $unit = stripslashes($unit); $lesson = stripslashes($lesson); // echo $PHP_SELF // THIS IS WHERE THE SELF POST FORM GOES // Define post fields into simple variables $iCancel = stripslashes($iCancel); if ($iCancel == "Cancel"){ header("Location: TPGP_EditUnits.php?ID=" .$classId); } if (($unit) && ($classId)) { $sql2 = "UPDATE unit SET classID='$classId',unit='$unit',lesson ='$lesson' WHERE unitID=" .$unitId; mysql_query($sql2); header("Location: TPGP_EditUnits.php?ID=" .$classId); } else { // $PHP_SELF as the form action will cause the script to post to itself $UnitIDENT = $_GET['ID']; // &&&&&&&&&&&&&&&&& GET THE ENROLLMENT ID &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& $theSQL = "SELECT enrollmentID FROM endetails WHERE endetailID ='$UnitIDENT'"; $sql444 = mysql_query($theSQL); // echo $theSQL; $record_found = mysql_num_rows($sql444); // echo $record_found; if($record_found > 0){ while($row = mysql_fetch_array($sql444)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } // echo $row; // echo $key; // echo $$key; $EnrollmentID = $enrollmentID; // echo $UserID; // echo $StudentId; } } // &&&&&&&&&&&&&&&&& END THE ENROLLMENT ID &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // ***************************************************************************** $theSQL = "SELECT enrollment.EnrollmentID, classes.ClassName, enrollment.ClassID, enrollment.StudentID, enrollment.FinalGrade, enrollment.CreditsEarned, enrollment.StartDate, enrollment.EndDate, enrollment.CreditsPotential, enrollment.CreditsActual, enrollment.Status, enrollment.class, enrollment.subject FROM enrollment LEFT JOIN classes ON enrollment.ClassID = classes.ClassId WHERE enrollment.EnrollmentID ='$EnrollmentID'"; $sql444 = mysql_query($theSQL); // echo $theSQL; $record_found = mysql_num_rows($sql444); // echo $record_found; if($record_found > 0){ while($row = mysql_fetch_array($sql444)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } // echo $row; // echo $key; // echo $$key; $StudentId = $StudentID; $theClassName = $ClassName; // echo $UserID; // echo $StudentId; } } // **************************************************************************** $theStudentID = $StudentId; $sql = mysql_query("SELECT * FROM users WHERE userid='$theStudentID'"); $record_found = mysql_num_rows($sql); if($record_found > 0){ while($row = mysql_fetch_array($sql)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } // END FOR echo "
|
|