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

$ISBN = $_GET["ISBN"];

$result = mysql_query("SELECT * FROM item WHERE ISBN = '$ISBN'");

$row = mysql_fetch_array($result);

echo "<div id='mainpage'>";
echo "<center>";
echo "<h2>Stock Detail</h2>";
echo "</div>";

echo "<div id='bookmenu'>";
echo "<table border='0' cellspacing='2' cellpadding='1' bordercolor='black' width='80%'>";

	echo "<tr>";
	echo "<td colspan='3'></td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<th colspan='3'>".$row["itemName"]."</th>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<td rowspan='9' weight='20%' align='center'>";
	echo "<img src=/bookstore/bookstaff/".$row[itemImage]." height='200' weight='200' style='margin:10 10 10 10'>";
	echo "</td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<th width='15%'>ISBN:</th>";
	echo "<td width='65%'>".$row["ISBN"]."</td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<th>Author:</th>";
	echo "<td>".$row["itemAuthor"]."</td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<th>Publisher:</th>";
	echo "<td>".$row["itemPublisher"]."</td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<th>Issue Date:</th>";
	echo "<td>".$row["itemDate"]."</td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<th>Category:</th>";
	echo "<td>".$row["itemCategory"]."</td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<th>Price:</th>";
	echo "<td>RM";
	printf("%10.2f",$row["itemPrice"]);
	echo "</td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<th>Available:</th>";
	echo "<td>".$row["itemQuantity"]."</td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<th>Mininum Quantity:</th>";
	echo "<td>".$row["itemMin"]."</td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<td align='center'><br/>";
	echo "<th>Available:</th>";
	echo "<td>".$row["itemLocation"]."</td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<td colspan='3'></td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<th colspan='3' style='font-size:15pt'><b>Summary:</b></th>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<td colspan='3'>".$row["itemSummary"]."</td>";
	echo "</tr>";
echo "</table>";

echo "</div>";
echo "</center>";

$db = mysql_close();

?>