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

  $select_file= "../upload/".$_SESSION['file_name'];
  
  $file_handle = fopen($select_file, "r");
  
  while (!feof($file_handle) ) {
    
  $line_of_text = fgetcsv($file_handle, 1024);	  
  $b0 = $line_of_text[0] ; //Job No
  $b1 = $line_of_text[1] ; //Truss Ref
  $b2 = $line_of_text[2] ; //Span mm
  $b3 = $line_of_text[3] ; //Joints
  $b4 = $line_of_text[4] ; //Qty

if ($b0!='') {  
if ($b0!='Job No') {
$table_name = $_SESSION['db_prefix']."_trusses_temp";
$truss_query = "INSERT INTO $table_name (job_no, truss_type, span, press_points, qty, select_it, user ) VALUES ('".$_SESSION['job_no']."',  '".$b1."', '".$b2."', '".$b3."', '".$b4."', 'yes', '".$_SESSION['username']."') ";
execsql($truss_query);
}
}
}

fclose($file_handle);


$_SESSION['page_view']=5;
?>

<script language="javascript" type="text/javascript">
        <!--
		  window.location="../production/trussesJobWizbase.php?p=2&s=&m=2";
        -->
       </script>