<?php
include('../include/session.php');

$table_name = $_SESSION['db_prefix']."_receive_store_lines_temp";
$delete_query = "DELETE FROM $table_name WHERE  user_name = '".$_SESSION['username']."'   "; 
execsql($delete_query);

$line_num = $_GET['line_num'];
$i=0;
while ($i<$line_num) {
if (isset($_GET['line_checkbox'.$i])) {
$store_item_id = $_GET['store_item_id_select'.$i];	
$quantity = $_GET['quantity_text'.$i];
$price = $_GET['amount_text'.$i];

if(isset($_GET['line_checkbox'.$i]) ) {
$table_name = $_SESSION['db_prefix']."_receive_store_lines_temp";
$receive_query = "INSERT INTO $table_name ( store_item_id, quantity,  price, user_name) VALUES ('".$store_item_id."','".$quantity."', '".$price."', '".$_SESSION['username']."' ) ";
execsql($receive_query);
}
};
$i++;
}
?>

<script language="javascript" type="text/javascript">
      window.location="receivingWizbase.php?p=2&s=";
</script>

