<head>
<?php 
include ("../navigation/header.php");
$page_name = "Production-cutting";
include ("../navigation/access.php");

if ($permission_num==1) {

	 include ("../navigation/production_sidebar.php");
	 
	
$table_name = $_SESSION['db_prefix']."_captured_jobs WHERE compiled = 'yes' AND  cutting_bill IS NULL ";
	$job_query = "SELECT * FROM $table_name ";
	$job_result = execsql($job_query);
	$job_num = mysql_num_rows($job_result);

		
	
	?> 
    
<script type="text/javascript" src="../jscript/tablesort.js"></script>

<script type="text/javascript">
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
</script>

</head>

<?php include('../include/wait.php') ?>
<link href="../css/wait.css" rel="stylesheet" type="text/css">
<body onLoad="MM_showHideLayers('wait','','hide')" onFocus="MM_showHideLayers('wait','','hide');"  onBlur="MM_showHideLayers('wait','','hide');">


<div class="main_frame">
<div class="page_head_frame">
  <label class="label_page_head">Create cutting bills</label></div><br />
<br /><br />
<br />



<div class="scroll_frame_long">
  <table width="490" id="table_list" class="sortable-onload-1r rowstyle-alt no-arrow "  >
    <thead>
      <tr>
        <th style="border-right:hidden"; class="sortable-numeric">&nbsp;</th>
        <th  class="sortable-numeric">Job no</th>
        <th width="94" class="sortable-date-ymd">Date</th>
        <th width="308" class="sortable-text">Customer</th>
        </tr>
    </thead>
    <tbody>
    
    <?php
$i = 0;
$amount=0;
	while ($i < $job_num) {
		$b0 = mysql_result($job_result, $i, "job_no");
		$b1 = mysql_result($job_result, $i, "cust_id");
		 $table_name3 = $_SESSION['db_prefix']."_customer";
         $customer_query = "SELECT comp_name, status, bag_box, box_no, postal_place, phone, contact_1 FROM $table_name3 WHERE cust_id = '".$b1."' ";
		 $customer_result = mySQL_query($customer_query);
         $a2a = mysql_result($customer_result, 0, "comp_name");
		 $a2b = mysql_result($customer_result, 0, "bag_box");
		 $a2c = mysql_result($customer_result, 0, "box_no");
		 $a2d = mysql_result($customer_result, 0, "postal_place");
		 $a2e = mysql_result($customer_result, 0, "phone");
		 $a2f = mysql_result($customer_result, 0, "contact_1");
		 $a3 = mysql_result($customer_result, 0, "status");
		$b2 = mysql_result($job_result, $i, "date");
		$b3 = mysql_result($job_result, $i, "details");
		$b4 = mysql_result($job_result, $i, "captured");
				
		$b9 = mysql_result($job_result, $i, "project_no");
		$b10 = mysql_result($job_result, $i, "project_place");
		$b11 = mysql_result($job_result, $i, "project_description");
		$b12 = mysql_result($job_result, $i, "designer");
		
		$jobTT ="<img src=../images/view.png  width=20 height=16><table id=table_tool_tip width=300 ><tr><td  width=100>Job no:</td><td width=175>".$b0."</td></tr><tr><td valign=top>Project no /place:</td><td>".$b9."&nbsp;".$b10."</td></tr><tr><td>Project description:</td><td>".$b11."</td></tr><tr><td>Designer:</td><td>".$b12."</td></tr></table><br><b>Click for details</b>";
		

		$customerTT ="<img src=../images/view.png  width=20 height=16><table id=table_tool_tip width=250 ><tr><td  width=75>Company:</td><td width=175>".$a2a."</td></tr><tr><td>Address:</td><td>".$a2b."&nbsp;".$a2c."<br>".$a2d."</td></tr><tr><td>Phone:</td><td>".$a2e."</td></tr><tr><td>Contact:</td><td>".$a2f."</td></tr></table><br><b>Click for details</b>";
?>
     <tr class="alt">
       <td width="14" align="right" valign="middle" style="border-right:hidden";  "padding-right:0px;">J</td>
        <td width="54" align="left" style="padding-left:0px;"><a href="trussesJobWiz0.php?job_no=<?php echo $b0?>" onMouseover="ddrivetip('Click to make cutting bill', 125)"; onMouseout="hideddrivetip()" target="_parent" onClick="MM_showHideLayers('wait','','show');"><?php echo $b0 ?></a></td>
        <td> <?php echo date("d-m-Y", strtotime($b2)) ?></td>
       <td ><a href="../sales/customer_details.php?cust_id=<?php echo $b1 ?>" onMouseOver="ddrivetip('<?php echo $customerTT?>', 250)"; onMouseOut="hideddrivetip()"><?php echo $a2a ?></a></td>
        </tr> 
 

    <?php
    $i++;
		
	}?>
	</tbody>
</table>

<br />
</div>
</div>
</body>

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