// session_start();
include 'TPGP_db.php';
// self post data
$iCancel = $_POST['Cancel'];
$Submit = $_POST['Submit'];
$EnrollmentID = $_POST['Enrollment'];
$EndetailID = $_POST['eid'];
$Evaluation = $_POST['Evaluation'];
$EvalDate = $_POST['EvalDate'];
$Assignment = $_POST['Assignment'];
$Extras = $_POST['Extras'];
$Unit = $_POST['Unit'];
$Lesson = $_POST['Lesson'];
/* Let's strip some slashes in case the user entered
any escaped characters. */
$EndetailID = stripslashes($EndetailID);
$Evaluation = stripslashes($Evaluation);
$EvalDate = stripslashes($EvalDate);
$Assignment = stripslashes($Assignment);
$Extras = stripslashes($Extras);
$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"){
$CURL = "TPGP_UpdateUnits.php?ID=" .$EnrollmentID;
header("Location:" .$CURL);
}
if ($Submit == "Update Unit") {
$sql2 = "UPDATE endetails SET evaluation='$Evaluation',evaldate='$EvalDate',assignment='$Assignment',extras='$Extras',unit='$Unit',lesson='$Lesson' WHERE endetailID=" .$EndetailID;
mysql_query($sql2);
// print ".$sql2";
$FURL = "TPGP_UpdateUnits.php?ID=" .$EnrollmentID;
header("Location:" .$FURL);
} else {
// $PHP_SELF as the form action will cause the script to post to itself
$EndetailID = $_GET['ID'];
// ***********************************************************************************
// USE THE ENDETAIL ID to get the Enrollment ID
$theSQL = "SELECT enrollmentID FROM endetails WHERE endetailID ='$EndetailID'";
$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 $STStepID;
// echo $UserID;
// echo $StudentId;
}
}
// ***********************************************************************
// USE THE ENROLLMENT ID TO GET THE USER ID
$theSQL = "SELECT StudentID FROM enrollment WHERE 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;
// echo $STStepID;
// echo $UserID;
// echo $StudentId;
}
}
$theStudentID = $StudentId;
// echo $StudentId ;
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$sql = mysql_query("SELECT * FROM users WHERE userid='$StudentId'");
$record_found = mysql_num_rows($sql);
if($record_found > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
$EnrollmentURL = "TPGP_UpdateEnrollment.php?ID=" . $StudentId;
$StepsURL = "TPGP_UpdateSteps.php?ID=" . $StudentId;
$ReportsURL = "TPGP_UpdateWeeklyReports.php?ID=" . $StudentId;
$ProgramsURL = "TPGP_UpdateWeeklyPrograms.php?ID=" . $StudentId;
echo "
Update Student Information
STUDENT INFORMATION : |
Name : $first_name $last_name |
Login : $username |
Email : $email_address |
|
|
|
|
|
";
} // END WHILE
} // END IF RECORDS FOUND
// *********************************************************************
$sql3="SELECT enrollmentID,evaluation,evaldate,assignment,extras,unit,lesson FROM endetails WHERE endetailID=" .$EndetailID;
$result3 = mysql_query($sql3);
$nrows = mysql_num_rows($result3);
$row = mysql_fetch_array($result3);
echo '';
}
?>