<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE>
	Welcome to the Alumni Website
 </TITLE>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</HEAD>
<BODY>
	<H1 ALIGN="center">Welcome to the Alumni Website</H1>

<?
	@$d = mysql_connect('localhost','abu-jeib','iyad911');
	if (!$d)
	{
		echo "Sorry can't process your information at this time.<BR>";
		exit;
	}

	@$s = mysql_select_db('alumni');
	if (!$s)
	{
		echo "Sorry can't process your information at this time.<BR>";
		exit;
	}
	
	$q = "select first_name, last_name, email, address, phone, major, graduation_year, date from users"; 
	@$r = mysql_query($q);
	if (!$r)
	{
		echo "Sorry can't process your information at this time.<BR>";
		@mysql_close($d);
		exit;
	}
	else
	{
		while ($row = mysql_fetch_row($r))
		{
			for ($i = 0; $i < mysql_num_fields($r);$i++)
			{
				$field = mysql_field_name($r,$i);
				$data = trim($row[$i]); 
	     	 		if (!empty($data) && $data != NULL)
				{
					if ($field == "first_name")
						echo "<b>First Name: </b>",  							
							ucfirst(strtolower($data)), "<br>\n";
					else if ($field == "last_name")
						echo "<b>Last Name: </b>", 
							ucfirst(strtolower($data)), "<br>\n";
					else if ($field == "graduation_year")
						echo "<b>Graduation Year: </b> $data<br>\n";
					else if ($field == "email")
						echo "<b>Email: </b> <a href=\"mailto:$data\">$data</a><br>\n";
					else if ($field == "date")
						echo "Last updated: $data.<br>\n";
					else
						echo "<b>", ucfirst($field), ": </b> $data<br>\n";	
				}
			}
			echo "<hr>\n";
	}
	}
	@mysql_free_result($r);
	@mysql_close($d); 


echo "<CENTER>";
echo "<A href=\"alumni.html\">Back to the Alumni Menu</A>";
echo "</CENTER>\n";

echo "</ol>\n</body></html>\n";
?>
