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



date_default_timezone_set('Africa/Gaborone');
$entry_date = date("Y-m-d H:i:s", time()); 

$design_no = $_GET['design_no'];
$packaging_design = $_GET['packaging_design'];
$store_item_id = $_GET['store_item_id_select'];
$qty = $_GET['qty_text'];
$used_for = $_GET['used_for_group'];


$table_name = $_SESSION['db_prefix']."_packaging_design_lines";
$add_query = "INSERT INTO $table_name (design_no, store_item_id, quantity, packaging_design, used_for) VALUES ('".$design_no."', '".$store_item_id."', '".$qty."', '".$packaging_design."', '".$used_for."') ";
$add_result = $con->query($add_query);

$table_name = $_SESSION['db_prefix']."_tracking_production";
$tracking_query = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entry_date."' ,'".$_SESSION['username']."', '81', '".$design_no."' , '".$store_item_id."','','".$qty."' )";
$tracking_result = $con->query($tracking_query);


?>


<script language="javascript" type="text/javascript">
         window.location="../production/packaging_design_edit.php?design_no=<?php echo $design_no ?>";
</script>