Location: PHPKode > projects > Teacher Evaluation based on phpsurveyor > DONT USE/mod_evaluation/header.php
<?php 
// part of TeacherEvaluation by hide@address.com
// published under the Terms of the GPL


require_once "evaluation.classes.php";
// get student from database through username and fill the student object
$myStudent = new student();
//TODO RELEASE delete this line for deployment
	$_SERVER['AUTH_USER']="Domain\\\\johannes.kutsam";
//....

$domainuser_array = explode("\\\\", $_SERVER['AUTH_USER']);
$querystring = "SELECT * FROM `student` where username='" . $domainuser_array[1] . "'";
$result = mysql_query($querystring);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>
            <?php echo _TITLE;

?>
        </title>
		<link rel="stylesheet" type="text/css" href="main.css">

    </head>
    <body TOPMARGIN="0" LEFTMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">
        
		<table class="mainmenu"  cellspacing="2" cellpadding="2"> 
                <tr height="10%">
                    <td style="vertical-align: top; ">
                        <h1><?php echo _TITLE;
						if(mysql_affected_rows()<1){mod_evaluation_error("Student does not exist or DB error");}


?></h1>
<a href="index.php"><?php echo _LINK_SURVEY_HOME;

?> </a>|
						<a href="documentation.php" ><?php echo _LINK_DOCUMENTATION;

?> </a>|
						<a href="documentation.php#anonymous" ><?php echo _LINK_ANONYMOUS;

?> </a>|
						<a href="documentation.php#faq" ><?php echo _LINK_FAQ;

?> </a>|
						<a href="statistics.php"><?php echo _LINK_STATISTICS;

?> </a>|
						 <a href="documentation.php#impressum"><?php echo _LINK_IMPRESSUM;

?> </a>
                    </td>
                    <td align="right" valign="bottom"><a href="logoff.php">
<?php                       
if (mysql_affected_rows()==1) {  
	/*if the user is authenticated correctly but 
	* doesn't exist in the db the reason can be: 
	* it is NOT a student, or DB is not up2date
	* Or the user exists more than 1. should not happen because of primary key
	*/
	$myStudent->databasefields = mysql_fetch_assoc($result);
 	echo $myStudent->databasefields['username'];
	echo " " .$myStudent->databasefields['idstudent'];
	}
?>	
  <?php echo _LINK_LOGOFF;?></a> 
                    </td>
                </tr>
</table>
<?php 
if (!mysql_affected_rows()==1){
	echo '<div style="background-color:red; font-family:arial; font-size:30">' . _NOTICE_USER_NOT_IN_DB .'</div>';
	require "documentation.htm";
	exit;
}
?>
Return current item: Teacher Evaluation based on phpsurveyor