// session_start();
include 'TPGP_db.php';
// self post data
$Submit = $_POST['Submit'];
$EnrollmentID = $_POST['eid'];
$StudentID = $_POST['sid'];
$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. */
$EnrollmentID = stripslashes($EnrollmentID);
$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
if ($Submit == "Add Unit") {
$sql2 = "INSERT into endetails (enrollmentID,evaluation, evaldate, assignment, extras, unit, lesson) VALUES ('$EnrollmentID','$Evaluation','$EvalDate','$Assignment','$Extras','$Unit','$Lesson')";
mysql_query($sql2);
// print "success - .$sql2";
// print "To Create A New Class, click here. ";
// END IF greater than one row found inthe class list.
} else {
// $PHP_SELF as the form action will cause the script to post to itself
$EnrollmentID = $_GET['ID'];
} // END ELSE IF
// *************************************************************************
$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 "
View Student Information
STUDENT INFORMATION :
Name : $first_name $last_name
Login : $username
Email : $email_address
";
$query="SELECT * FROM reports WHERE (StudentID ='$theStudentID' AND CreditsTOTAL > 0) ORDER BY EndDate DESC LIMIT 1";
// print "$query";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$row99=mysql_fetch_array($result);
$CC = $row99["CreditsTPGP"];
// print "$CC";
$CO = $row99["CreditsOTHER"];
// print "$CO";
$CT = $row99["CreditsTOTAL"];
$CG = $row99["CreditsGOAL"];
// CODE
echo '
Credits Completed (TPGP) : '.$CC.'
Credits Completed (OTHER) : '.$CO.'
Credits Total : '.$CT.'
Credits Goal : '.$CG.'
';
$i++;
} // END WHILE INNER LOOP RECORDSET - last report
} // END WHILE
echo '
';
} // END IF
else {
echo "Session Variables Timed Out - Please login again.";
}
// ******************************************************************
$RURL = "TPGP_UpdateEnrollment.php?ID=" .$StudentID;
echo " ";
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
echo 'CLASS ["'.$theClassName.'"] - ( Click here to return to the
Class page for this student)';
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$sql="SELECT enrollment.StudentID, endetails.endetailID, endetails.enrollmentID, endetails.evaluation, endetails.evaldate, endetails.assignment, endetails.extras, endetails.unit, endetails.lesson FROM endetails INNER JOIN enrollment ON endetails.enrollmentID = enrollment.EnrollmentID WHERE endetails.enrollmentID=" .$EnrollmentID. " ORDER BY endetails.endetailID";
$result = mysql_query($sql);
$nrows = mysql_num_rows($result);
if($nrows != 0)
{
print "";
print "";
print "FUNCTION ";
print "";
print "Unit ";
print "";
print "Lesson ";
print "";
print "Evaluation ";
print "";
print "Evaluation Date ";
print "";
print "Assignment ";
print "";
print "Extras ";
print " >";
for($j=0;$j<$nrows;$j++)
{
$row = mysql_fetch_array($result);
$StudentID = $row["StudentID"];
$EditURL = "TPGP_EditEnroll.php?ID=" . $row['endetailID'];
$DeleteURL = "TPGP_DeleteEnroll.php?ID=" . $row['endetailID'];
$UnitsURL = "TPGP_EditEnroll.php?ID=" . $row['endetailID'];
print " EDIT ";
print " DELETE ";
print "" . $row["unit"];
print " " . $row["lesson"];
// ********************************************
$theval=$row["evaluation"];
$theval=(double)$theval;
// ********************************************
if ($theval >= 70.0){
print " " . $theval . " ";
}
else{
print "" . $theval . " ";
}
print "" . $row["evaldate"];
print " " . $row["assignment"];
print " " . $row["extras"];
print "\n";
}
print "
\n";
// $RURL = "TPGP_UpdateEnrollment.php?ID=" .$StudentID;
print "Click here to return to the other classes that this student is enrolled in!\n";
}
$list_comp = $row["enrollmentID"];
// $RURL = "TPGP_UpdateEnrollment.php?ID=" .$StudentID;
echo '
Add New Unit / Lesson
UNIT : NEW
CLASS ['.$theClassName.']
';
$RURL = "TPGP_UpdateEnrollment.php?ID=" .$StudentID;
print "Click here to return to the other classes that this student is enrolled in!";
// THIS IS WHERE THE SELF POST FORM ENDS
// mysql_close($dbcon);
?>