<head>

<?php
include ("../navigation/header.php");
$page_name = "Sales-main";
include ("../navigation/access.php");

if ($permission_num==1) {
	include ("../navigation/production_sidebar.php");

$job_no = $_GET['job_no'];
$quote='no';
$table_name = $_SESSION['db_prefix']."_captured_jobs";
$job_query = "SELECT * FROM $table_name WHERE job_no = '".$job_no."' ";
$job_result = mySQL_query($job_query);
$cust_id = mysql_result($job_result, 0, "cust_id");	

$table_name2 = $_SESSION['db_prefix']."_customer";
		$customer_query = "SELECT * FROM $table_name2 WHERE cust_id ='".$cust_id."' ";
		$customer_result = mySQL_query($customer_query);
		$customer_num = mysql_num_rows($customer_result);	
		$a1 = mysql_result($customer_result, 0, "account_type");
			if ($a1=="corporate") { 
				$name = mysql_result($customer_result, 0, "comp_name"); 
			} 
			else {
				$name = mysql_result($customer_result, 0, "title")." ".mysql_result($customer_result, 0, "name_2")." ".mysql_result($customer_result, 0, "comp_name");
 			}

$table_name = $_SESSION['db_prefix']."_cutting_bill";
$cutting_query = "SELECT * FROM $table_name WHERE job_no = '".$job_no."' ";
$cutting_result = mySQL_query($cutting_query);
$cutting_num = mysql_num_rows($cutting_result);
if ($cutting_num!=0) {
		$bill_id = mysql_result($cutting_result, 0, "bill_id");
}
else {
	$bill_id='';
}

$table_name = $_SESSION['db_prefix']."_cutting_bill_lines";
$truss_query = "SELECT * FROM $table_name WHERE type = 'Truss' AND job_no = '".$job_no."' ";
$truss_result = mySQL_query($truss_query);
$truss_num = mysql_num_rows($truss_result);
if ($truss_num==0) {
$table_name = $_SESSION['db_prefix']."_cutting_bill_lines_done";
$truss_query = "SELECT * FROM $table_name WHERE type = 'Truss' AND job_no = '".$job_no."' ";
$truss_result = mySQL_query($truss_query);
$truss_num = mysql_num_rows($truss_result);
}

$table_name = $_SESSION['db_prefix']."_cutting_bill_lines";
$check_query = "SELECT job_no FROM $table_name WHERE job_no = '".$job_no."' AND store_item_id IS NOT NULL ";
$check_result = mySQL_query($check_query);
$check_num = mysql_num_rows($check_result);
if ($check_num!=0) {
  $table_name = $_SESSION['db_prefix']."_cutting_bill_lines";
  $table_heading = "Materials to be used";
}
else {
	$table_name = $_SESSION['db_prefix']."_cutting_bill_lines_done";
	$table_heading = "Materials used";
}
$truss_supply_query = "SELECT store_item_id, SUM(quantity) AS summed_quantity, price FROM $table_name WHERE job_no = '".$job_no."' AND store_item_id IS NOT NULL GROUP BY store_item_id ORDER BY type DESC";
$truss_supply_result = mySQL_query($truss_supply_query);
$truss_supply_num = mysql_num_rows($truss_supply_result);

$table_name = $_SESSION['db_prefix']."_captured_timber";
$timber_query = "SELECT * FROM $table_name WHERE cap_timber_group = 'Trusses' AND cap_job = '".$job_no."' AND cap_class = 'S5'  ";
$timber_result = mySQL_query($timber_query);
$timber_num = mysql_num_rows($timber_result);

$table_name = $_SESSION['db_prefix']."_captured_timber";
$timber2_query = "SELECT * FROM $table_name WHERE cap_timber_group = 'Trusses' and cap_job = '".$job_no."' AND cap_class = 'S7' ";
$timber2_result = mySQL_query($timber2_query);
$timber2_num = mysql_num_rows($timber2_result);



$table_name3 = $_SESSION['db_prefix']."_captured_mitek";
$check_query = "SELECT cap_job FROM $table_name WHERE cap_job = '".$job_no."' ";
$check_result = mySQL_query($check_query);
$check_num = mysql_num_rows($check_result);
if ($check_num!=0) {
  $table_name = $_SESSION['db_prefix']."_captured_mitek";
}
else {
	$table_name = $_SESSION['db_prefix']."_captured_mitek_done";
}
$mitek_query = "SELECT * FROM $table_name WHERE cap_job = '".$job_no."'";
$mitek_result = mySQL_query($mitek_query);
$mitek_num = mysql_num_rows($mitek_result);


$table_name4 = $_SESSION['db_prefix']."_captured_sundries";
$check_query = "SELECT cap_job FROM $table_name4 WHERE cap_job = '".$job_no."' ";
$check_result = mySQL_query($check_query);
$check_num = mysql_num_rows($check_result);
if ($check_num!=0) {
  $table_name4 = $_SESSION['db_prefix']."_captured_sundries";
}
else {
	$table_name4 = $_SESSION['db_prefix']."_captured_sundries_done";
}
$sundries_query = "SELECT * FROM $table_name4 WHERE cap_job = '".$job_no."'";
$sundries_result = mySQL_query($sundries_query);
$sundries_num = mysql_num_rows($sundries_result);

$table_name = $_SESSION['db_prefix']."_captured_timber";
$check_query = "SELECT cap_job FROM $table_name WHERE cap_job = '".$job_no."' AND cap_timber_group = 'Bracing'  ";
$check_result = mySQL_query($check_query);
$check_num = mysql_num_rows($check_result);
if ($check_num!=0) {
  $table_name4 = $_SESSION['db_prefix']."_captured_timber";
}
else {
	$table_name4 = $_SESSION['db_prefix']."_captured_timber_done";
}
$bracing_query = "SELECT cap_job, cap_timber_name, cap_timber_group, cap_timber_length, auth_timber_length, delivered  FROM $table_name4 WHERE cap_job = '".$job_no."' AND cap_timber_group = 'bracing'  ";
$bracing_result = mySQL_query($bracing_query);
$bracing_num = mysql_num_rows($bracing_result);



$table_name = $_SESSION['db_prefix']."_captured_timber";
$check_query = "SELECT cap_job FROM $table_name WHERE cap_job = '".$job_no."' AND cap_timber_group = 'Sundries'  ";
$check_result = mySQL_query($check_query);
$check_num = mysql_num_rows($check_result);
if ($check_num!=0) {
  $table_name4 = $_SESSION['db_prefix']."_captured_timber";
}
else {
	$table_name4 = $_SESSION['db_prefix']."_captured_timber_done";
}
$sundries_timber_query = "SELECT cap_job, cap_timber_name, cap_timber_group, cap_timber_length, auth_timber_length, delivered FROM $table_name4 WHERE cap_job = '".$job_no."' AND cap_timber_group = 'Sundries'  ";
$sundries_timber_result = mySQL_query($sundries_timber_query);
$sundries_timber_num = mysql_num_rows($sundries_timber_result);


$table_name6 = $_SESSION['db_prefix']."_variations";
$extra_query = "SELECT * FROM $table_name6 WHERE job_no = '".$job_no."' ";
$extra_result = mySQL_query($extra_query);
$extra_num = mysql_num_rows($extra_result);

$table_name8 = $_SESSION['db_prefix']."_supply_customer";
$deliveries_query = "SELECT delivery_note, supply_id, type, job_no,cust_id, delivery_date FROM $table_name8 WHERE job_no = '".$job_no."' ";
$deliveries_result = mySQL_query($deliveries_query);
$deliveries_num = mysql_num_rows($deliveries_result);
?>

<!--style sheets-->
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />

<!--jscript-->
<script type="text/javascript" src="../jscript/tablesort.js"></script>
<script language="JavaScript" src="../jscript/tooltip.js"  type="text/javascript"></script> 

</head>
<body>

<div class="main_frame" style="height:auto;">
  <table id="tableMain" > <!--begin of tableMain-->
    <tr>
      <td width="830" height="62" valign="top" ><div class="page_head_frame">
        
        <table width="809" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="472"><label class="label_page_head">Job progress:</label>
              &nbsp;&nbsp;&nbsp;<label class="label_page_head_2">&nbsp;&nbsp;&nbsp; <?php echo $name ?></label></td>
            <td width="208"><label style="font-size:24px; color:#FB6808;"><?php echo "J".$job_no ?></label></td>
            </tr>
        </table>
      </div>
        <br />

<br /></td> <!--center of tableMain-->
</tr>
<tr>
<td height="93"> <!--center of tableMain-->
<div class="page_middle_frame">
<?php 
		include ('../include/customer_block.php');
		echo '<br>';
		include ('../include/job_block.php')
		?>
</div>
  
</td>
</tr>
<tr>
<td>
<div class="page_middle_frame">
<div align="left">
  <label class="label_std">Trusses:</label>
</div>
  <table width="676" id="table_details_display">
   <thead>
   <tr>
     <th>Truss type	</th>
     <th>FT</th>
     <th colspan="2" align="center">Quantity</th>
     <th colspan="2" align="center">Produced</th>
     <th width="74" align="center">Delivered</th>
     <th width="72" align="center">Balance</th>
  </tr>
  <tr>
     <th>&nbsp;</th>
     <th>&nbsp;</th>
     <th width="72" align="center">Truss</th>
     <th width="101" align="center">FT</th>
     <th width="123" align="center">Truss</th>
     <th width="123" align="center">FT</th>
     <th width="74" align="center">&nbsp;</th>
     <th width="72" align="center">&nbsp;</th>
  </tr>
  </thead>
    <?php 
	$a2_tot = 0;
	$a3_tot = 0;
	$a4_tot = 0;
	$a5_tot = 0;
	$a8_tot = 0;
	$a9_tot = 0;
	
	if ($truss_num!=0) {
	$i=0;
	while ($i<$truss_num) {
		$a1 = mysql_result($truss_result, $i, "truss_type");
		$a2 = mysql_result($truss_result, $i, "quantity");
		$a7 = mysql_result($truss_result, $i, "press_points");
		$a8 = $a2*$a7;	
		$table_name = $_SESSION['db_prefix']."_production_bill_lines";
		$produce_query = "SELECT SUM(quantity) AS summed_quantity, SUM(delivered) AS summed_delivered FROM $table_name WHERE job_no = '".$job_no."' AND truss_type = '".$a1."' GROUP BY job_no ";
		$produce_result = mySQL_query($produce_query);
		$produce_num = mysql_num_rows($produce_result);
		if ($produce_num != 0) {
				$a3 = mysql_result($produce_result, 0, "summed_quantity");
				$a4 = mysql_result($produce_result, 0, "summed_delivered");
				$a5 = $a2 - $a4;
				$a9 = $a3*$a7;	
				$a9_tot = $a9_tot + $a9;
		}
		else {
			$a3='';
			$a4='';
			$a5='';
			$a9='';
			
		}
		$a2_tot = $a2_tot + $a2;
		$a8_tot = $a8_tot + $a8;
		$a3_tot = $a3_tot + $a3;
		
		$a4_tot = $a4_tot + $a4;
		$a5_tot = $a5_tot + $a5;
		
	?>
     <tr>
      <td width="91" align="left" valign="top"><?php echo $a1 ?></td>
      <td width="93" align="left" valign="top"><?php  echo $a7 ?></td>
      <td align="center" valign="top"><?php echo $a2 ?></td>
      <td align="center" valign="top"><?php echo $a8 ?></td>
      <td align="center" valign="top"><?php echo $a3 ?></td>
      <td align="center" valign="top"><?php echo $a9 ?></td>
      <td align="center" valign="top"><?php echo $a4 ?></td>
      <td align="center" valign="top"><?php echo $a5 ?></td>
    </tr>
    
    <?php
	$i++;
	}
	?>
    <tfoot>
      <tr style="border-top:double;">
      <td colspan="2" align="right" valign="top">Totals:&nbsp;</td>
      <td align="center" valign="top"><?php echo $a2_tot ?></td>
      <td align="center" valign="top"><?php echo $a8_tot ?></td>
      <td align="center" valign="top"><?php echo $a3_tot ?></td>
      <td align="center" valign="top"><?php echo $a9_tot ?></td>
      <td align="center" valign="top"><?php echo $a4_tot ?></td>
      <td align="center" valign="top"><?php echo $a5_tot ?></td>
    </tr>
    </tfoot>
    <?php
    }
    else {
    ?>
    <tr>
    <td colspan="6">
      <label class="label_std">Cutting bill not yet made.</label>
        <label class="label_std">&nbsp;</label>
      <label class="label_std">&nbsp;</label>
    </td>
    <td>
      <label class="label_std">&nbsp;</label>
    </td>
    <td>
    <label class="label_std">&nbsp;</label>
    </td>
    </tr>
    <?php
	}
	?>
  </table><br>
<br>

  <table width="676" id="table_details_display">
    <tr>
      <th width="294"><?php echo $table_heading ?></th>
      <th width="93">Quantity</th>
      <th width="83">Meters/Area</th>
      <th width="83">&nbsp;</th>
      <th width="81">&nbsp;</th>
      <?php 
	$i=0;
	$a4='0.00';
	while ($i<$truss_supply_num) {
		$a1 = mysql_result($truss_supply_result, $i, "store_item_id");
				$table_name = $_SESSION['db_prefix']."_store_items";
				$name_query = "SELECT item_name, class, length, area FROM $table_name WHERE store_item_id = '".$a1."'  ";
				$name_result = mySQL_query($name_query);
				$a1a = mysql_result($name_result, 0, "item_name");
				$a3 = mysql_result($name_result, 0, "length");
				$a4 = mysql_result($name_result, 0, "area");
				$a5 = mysql_result($name_result, 0, "class");
		
		$a6='';				
		$a2 = mysql_result($truss_supply_result, $i, "summed_quantity");
		if (($a5=='S5') OR ($a5=='S7')) {
			$a6 = number_format(($a2*$a3)/1000, 2, '.', ',');
		}
		
		if ($a5=='Plate') {
			$a6 = $a2*$a4;
		}
		
		
	?>
    </tr>
    <tr>
      <td align="left" valign="top"><?php echo $a1a ?></td>
      <td align="center" valign="top"><?php echo $a2 ?></td>
      <td align="right" valign="top"><?php echo $a6 ?>&nbsp;</td>
      <td align="right" valign="top">&nbsp;</td>
      <td align="left" valign="top">&nbsp;</td>
    </tr>
    <?php
	$i++;
	}
	?>
  </table>
  <p>&nbsp;</p>
</div></td>
</tr>
<tr>
<td height="220">
<div class="page_middle_frame">
<table width="676"  border='0'>
  <tr>
      <td width="269">&nbsp;</td>
      <td width="26" align="center">&nbsp;</td>
      <td width="86" align="center">&nbsp;</td>
      <td width="86" align="center">&nbsp;</td>
      <td width="86" align="center">&nbsp;</td>
      <td width="97" align="center">&nbsp;</td>
    </tr>
    </table>
<div align="left"></div>
  <table width="676" id="table_details_display">
  <tr>
      <th><label class="label_std">item</label></th>
      <th align="center"><label class="label_std">unit</label></th>
      <th align="center"><label class="label_std">captured</label></th>
      <th align="center"><label class="label_std">authorised</label></th>
      <th align="center"><label class="label_std">delivered</label></th>
      <th align="center"><label class="label_std">balance</label></th>
    </tr>
    <tr  style="background-color:#F0F0F0;">
      <th height="22" align="left">eCo products</th>
      <th align="center">&nbsp;</th>
      <th align="center">&nbsp;</th>
      <th align="center">&nbsp;</th>
      <th align="center">&nbsp;</th>
      <th align="center">&nbsp;</th>
    </tr>
    <?php 
	$i=0;
	while ($i<$mitek_num) {
		$cap_item_id = mysql_result($mitek_result, $i, "cap_item_id");
			$table_name4 = $_SESSION['db_prefix']."_store_items";
			$item_query = "SELECT item_name, unit FROM $table_name4 WHERE store_item_id = '".$cap_item_id."' ";
			$item_result = mySQL_query($item_query);
			$item_name = mysql_result($item_result, 0, "item_name");
			$unit = mysql_result($item_result, 0, "unit");
		$cap_quantity = mysql_result($mitek_result, $i, "cap_quantity");
		$auth_quantity = mysql_result($mitek_result, $i, "auth_quantity");
		$delivered = mysql_result($mitek_result, $i, "delivered");
		$balance = $auth_quantity - $delivered;
	?>
	
    
    
    <tr>
      <td width="248"><?php echo $item_name ?>
      </td>
      <td width="42" align="center"><?php  echo $unit ?></td>
      <td width="88" align="center"><?php if ($cap_quantity!=0) { echo $cap_quantity ;}?></td>
      <td width="85" align="center"><?php if ($auth_quantity!=0) { echo $auth_quantity ;}?></td>
      <td width="85" align="center"><?php if ($delivered!=0) { echo $delivered;} ?></td>
      <td width="82" align="center"><?php  $balance ?></td>
      </tr>
    <?php
	$i++;
	}
	?>
    </table>
    </div>
<div class="page_middle_frame">
  <table width="676" align="left" id="table_details_display" >
    <tr>
      <td colspan="6" align="left" valign="top"><label class="label_std">Bracing timber:</label></td>
    </tr>
    <?php 
				  $k=0;
				  while ($k<$bracing_num) { 
					    $c1 = mysql_result($bracing_result, $k, "cap_timber_group");
						$c2 = mysql_result($bracing_result, $k, "cap_timber_name");
						$c3 = mysql_result($bracing_result, $k, "cap_timber_length"); 
						$c4 = mysql_result($bracing_result, $k, "auth_timber_length"); 
						$c5 = mysql_result($bracing_result, $k, "delivered");   
						$c6 = $c4-$c5;
				 ?>
    <tr>
      <td width="249"><?php echo $c2 ?></td>
      <td width="41">m</td>
      <td width="86" align="right"><?php echo number_format($c3, 2, '.', ',')?>&nbsp;</td>
      <td width="86" align="right"><?php echo number_format($c4, 2, '.', ',') ?>&nbsp;</td>
      <td width="86" align="right"><?php echo number_format($c5, 2, '.', ',') ?>&nbsp;</td>
      <td width="82" align="right"><?php echo number_format($c6, 2, '.', ',') ?>&nbsp;</td>
    </tr>
    <?php
			  $k++;
             }
             ?>
  </table>
  
</div>
<div class="page_middle_frame">
  <table width="676" align="left" id="table_details_display" >
    <tr>
      <td colspan="6" align="left" valign="top"><label class="label_std">Sundry timber:</label></td>
    </tr>
    <?php 
				  $k=0;
				  while ($k<$sundries_timber_num) { 
					    $c1 = mysql_result($sundries_timber_result, $k, "cap_timber_group");
						$c2 = mysql_result($sundries_timber_result, $k, "cap_timber_name");
						$c3 = mysql_result($sundries_timber_result, $k, "cap_timber_length");  
						$c4 = mysql_result($sundries_timber_result, $k, "auth_timber_length"); 
						$c5 = mysql_result($sundries_timber_result, $k, "delivered");   
						$c6 = $c4-$c5;
				 ?>
    <tr>
      <td width="249"><?php echo $c2 ?></td>
      <td width="41">m</td>
      <td width="86" align="right"><?php echo number_format($c3, 2, '.', ',')?>&nbsp;</td>
      <td width="86" align="right"><?php echo number_format($c4, 2, '.', ',') ?>&nbsp;</td>
      <td width="86" align="right"><?php echo number_format($c5, 2, '.', ',') ?>&nbsp;</td>
      <td width="82" align="right"><?php echo number_format($c6, 2, '.', ',') ?>&nbsp;</td>
    </tr>
    <?php
			  $k++;
             }
             ?>
  </table>
  
</div>
<div class="page_middle_frame">
  <div align="left">
  <label class="label_std">Additional sundries</label>
</div>
  <table width="676" id="table_details_display">
   
             <?php 
				  $m=0;
				   while ($m<$sundries_num) { 
					    $_SESSION['additional_item_id'.$m] = mysql_result($sundries_result, $m, "cap_item_id");
						$table_name = $_SESSION['db_prefix']."_store_items";
							$name_query = "SELECT item_name, unit FROM $table_name WHERE store_item_id = '".$_SESSION['additional_item_id'.$m]."' ";
							$name_result = mySQL_query($name_query);
							$name_num = mysql_num_rows($name_result);
							if ($name_num!=0) {
							$item_name = mysql_result($name_result, 0, "item_name");
							$unit = mysql_result($name_result, 0, "unit"); 
							}
						$additional_quantity = mysql_result($sundries_result, $m, "cap_quantity");
						$auth_additional_quantity = mysql_result($sundries_result, $m, "auth_quantity");
						$delivered = mysql_result($sundries_result, $m, "delivered");
						$balance = $auth_additional_quantity - $delivered;
				 ?>
             <tr>
               <td width="268"><?php echo $item_name ?>
               <input type="hidden" name="additional_item_id_<?php echo $m?>" id="additional_item_id_<?php echo $m?>" value="<?php echo $_SESSION['additional_item_id'.$m] ?>"></td>
               <td width="41" align="center"><?php echo $unit ?></td>
               <td width="86" align="center" ><?php if ($additional_quantity!=0) { echo $additional_quantity;} ?></td>
               <td width="86" align="center" ><?php if ($auth_additional_quantity!=0) { echo $auth_additional_quantity;}?></td>
               <td width="86" align="center" ><?php if ($delivered!=0) { echo $delivered;} ?></td>
               <td width="81" align="center" ><?php  $balance ?></td>
             </tr>
              <?php
			  $m++;
             }
             ?>
  </table>
</div>
<div class="page_middle_frame">
<div align="left">
  <label class="label_std">Extra supplies </label>
</div>
  <table width="676" id="table_details_display">
   
             <?php 
				  $p=0;
				   while ($p<$extra_num) { 
					    $store_item_id = mysql_result($extra_result, $p, "store_item_id");
						$table_name = $_SESSION['db_prefix']."_store_items";
							$name_query = "SELECT item_name, unit FROM $table_name WHERE store_item_id = '".$store_item_id."' ";
							$name_result = mySQL_query($name_query);
							$name_num = mysql_num_rows($name_result);
							$item_name = mysql_result($name_result, 0, "item_name");
							$unit = mysql_result($name_result, 0, "unit");
						//$auth_quantity = mysql_result($extra_result, $p, "auth_quantity");  
						$extra_quantity = mysql_result($extra_result, $p, "delivered");
				 ?>
             <tr>
               <td width="249"><?php echo $item_name ?></td>
               <td width="41" align="center"><?php echo $unit ?></td>
               <td width="88" align="center">&nbsp;</td>
               <td width="84" align="center" >&nbsp;</td>
               <td width="86" align="center" ><?php echo $extra_quantity ?></td>
               <td width="82" align="center" >&nbsp;</td>
             </tr>
              <?php
			  $p++;
             }
             ?>
  </table>
</div>
<div class="page_middle_frame">
  
  <label class="label_std">Deliveries on this job:</label>
    <?php 
$i=0;
while ($i<$deliveries_num) {
	$note_no = mysql_result($deliveries_result, $i, "delivery_note");
	$supply_id_1 = mysql_result($deliveries_result, $i, "supply_id");
	$type = mysql_result($deliveries_result, $i, "type");
	$job_no = mysql_result($deliveries_result, $i, "job_no");
	$date = mysql_result($deliveries_result, $i, "delivery_date");
	$cust_id = mysql_result($deliveries_result, $i, "cust_id");
		$table_name = $_SESSION['db_prefix']."_customer";
		$name_query = "SELECT comp_name  FROM $table_name WHERE cust_id='".$cust_id."'  ";
		$name_result = mySQL_query($name_query);
		$name = mysql_result($name_result, 0, "comp_name");
	
	$deliveryTT="<label class=tip_text_label><table style=font-size:9px;><tr><td>Del note</td><td>".$note_no."</td></tr><tr><td>Name:</td><td>".$name."</td></tr><tr><td>Date:</td><td>".$date."</td></tr></table></label>";
	
	if ($type=='job') { ?>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="../store/customer_supplied.php?del_note=<?php echo $note_no?>&supply_id=<?php echo $supply_id_1?>&pr_option=copy" onMouseOver="ddrivetip('<label class=tip_text_label_bold>Delivery</label><br><?php echo $deliveryTT?><label class=tip_text_label_bold>Click for details</label>', 170)"; onMouseOut="hideddrivetip()"><?php echo $note_no?></a>
    <?php } else { ?>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="../store/customer_supplied.php?del_note=<?php echo $note_no?>&supply_id=<?php echo $supply_id_1?>&pr_option=copy" onMouseOver="ddrivetip('<label class=tip_text_label_bold>Additional delivery</label><br><?php echo $deliveryTT?><label class=tip_text_label_bold>Click for details</label>', 170)"; onMouseOut="hideddrivetip()"><?php echo $note_no?></a>
    <?php
	}
	$i++;
}

?>

</div>
</td>
</tr>
</table> 
 <!--end of tableMain-->
  
</div>

<?php include ('../navigation/side_bar.php'); ?>

</body>
<?php } else {
$_SESSION['denied_return'] = "sales/sales_main.php";	
include ("../navigation/sales_sidebar.php");?>
	<body onLoad="accessdenied(); return false">
	</body>
<?php }
?>
</html>