<?php
include("../../session.php");
include("../../connect.php");

$user=$_SESSION['admin'];

?>
<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>
<div id="content2">
<!-----------------Outer table--------------->
<table width=1000 border=0 cellspacing=10 cellpadding=3 class=outer >
<tr>
	<td colspan=2 >
	<?php include("../head.php");?>
	</td>
	</tr>
<tr>
	<td colspan=2>
			<div class=main>&nbsp;&nbsp;>>
			<a href="<?php echo"../admin.php";?>">&nbsp;Home&nbsp;</a>>>
			<a href="<?php echo"price.php";?>">&nbsp;Licensing Rate&nbsp;</a>>>
			&nbsp;History Rate&nbsp;
			</div></td>
	</tr>
<tr>
	<td width=200 valign=top >
	<table width=100% cellpadding=8 cellspacing=3 border=1>
	<tr>
		<td align=center><a href="<?php echo "price.php";?>">New Rate</a></td>
		</tr>
	<tr>
		<td align=center><a href="<?php echo "historyRate.php";?>">History Rate</a></td>
		</tr>
	</table>
	</td>
	<td valign=top>
	<!--------------------Inner table 2----------------------->
	<?php
//set pages per items
	$per_page = 10;
	
	$query1=mysql_query("SELECT * from price");

	$total=ceil(mysql_num_rows($query1)/$per_page);

	$page =(isset($_GET['page'])) ? (int) $_GET['page'] :1;
	$start=($page-1)*$per_page;
	

//display pages
echo "<table align=center width='80%'>";
echo "<tr class=page><td width='10%'>Pages >></td><td>";
	while($i<=$total){
		echo "<a href='historyRate.php?page=$i' align=center>$i</a>&nbsp ";
		$i++;
	}
echo "</td></tr>";
echo "</table>";
echo "<br/>";
?>	
	<table width=700 align=left cellpadding=8 cellspacing=3 border=1>
		<tr>
			<th>ID</th><th>time</th><th>Rate</th>
			</tr>
		<?php 
			$query=mysql_query("select * from price order by id desc");
			while($display=mysql_fetch_array($query)){
				$id=$display['id'];
				$price=$display['price'];
				$date=$display['date'];
				$time=$display['time'];
				
			echo "<tr>";
			echo "<td align=center>$id</td>";
			echo "<td align=center>$date&nbsp;&nbsp;&nbsp;$time</td>";
			echo "<td align=center>$price</td>";
			echo "</tr>";
			
			}
		echo "</table>";
		
		?>	
		</td>
		</tr>
	</table>
	<!----------------------End inner table 2-------------------->
	
	</td>
	</tr>
</table>
<!-----------------------End outer table-------------------------->
</div>

</body>
</html>