<?php
include('../include/session.php');
date_default_timezone_set('Africa/Gaborone');
$entry_date = date("Y-m-d H:i:s", time()); 

$production_no =$_GET['production_no_text'];
$mix_design_name =$_GET['mix_design_name_text'];
$count =$_GET['counted_text'];
$count_date =$_GET['count_date'];
$final =$_GET['final_group'];


$table_name = $_SESSION['db_prefix']."_production_plan";
$update_query = "UPDATE $table_name SET produced_dry = '".$final."' WHERE production_no = '".$production_no."' ";
execsql($update_query);


$table_name = $_SESSION['db_prefix']."_production_plan_lines";
$production_query = "INSERT INTO $table_name (production_no, mix_design_name, action, action_date, quantity) VALUES ('".$production_no."', '".$mix_design_name."', 'dry_count', '".$count_date."', '".$count."' ) ";
execsql($production_query);

$table_name = $_SESSION['db_prefix']."_tracking_production";
$trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entry_date."' , '".$_SESSION['username']."', '62', '".$count_date."' ,'".$production_no."','','".$count."' )";
$trackingResult = mySQL_query($trackingQuery);	

?>

<script language="javascript" type="text/javascript">
           window.location="production_main.php";
</script>

