<?php
session_start();
ob_start();

require("../includes/config.php");
require("../includes/dbcon.php");
if($_SESSION['uid']==""){	
	header("location:index.php");
	exit();
}
$eId=$_REQUEST['eId'];

$enrolleeQuery = mysql_query("select * from enrollee where enrollee_id=".$eId);
$enrolleeValue = mysql_fetch_array($enrolleeQuery);

$enrolleeName=$enrolleeValue['fisrt_name']." ".$enrolleeValue['middle_name']." ".$enrolleeValue['last_name'];
$sex=($enrolleeValue['gender']=="m")? "Male." : "Female.";

$address_id=$enrolleeValue['address_id'];

$addressQuery = mysql_query("select * from address where address_id=".$address_id);
$addressValue = mysql_fetch_array($addressQuery);
 
$street_number=$addressValue['street_number'];
$street_line_01=$addressValue['street_line_01'];
$street_line_02=$addressValue['street_line_02'];
$street_line_03=$addressValue['street_line_03'];
$zipCode=$addressValue['zipCode'];
$building_numer=$addressValue['building_numer'];
$building_name=$addressValue['building_name'];
$apartment_numer=$addressValue['apartment_numer'];
$room_numer=$addressValue['room_numer'];

$countryQuery = mysql_query("select * from country where country_id=".$addressValue['country_id']);
$countryValue = mysql_fetch_array($countryQuery);
$country_name=$countryValue['country_name'];

$stateQuery = mysql_query("select * from state where state_id=".$addressValue['state_id']);
$stateValue = mysql_fetch_array($stateQuery);
$state_name=$stateValue['state_name'];

$cityQuery = mysql_query("select * from city where city_id=".$addressValue['city_id']);
$cityValue = mysql_fetch_array($cityQuery);
$city_name=$cityValue['city_name'];

$bornCityQuery = mysql_query("select * from city where city_id=".$enrolleeValue['city_born']);
$bornCityValue = mysql_fetch_array($bornCityQuery);
$city_born=$bornCityValue['city_name'];
    	  
$phoneQuery = mysql_query("select * from enrollee_phone where enrollee_id=".$eId);
while($phoneValue = mysql_fetch_array($phoneQuery))
{
	$phoneId=$phoneValue['phone_id'];	
	$phoneQuery2 = mysql_query("select * from phone where phone_id=".$phoneId);
	$phoneValue2 = mysql_fetch_array($phoneQuery2);
	if($phoneValue2['phone_type']=="Land Phone")
	{
		$landPhone=$phoneValue2['phone_number'];
	}
	else
	{
		$mobPhone=$phoneValue2['phone_number'];
	}
}

