<?

/*****************************************************************
* filename: committeeView.php
* Purpose: for a committee member to view student info
* Version information 1.0
* Date: December 4,2001
******************************************************************/


session_start();
require("DB.php");
if($userType!='c')
 header("Location: logout.php");


?>

<HTML>
<HEAD>
<TITLE> GPA for Committee Viewing Student Information </TITLE>
</HEAD>

<BODY BACKGROUND="UNR_Seal.gif">
<CENTER><img src="UNR_Logo.gif">  </CENTER>



<CENTER>

<?
//if(!isset($studentIndex)) {
//  $studentIndex=0;
//} 
if(!isset($orderBy)) {
  $orderBy=1;
}

$xx=new DB("andromeda", "gradinfo");
$xx->connect();
$yy=$xx->getStudentList();

$msg="<H2>Viewing Student Info</H2><BR>";
$msg.="<FORM ACTION=committeeView.php METHOD=POST>";
$msg.="Seaching Students in Order of <BR><BR>";

$msg.="<SELECT NAME=\"orderBy\"  WIDTH=300 SIZE=1>";
$msg.="<OPTION VALUE=\"1\">Family Name";
//$msg.="<OPTION VALUE=\"2\">Given Name";
//$msg.="<OPTION VALUE=\"3\">User ID";
$msg.="</SELECT><BR><BR>";

$msg.="Choose Student...<BR>";
$msg.="<SELECT NAME=\"studentIndex\" WIDTH=400 SIZE=3>";
$k=0;while(($zz=array_pop($yy))!=NULL){
$uu=" ";
$u1=$zz->firstName;$u2=$zz->lastName;
$uu.=$u1;$uu.="  ";$uu.=$u2;$uu.="----";
$u3=$zz->rNumber;
$uu.="$u3";
$msg.="<OPTION VALUE=\"$k\">$uu"; 
if ($k==$studentIndex) $sortKey=$u3;
$k++;}

$msg.="</SELECT><BR><BR>";
$msg.=" <INPUT TYPE=\"SUBMIT\" VALUE=\"View\"><BR><BR><HR>";

$yy=$xx->getStudent($sortKey);
$show=$yy->name->lastName;

$msg.=" Information for the Chosen Student:<BR><HR>";
$msg.="<TEXTAREA NAME=\"studentInfo\" ROWS=15 COLS=50>";

$msg.="This Student's Personal Information:\n\nName:     ";
$show=$yy->name->firstName; $msg.=$show; $msg.=" ";
$show=$yy->name->MI; $msg.=$show; $msg.=". ";
$show=$yy->name->lastName;$msg.=$show;$msg.="\nrNumber:  ";
$show=$yy->rNumber; $msg.=$show;$msg.="\nSSN:    ";
$show=$yy->ssNumber; $msg.=$show;
$msg.="\nDate of Birth: ";$show=$yy->dob;$msg.=$show;

$msg.="\n\nE-Mail:   ";
$show=$yy->email; $msg.=$show;$msg.="\nAddress:    \n  Street:  ";
$show=$yy->address->streetName; $msg.=$show; $msg.="\n  P.O. Box:   ";
$show=$yy->address->POBox; $msg.=$show; $msg.="\n  City:   ";
$show=$yy->address->city; $msg.=$show; $msg.="\n  State:   ";
$show=$yy->address->state; $msg.=$show; $msg.="\n  Country:   ";
$show=$yy->address->country; $msg.=$show; $msg.="\n  ZipCode:   ";
$show=$yy->address->zipcode; $msg.=$show; $msg.="\n\n  Telephone No.   ";
$msg.="\n    (";$show=$yy->phoneNumber->area; $msg.=$show;$msg.=")  ";
$show=$yy->phoneNumber->prefix;$msg.=$show;$msg.=" ";
$show=$yy->phoneNumber->suffix;$msg.=$show;$msg.="\n    Country Code:  ";
$show=$yy->phoneNumber->countryCode; $msg.=$show;$msg.="\n";

$msg.="\nBackground Information:";
$msg.="\n  TOEFL score:   ";$show=$yy->toefl;$msg.=$show;
$msg.="\n  GRE  Verbal:   ";$show=$yy->GRE->verbal;$msg.=$show;
$msg.="\n  GRE  Math:     ";$show=$yy->GRE->math;$msg.=$show;
$msg.="\n  GRE Analytic:  ";$show=$yy->GRE->analytical;$msg.=$show;
$msg.="\n  Trans. GPA:    ";$show=$yy->tGPA;$msg.=$show;



