<?php
include ("connect.php");
session_start();
session_register('member');
session_register('member_level');
session_register('session_memName');

$eventNo = $_POST["eventNo"];
$eventImage = $_POST["eventImage"];
$eventDate = $_POST["eventDate"];
$eventTime = $_POST["eventTime"];
$eventDescription = $_POST["eventDescription"];


?>

<html>

<head>

<title>Event</title>
</head>

<body bgcolor="lightyellow" body link="blue" alink="red" vlink="blue" style="font-family:times new roman">

<table width="90%" align="center">

<tr align="center">

<td align="left" alt="天天书局" title="天天书局" ><img src="Picture/Logo.png" width="110" height="110"></td>

<td align="right"><!-- Search Google --><FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8 ><input type=hidden name=oe value=UTF-8 target="_blank">
<TABLE bgcolor="" target="_blank"><tr><td><A HREF="http://www.google.com">
<IMG SRC="Picture/GoogleLogo.png" border="0" ALT="Google" align="absmiddle" title="Google" ></A>
<INPUT TYPE=text name=q size=25 maxlength=255 value=""><INPUT type=submit name=btnG VALUE="Google Search"></td></tr></TABLE>
</FORM></center><!-- Search Google -->
</td>
</tr>
</table>

<span style="font-family:times new roman">&nbsp&nbsp&nbsp&nbsp
<?php
session_start();
$username = $_SESSION['member'];
if($_SESSION['member']!= null)
{
echo "<span style='color:black;font-weight:bold'>".$username."</span>";
echo "<a href='logout.php'>(Logout)</a>";
}else{
echo "<span style='color:black;font-weight:bold'>You haven't login.</span>";
echo "<a href='index.php'><span style='color:blue;font-weight:bold'>(Login)</span></a>";
}
?>
</span>

<br>
<hr style="color:black"></hr>
<a href="addEvent.php">Add Event</a>
<br>


<h4 style="text-align:center">
<a href="index.php">Home Page</a>
<a href=".html" >Top of the Book</a>
<a href=".html" >New Books</a>
<a href="bookmenu.php">Search Our Book</a>
<a href="companyevent.php" >News & Promo</a>
<a href="Addmem.php">Membership</a>
<a href="temcart.php">Cart</a>
<a href=".html" >Login</a>
<a href="companyprofile.php" >About Us</a>
<a href=".html" >Site Map</a>
</h4>

<br>
<br>


<!--1st table-->
<table border="0" width="90%" align="center">

<tr>

<td>
<?php
include("connect.php");

$result = mysql_query("SELECT * FROM companyevent ORDER BY eventNo,eventImage,eventDate,eventTime,eventDescription";

$num_results = mysql_num_rows($result);




for ($i=0; $i <$num_results; $i++)
{
	$row = mysql_fetch_array($result);
	
	echo "<table border='1' width='100%' font style='font-family:times new roman'>";
	
	echo "<tr align='center' font style='color:red'>";
	echo "<td width='20%'>Image</td>";
	echo "<td width='20%'>Date</td>";
	echo "<td width='20%'>Time</td>";
	echo "<td width='20%'>Description</td>";
	echo "<td width='20%'>Action</td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<td rowspan='3' align='center'>";
	echo "<img src=".$row["eventImage"]." width='150' height='150'>";
	echo "</td>";
	echo "<td align='center'>".$row["eventDate"]."</td>";
	echo "<td align='center'>".$row["eventTime"]."</td>";
	echo "<td align='center'>".$row["eventDescription"]."</td>";
	echo "<td rowspan='3' align='center'><a href='updateEvent.php?eventNo=".$row['eventNo']."'>";
	echo "Edit";
	echo "<br/>";
	echo "<a href='deleteEventInformation.php?eventNo=".$row['eventNo']."'>";
	echo "Delete";
	echo "</td>";
	echo "</tr>";
	
	
	
	
	
	echo "<br>";
	
	}
	echo "</table>";
	echo "<br>";
	echo "<br>";
	echo "<br>";
	
//$result->free();
$db = mysql_close();
?>
</td>




</tr>

</table>


</body>

</html>





