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

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


$line_num2 = $_GET['line_num2'];
$i=0;
while ($i<$line_num2) {
if (isset($_GET['line_checkbox2'.$i])) {
$item_name = $_GET['item_text2'.$i];
$order2 = $_GET['order_select2'.$i];	
$quantity2 = $_GET['quantity_text2'.$i];
$price2 = $_GET['amount_text2'.$i];

if(isset($_GET['line_checkbox2'.$i]) ) {
$table_name = $_SESSION['db_prefix']."_special_orders";
$special_query = "INSERT INTO $table_name (job_card_no, special_name, date_ordered, quantity_ordered, price_ordered) VALUES ('".$order2."', '".$item_name."', '".$entry_date."', '".$quantity2."', '".$price2."' ) ";
execsql($special_query);
}
};
$i++;
}


//$table_name = $_SESSION['db_prefix']."_tracking_transport";
//   $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entry_date."' ,'".$_SESSION['username']."', '44', '".$vehicle_id."' ,'".$admin_type."','','".$mileage."' )";
//   $trackingResult = mySQL_query($trackingQuery);



//if (isset($_GET['save_close_button']) )
//	   { ?>
//       <script>
//	 		 window.location="../store/store_main.php?date=0";
//		</script>
//        <?php		 
//	   }
//	   
//	if (isset($_GET['save_button']) )
//	   {  ?>
       <script>
	        window.location="special_order_list.php?date=0"
	   </script>
 //       <?php		 
//	   }
//	   ?>
