<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/function_lib.php');
include('includes/SQL_CommonFunctions.inc');
global $db;
if(isset($_REQUEST['j'])){
$j=$_REQUEST['j'];
$rno=$_REQUEST['rno'];
for($i=$j;$i<($rno+$j);$i++){
?>
<tr>
	<td class="tabledata"><?php echo $i+1;?></td>
	<td class="tabledata"><input type="text" name="package_no[<?php echo $i;?>]" id="package_no_<?php echo $i;?>" /></td>
	<td class="tabledata"><input type="text" name="no_of_package[<?php echo $i;?>]" id="no_of_package_<?php echo $i;?>"></td>
	<td class="tabledata"><input type="text" name="content[<?php echo $i;?>]" id="content_<?php echo $i;?>"></td>
	<td class="tabledata">
		<select name="layout[<?php echo $i;?>]" id="layout_<?php echo $i;?>" >
			<option value="0">Select</option>
			<?php 
			$sql1=DB_query("select * from log_floor where CompanyId='".$_SESSION['ACGCompanyId']."' AND store='".$_REQUEST['store']."'",$db);
			while($sql_floor=DB_fetch_array($sql1))
			{
			?> 
			<option value="<?php echo  $sql_floor['id'];?>"><?php echo $sql_floor['floor_name']; ?></option>
			<?php } ?>
		</select>
	</td>
	<td class="tabledata">
		<select name="itemid[<?php echo $i;?>]" id="itemid_<?php echo $i;?>" >
			<option value="0">Select</option>
			<?php 
			$sql2=DB_query("select * from item_master where CompanyId='".$_SESSION['ACGCompanyId']."' AND orig_local='".$_REQUEST['store']."'",$db);
			while($sql_floor2=DB_fetch_array($sql2))
			{
			?> 
			<option value="<?php echo  $sql_floor2['id'];?>"><?php echo $sql_floor2['item_name']." -- ".$sql_floor2['StockID']; ?></option>
			<?php } ?>
		</select>
	</td>
</tr>
<?php }
}else{ 
$rno=$_REQUEST['rno'];
for($i=0;$i<$rno;$i++){
?>
<tr>
	<td class="tabledata"><?php echo $i+1;?></td>
	<td class="tabledata"><input type="text" name="package_no[<?php echo $i;?>]" id="package_no_<?php echo $i;?>" /></td>
	<td class="tabledata"><input type="text" name="no_of_package[<?php echo $i;?>]" id="no_of_package_<?php echo $i;?>"></td>
	<td class="tabledata"><input type="text" name="content[<?php echo $i;?>]" id="content_<?php echo $i;?>"></td>
	<td class="tabledata">
		<select name="layout[<?php echo $i;?>]" id="layout_<?php echo $i;?>" >
			<option value="0">Select</option>
			<?php 
			$sql1=DB_query("select * from log_floor where CompanyId='".$_SESSION['ACGCompanyId']."' AND store='".$_REQUEST['store']."'",$db);
			while($sql_floor=DB_fetch_array($sql1))
			{
			?> 
			<option value="<?php echo  $sql_floor['id'];?>"><?php echo $sql_floor['floor_name']; ?></option>
			<?php } ?>
		</select>
	</td>
	<td class="tabledata">
		<select name="itemid[<?php echo $i;?>]" id="itemid_<?php echo $i;?>" >
			<option value="0">Select</option>
			<?php 
			$sql2=DB_query("select * from item_master where CompanyId='".$_SESSION['ACGCompanyId']."' AND orig_local='".$_REQUEST['store']."'",$db);
			while($sql_floor2=DB_fetch_array($sql2))
			{
			?> 
			<option value="<?php echo  $sql_floor2['id'];?>"><?php echo $sql_floor2['item_name']." -- ".$sql_floor2['StockID']; ?></option>
			<?php } ?>
		</select>
	</td>
</tr>
<?php } }?>
