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

$table_name = $_SESSION['db_prefix']."_employee_issue";
$issue_query = "SELECT emp_id, store_item_id, quantity, cost, receive_date FROM $table_name ";
$issue_result = mySQL_query($issue_query);
$issue_num = mysql_num_rows($issue_result);

echo '<br>*****'.$issue_num;

$i=0;
while ($i<$issue_num) {
	
$emp_id = mysql_result($issue_result, $i, "emp_id");
$store_item_id = mysql_result($issue_result, $i, "store_item_id");
$quantity = mysql_result($issue_result, $i, "quantity");
$cost = mysql_result($issue_result, $i, "cost");
$receive_date = mysql_result($issue_result, $i, "receive_date");

$table_name = $_SESSION['db_prefix']."_employee_supply_lines";
$supply_query = "INSERT INTO $table_name (emp_id, store_item_id, quantity, price, issue_date ) VALUES ('".$emp_id."', '".$store_item_id."', '".$quantity."', '".$cost."', '".$receive_date."') ";
echo '<br>*****'.$supply_query;
execsql($supply_query);

$i++;
}

?>