$msg.="\n  The Attended School Inof:";
$msg.="\n  School Name:  ";$show=$yy->school->schoolName;$msg.=$show;
$msg.="\n  School Address:   ";
$show=$yy->school->address->streetName;
$msg.="\n        ";$msg.=$show;
$show=$yy->school->address->city;
$msg.="\n        ";$msg.=$show;
$show=$yy->school->address->state;
$msg.="\n        ";$msg.=$show;
$show=$yy->school->address->country;
$msg.="\n        ";$msg.=$show;
$show=$yy->school->address->POBox;
$msg.="\n        ";$msg.=$show;
$show=$yy->school->address->zipcode;
$msg.="\n        ";$msg.=$show;
$msg.="\n    The Degree Awarded:  ";
$show=$yy->degree;$msg.=$show;
$msg.="\n    Date Awarded:  ";
$show=$yy->dateGrad;$msg.=$show;
$msg.="\n    The Major   :  ";
$show=$yy->major;$msg.=$show;
$msg.="\n\n";



$msg.="\n  Courses Already Taken :\n";

//$sortKey="r0000005";
$yyy=$xx->getTransCourseList($sortKey);
$msg.="     Courses  Grade    Type     Semester  \n";
while(($zz=array_pop($yyy))!=NULL){
$msg.="      ";$show=$zz->course;$msg.=$show;
$msg.="    ";$show=$zz->grade;$msg.=$show;
$msg.="     ";$show=$zz->type;$msg.=$show;
$msg.="     ";$show=$zz->semester;$msg.=$show;
$msg.="\n";
}


//$msg.="\n\nCurrent Status:   ";$show=$yy->status;$msg.=$show;
$msg.="\n\nCurrent Information:";
$msg.="\n  Major:      ";$show=$yy->major;$msg.=$show;
$msg.="\n  Program in: ";$show=$yy->programType;$msg.=$show;
$msg.="\n  Type    :   ";$show=$yy->typpeProg;$msg.=$show;
$msg.="\n  Advisor :   ";$show=$yy->advisor;$msg.=$show;
$msg.="\n  Project :   ";$show=$yy->project;$msg.=$show;
$msg.="\n  GPA at UNR:  ";$show=$yy->cGPA;$msg.=$show;

/*
$msg.="\n  Courses Taken at UNR :\n";

//$sortKey="r0000004";
$yyy=$xx->getCourseList($sortKey);
$msg.="     Courses  Grade    Type     Semester  \n";
while(($zz=array_pop($yyy))!=NULL){
$msg.="      ";$show=$zz->course;$msg.=$show;
$msg.="    ";$show=$zz->grade;$msg.=$show;
$msg.="     ";$show=$zz->type;$msg.=$show;
$msg.="      ";$show=$zz->semester;$msg.=$show;
$msg.="\n";
}
*/

$msg.="\nComments for This Student:\n\n";
$yyy=$xx->getNoteses($sortKey);
while(($uu=array_pop($yyy))!=NULL){
 $msg.="    ";$msg.=$uu;$msg.="\n";
}

$msg.="\n\n";
$msg.="----Finish Retrieving This Student's Info---\n\n";
$msg.="</TEXTAREA><BR>";

$msg.="<BR><HR> Writing Comments for the Chose Student in Following:<BR><HR>";
//$msg.="<FORM ACTION=committeeView.php METHOD=POST>";
$msg.="<TEXTAREA NAME=\"evaluations\" ROWS=10 COLS=40>";
$msg.="</TEXTAREA><BR><BR><BR>";
if ($evaluations!=''){
$xx->putNotes($key,$evaluations);
}
$key=$sortKey;
session_register("key");

$msg.=" <INPUT TYPE=\"SUBMIT\" VALUE=\"Sending Comments\"></FORM><BR><HR>";


echo "$msg<P>";

?>

<FORM ACTION="committee.php" METHOD=POST>
<CENTER><INPUT TYPE="SUBMIT" VALUE="Back to Committee GPA"></CENTER>

<FORM ACTION="logout.php" METHOD=POST>
<CENTER><INPUT TYPE="SUBMIT" VALUE="Log Out of GPA"></CENTER>


</CENTER>

<img src="UNR_Wolf.gif" align=left>
</BODY>
</HTML>