ob_end_flush();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../style/design.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
.style1 {font-size: 0.8em}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>:::   User Details Page   :::</title>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td align="center" valign="top">
<?php
include_once("includes/header.php");
?>
	<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">	 
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td width="30%" valign="top"><div class="bodySubHeader"> <span class="bsht03">Personal Details of <?=$enrolleeName?> </span> </div></td>
				</tr>
		</table>
		<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="DarkLightBox">	
	<?php
	if($err_msg)
	{
	?>
	 <tr>
	   <td height="30" align="center" valign="top" colspan="8"><strong><?=$err_msg?></strong></td>	   
	 </tr>
	<?php
	}
	?>
	 <tr>
	   <td width="65%" align="left" valign="top" colspan="8" class="TopMenu2">Personal Details</td>	  
	 </tr> 
	 <tr>
	   <td align="left" valign="top" colspan="8">&nbsp;</td>	  
	 </tr>
	 <tr>
	   <td height="30" align="left" valign="top" class="browseEventContents">First Name:<font color="red"><strong>*</strong></font></td>	   
	   <td height="30" align="left" valign="top"><input name="fisrt_name" value="<?=$enrolleeValue['fisrt_name']?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top" width="1%">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">Middle Name:</td>
	   <td height="30" align="left" valign="top"><input name="middle_name" value="<?=$enrolleeValue['middle_name']?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top" width="1%">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">Last Name:<font color="red"><strong>*</strong></font></td>
	   <td height="30" align="left" valign="top"><input name="last_name" value="<?=$enrolleeValue['last_name']?>" type="text" class="textField" readonly/></td>
	 </tr>	 
	 <tr>
	   <td height="30" align="left" valign="top" class="browseEventContents">Sex:</td>	   
	   <td height="30" align="left" valign="top"><input name="last_name" value="<?=$sex?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">Date of birth:<font color="red"><strong>*</strong></font></td>	  
	   <td height="30" align="left" valign="top"><input name="dob" value="<?=$enrolleeValue['date_of_birth']?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">City Born:<font color="red"><strong>*</strong></font></td>	    
	   <td height="30" align="left" valign="top"><input name="city_born" value="<?=$city_born?>" type="text" class="textField" readonly/></td>
	 </tr>	 
	 <tr>	   
	   <td height="30" align="left" valign="top" class="browseEventContents">State:<font color="red"><strong>*</strong></font></td>	 
	   <td height="30" align="left" valign="top"><input name="state" value="<?=$state_name?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">City:<font color="red"><strong>*</strong></font></td>	  
	   <td height="30" align="left" valign="top"><input name="city" value="<?=$city_name?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">Zip Code:<font color="red"><strong>*</strong></font></td>	   
	   <td height="30" align="left" valign="top"><input name="zipCode" value="<?=$zipCode?>" type="text" class="textField" readonly/></td>	   
	 </tr>	
	 <tr>
	   <td height="30" align="left" valign="top" class="browseEventContents">Country:<font color="red"><strong>*</strong></font></td>	   
	   <td height="30" align="left" valign="top" colspan="7">
			<input name="country" value="<?=$country_name?>" type="text" class="textField" readonly/></td>  	   
	 </tr>
	 <tr>
	   <td height="30" align="left" valign="top" class="browseEventContents">Street Number:<font color="red"><strong>*</strong></font></td>	  
	   <td height="30" align="left" valign="top"><input name="street_number" value="<?=$street_number?>" type="text" class="textField" readonly/></td>  
	   <td height="30" align="left" valign="top">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">Room Number:</td>	   
	   <td height="30" align="left" valign="top"><input name="room_numer" value="<?=$room_numer?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">&nbsp;</td>	   
	   <td height="30" align="left" valign="top">&nbsp;</td>
	 </tr>
	 <tr>
	   <td height="30" align="left" valign="top" class="browseEventContents">Apartment Number:</td>	   
	   <td height="30" align="left" valign="top"><input name="apartment_numer" value="<?=$apartment_numer?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">Building Name:</td>	   
	   <td height="30" align="left" valign="top"><input name="building_name" value="<?=$building_name?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">Building Number:</td>	   
	   <td height="30" align="left" valign="top"><input name="building_numer" value="<?=$building_numer?>" type="text" class="textField" readonly/></td>
	 </tr>	 
	 <tr>
	   <td height="30" align="left" valign="top" class="browseEventContents">Street Line 1:<font color="red"><strong>*</strong></font></td>	   
	   <td height="30" align="left" valign="top"><input name="street_line_01" value="<?=$street_line_01?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">Street Line 2:</td>	   
	   <td height="30" align="left" valign="top"><input name="street_line_02" value="<?=$street_line_02?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">Street Line 3:</td>	 
	   <td height="30" align="left" valign="top"><input name="street_line_03" value="<?=$street_line_03?>" type="text" class="textField" readonly/></td>
	 </tr>	
	 <tr>
	   <td height="30" align="left" valign="top" class="browseEventContents">Land Phone No.:<font color="red"><strong>*</strong></font></td>	   
	   <td height="30" align="left" valign="top"><input name="landPhone" value="<?=$landPhone?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">Mobile No.:<font color="red"><strong>*</strong></font></td>	   
	   <td height="30" align="left" valign="top"><input name="mobilePhone" value="<?=$mobPhone?>" type="text" class="textField" readonly/></td>
	   <td height="30" align="left" valign="top">&nbsp;</td>
	   <td height="30" align="left" valign="top" class="browseEventContents">&nbsp;</td>	 
	   <td height="30" align="left" valign="top">&nbsp;</td>
	 </tr>	
	 <tr>
	   <td height="30" align="right" valign="top" class="browseEventContents" colspan="8"><a href="uDetails2.php?eId=<?=$eId?>"><input value="OK" type="submit" /></a></td>
	 </tr>
	</table>
<?php
include_once("../includes/footer.php");
?>
		</td>
	</tr>
</table>
</body>
</html>