<html>
<head>
<title>
Parent Window
</title>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="550"> <tr>
<form method="post" name="form" action="addrinv.php">
<td><font size="2" face="Verdana">ISBN</font>
<input type="text" name="ISBN" size="20" value='Select a book' onchange="this.form.submit()">

<a href="JavaScript:void(0);" NAME="My Window Name" title="My title here"
onclick="window.open('child.php')";>Select Item</a>
<input type='submit' name='Submit' value='Submit'> 
</form>
</td></tr> </table>

<?php
include("connect.php");
$query = "SELECT * FROM receivedinvitem";
$result = $db->query($query);

$num_results = $result->num_rows;

echo "<p>Number of Book(s) : ".$num_results."</p>";

echo "<form method='post' action='updatestock.php'>";
echo "<table border='1' cellspacing='0' cellpadding='5' bordercolor='white' width='60%' align=''>";
echo "<tr bgcolor='black' style='color:white'>";
echo "<td width='10%'>num</td>";
echo "<td width='50%'>ISBN</td>";
echo "<td width='40%'>Quantity</td>";
echo "</tr>";

for ($i=0; $i <$num_results; $i++)
{
	$row = $result->fetch_array();
	echo "<tr>";
	echo "<td>".($i+1)."</td>";
	echo "<td><input type='hidden' name='ISBN' value='$row[ISBN]'>".$row['ISBN']."</td>";
	echo "<td><input type='text' name='quantity'></td>";
	echo "</tr>";
}
echo "<tr>";
echo "<td colspan='3'><center><input type='hidden' name='counter' value='$i'><input type='submit' name='Submit' value='Submit'></center></td>";
echo "</tr>";
echo "</table>";
echo "</form>";

?>
</body>
</html>