<?php
include("../session.php");
include("../connect.php");
$user=$_SESSION['agent'];			
?>
<html>
<head>
<link href="header.css" rel="stylesheet" type="text/css"/>
<link type="text/css" rel="stylesheet" href="overflow.css" />
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<!-----------------Outer table--------------->
<div id="content2">
<table  width=1000 border=0 cellspacing=10 cellpadding=3  >
<tr>
	<td colspan=2>
	<?php include("head.php");?>
	</td>
	</tr>
<tr>
	<td colspan=2>
	<div class=main>&nbsp;&nbsp;>>
			<a href="<?php echo"agent.php";?>">&nbsp;Home&nbsp;</a>>>
			&nbsp;License Renewal&nbsp;
			</div></td>
	</tr>
<tr>
	<td valign=top colspan=2>
	<h3>License which expired or expire within 1 year</h3>
	<table width=850  cellpadding=8 class="renew">
		<tr class=head>
			<td>Company ID</td>
			<td>Company Name</td>
			<td>Email</td>
			<td>In Charge Person</td>
			<td>Expire</td>
			<td>Agent</td>
			<td>Action</td>
			</tr>
	<!--------------------Inner table 2----------------------->
	<?php
		date_default_timezone_set ("Singapore"); 
		$ldate=date("Y-m-d", time());
		
		$date2 = strtotime(date("Y-m-d", strtotime($ldate)) . " +365 days");
		echo $true=date("Y-m-d", $date2);
		
		$query=mysql_query("select * from company where sorttime < '$true' and agentID='$user'");
		while($display=mysql_fetch_array($query)){
			
			$id = $display['id'];
			$name = $display['cName'];
			$email = $display['email'];
			$person = $display['cPerson'];
			$expire = $display['expireDate'];
			$agent = $display['agentID'];
		
			echo "<tr>";
			echo "<td>$id</td>";
			echo "<td>$name</td>";
			echo "<td>$email</td>";
			echo "<td>$person</td>";
			echo "<td>$expire</td>";
			echo "<td>$agent</td>";
			echo "<td><a href='updateRenewal.php?id=$id'>update</a></td>";
			echo "</tr>";
		
		}
		echo "</table>";
	
	
	?>
	
	
	
	</td>
	</tr>
</table>
<!-----------------------End outer table-------------------------->
</div>


</body>
</html>