<link href="wstyle.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style3 {	font-size: 10px;
	font-style: italic;
}
-->
</style>
<div align="center">
<? if ($_GET['stat'] == '' ) { ?>
  <form name="form1" method="post" action="index.php?page=16&stat=search">
    <table width="50%" border="0">
        <tr>
          <td class="td1">Search By</td>
          <td class="td2"><label>
<select name="search_by" id="search_by">
              <option value="Plate">Plate No</option>
              <option value="traf_recpt">Traf .Rcpt No.</option>
              <option value="cpr">CPR</option>
            <option value="mobile">Mobile</option>
            	
            </select>
          </label></td>
        </tr>
        <tr>
          <td class="td1">Search</td>
          <td class="td2"><span id="sprytextfield1">
            <label>
            <input type="text" name="Search" id="Search">
            </label>
          <span class="textfieldRequiredMsg">A value is required.</span></span></td>
        </tr>
      </table>
  </form>
 <? } if ( $_GET['stat'] == 'search' ) { ?>
  <table width="100%" border="0" align="center">
    <tr>
      <td class="td1"><div align="center">Date</div></td>
      <td class="td1"><div align="center">Time</div></td>
      <td class="td1"><div align="center">Plate No.</div></td>
      <td class="td1"><div align="center">Type</div></td>
      <td class="td1"><div align="center">Name</div></td>
      <td class="td1"><div align="center">Mobile</div></td>
      <td class="td1"><div align="center">Status</div></td>
      <td class="td1">Rack</td>
      <td class="td1">Edit</td>
      <td class="td1">Change Time</td>
      <td class="td1">Change plate type</td>
    </tr>
		<?
            $result = mysql_query("SELECT *  FROM p1_order_info where ".$_POST['search_by']." = '".$_POST['Search']."'"); 
            while($row = mysql_fetch_array($result)){ 
        
        ?>
    <tr>
      <td class="td2"><div align="center"><? echo $row['Date_a']; ?></div></td>
      <td class="td2"><div align="center"><? echo $row['Time_a']; ?></div></td>
      <td class="td2"><div align="center"><? echo $row['Plate']; ?></div></td>
      <td class="td2"><div align="center"><?	
                        $result1 = mysql_query('select * from p1_plate_type where tyid = '.$row['Type1']); 
                        while($row1 = mysql_fetch_array($result1)){ 
                				echo $row1['plate_type'] ;
								
            
					}
				?></div></td>
      <td class="td2"><div align="center"><? echo $row['Name']; ?> </div></td>
      <td class="td2"><div align="center"><? echo $row['mobile']; ?> </div></td>
      <td class="td2"><div align="center"><? 
	  					
						if ($row['status']=='0' ) {
							echo 'Factory';
						}	
						if ($row['status']=='1' ) {
							echo 'Printed';
						}	
						if ($row['status'] =='2' ) {
							$oid = $row['oid'];
							$query1 = mysql_query("SELECT * FROM p1_out_order where oid = ".$oid." order by outid desc"); 		
								if (mysql_num_rows($query1) <> "0")	{
								
										$status_24 = mysql_result($query1,0,"status");
										
										if ( $status_24 == 0 ){ echo 'Requested'; } 
										if ( $status_24 == 1 ){ echo 'delivered'; }
										if ( $status_24 == 2 ){ echo 'Under fixing'; }
										if ( $status_24 == 3 ){ echo 'fixing'; }
								
									}else{
										echo 'Delivery';
									}
							
							
						}
						 ?></div></td>
      <td class="td2"><div align="center"><? echo $row['Rack'];	 ?></div>      </td>
      <td class="td2"><a href="index.php?page=16&stat=edit&id=<?  echo $row['oid'];	 ?>" class="link">Edit</a></td>
      <td class="td2"><a href="index.php?page=16&stat=edittime&id=<?  echo $row['oid'];	 ?>" class="link">Change Time</a></td>
      <td class="td2"><a href="index.php?page=16&stat=editpt&id=<?  echo $row['oid'];	 ?>" class="link">Change plate type</a></td>
    </tr>
    
		<?
			}
		?>    
  </table>
<? } if ( $_GET['stat'] == 'editpt' ) {  ?>
  <table width="95%" border="0">
    <tr>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=1&oid=<? echo $_GET['id'];?>"><img src="images/Private.jpg" width="200" height="103" border="0" /></a></div></td>
      <td width="30">&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=2&oid=<? echo $_GET['id'];?>"><img src="images/Orange.jpg" width="200" height="103" border="0" /></a></div></td>
      <td width="30">&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=3&oid=<? echo $_GET['id'];?>"><img src="images/Police.jpg" width="200" height="103" border="0" /></a></div></td>
    </tr>
    <tr>
      <td height="5" colspan="5"></td>
    </tr>
    <tr>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=1&oid=<? echo $_GET['id'];?>" class="link">Private</a></div></td>
      <td>&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=2&oid=<? echo $_GET['id'];?>" class="link">Privet transport ( orange)</a></div></td>
      <td>&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=3&oid=<? echo $_GET['id'];?>" class="link">Police</a></div></td>
    </tr>
    <tr>
      <td height="5" colspan="5"></td>
    </tr>
    <tr>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=4&oid=<? echo $_GET['id'];?>"><img src="images/CD.jpg" width="200" height="103" border="0" /></a></div></td>
      <td>&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=5&oid=<? echo $_GET['id'];?>"><img src="images/MC.jpg" width="200" height="103" border="0" /></a></div></td>
      <td>&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=6&oid=<? echo $_GET['id'];?>"><img src="images/Yellow.jpg" width="200" height="103" border="0" /></a></div></td>
    </tr>
    <tr>
      <td height="5" colspan="5"></td>
    </tr>
    <tr>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=4&oid=<? echo $_GET['id'];?>" class="link">CD</a></div></td>
      <td>&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=5&oid=<? echo $_GET['id'];?>" class="link">M.C</a></div></td>
      <td>&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=6&oid=<? echo $_GET['id'];?>" class="link">Public transport ( yellow)</a></div></td>
    </tr>
    <tr>
      <td height="5" colspan="5"></td>
    </tr>
    <tr>
<td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=7&oid=<? echo $_GET['id'];?>"><img src="images/RC.jpg" width="200" height="103" border="0" /></a></div></td>
      <td>&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=8&oid=<? echo $_GET['id'];?>"><img src="images/Export.jpg" width="200" height="103" border="0" /></a></div></td>
      <td>&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=9&oid=<? echo $_GET['id'];?>"><img src="images/MC Police.jpg" width="200" height="103" border="0" /></a></div></td>
    </tr>
    <tr>
      <td height="5" colspan="5"></td>
    </tr>
    <tr>
     <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=7&oid=<? echo $_GET['id'];?>" class="link">RC</a></div></td>
      <td>&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=8&oid=<? echo $_GET['id'];?>" class="link">Export</a></div></td>
      <td>&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=9&oid=<? echo $_GET['id'];?>" class="link">MC Police</a></div></td>
    </tr>
    <tr>
      <td height="5" colspan="5"></td>
    </tr>
    <tr>  
 <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=10&oid=<? echo $_GET['id'];?>"><img src="images/Racing.jpg" width="200" height="103" border="0" /></a></div></td>
      <td>&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=11&oid=<? echo $_GET['id'];?>"><img src="images/Inspection.jpg" width="200" height="103" border="0" /></a></div></td>
      <td>&nbsp;</td>
	<td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=12&oid=<? echo $_GET['id'];?>"><img src="images/splates.jpg" width="200" height="103" border="0" /></a></div></td>
      <td>&nbsp;</td>   
	</tr>
  <td height="5" colspan="5"></td>
    </tr>
    <tr>
     <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=10&oid=<? echo $_GET['id'];?>" class="link">Racing</a></div></td>
      <td>&nbsp;</td>
      <td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=11&oid=<? echo $_GET['id'];?>" class="link">Inspection</a></div></td>
      <td>&nbsp;</td>  
	
	<td><div align="center"><a href="index.php?page=16&stat=select_plate_type&id=12&oid=<? echo $_GET['id'];?>" class="link">Special Plates</a></div></td>
      <td>&nbsp;</td> 
  </table>
  
<? } if ($_GET['stat'] == 'Error101' ) { ?>

		<span class="td4">The  Traf .Rcpt No. already Exists</span>
 <? } if ( $_GET['stat'] == 'edit' ) { 
 			$oid= $_GET['id'];
			$query_edit = mysql_query("SELECT *  FROM p1_order_info where oid = $oid"); 		
 			
			
					
						$_SESSION['1_did']=mysql_result($query_edit,0,"did");
						$_SESSION['1_tdid']=mysql_result($query_edit,0,"tdid");
						$_SESSION['1_date_name']=mysql_result($query_edit,0,"Date_a");
						$_SESSION['1_time_name']=mysql_result($query_edit,0,"Time_a");
						$_SESSION['1_Type1'] =  mysql_result($query_edit,0,"Type1");
						$_SESSION['1_oid'] =  $oid;
			
			
 ?>
  
  
  <form id="form1" name="form1" method="post" action="index.php?page=16&stat=add_order1">
    <table width="80%" border="0" align="center">
      <tr>
        <td colspan="4" class="td5">Time & Date</td>
      </tr>
      <tr>
        <td width="20%" class="td1"><div align="center">Date</div></td>
        <td width="30%" class="td2"><? echo mysql_result($query_edit,0,"Date_a");?></td>
        <td width="20%" class="td1"><div align="center">Time</div></td>
        <td class="td2"><? echo mysql_result($query_edit,0,"Time_a");?></td>
      </tr>
      <tr>
        <td colspan="4" class="td5">Plate Information</td>
      </tr>
      <tr>
        <td class="td1"><div align="center">Plate No.</div></td>
        <td class="td2"><span id="sprytextfield12">
          <input name="Plate" type="text" id="Plate" value="<? echo mysql_result($query_edit,0,"Plate");?>" maxlength="6" />
          <span class="textfieldRequiredMsg">*</span></span></td>
        <td class="td1"><div align="center">urgency</div></td>
        <td class="td2"><select name="Type2" class="select_box" id="Type2">
            <option value="0" <? if ( mysql_result($query_edit,0,"Type2") == 0){ ?> selected<? } ?>>No</option>
            <option value="1" <? if ( mysql_result($query_edit,0,"Type2") == 1){ ?> selected<? } ?>>Yes</option>
          </select>
        </td>
      </tr>
      <tr>
        <td class="td1"><div align="center">Long</div></td>
        <td class="td2">
          <select name="Size1" class="select_box" id="Size1">
            <option value="0" <? if ( mysql_result($query_edit,0,"Size1") == 0){ ?> selected<? } ?>>0</option>
            <option value="1" <? if ( mysql_result($query_edit,0,"Size1") == 1){ ?> selected<? } ?>>1</option>
            <option value="2" <? if ( mysql_result($query_edit,0,"Size1") == 2){ ?> selected<? } ?>>2</option>
            <option value="3" <? if ( mysql_result($query_edit,0,"Size1") == 3){ ?> selected<? } ?>>3</option>
          </select>
        </td>
        <td class="td1">Short</td>
        <td class="td2">
          <select name="Size2" class="select_box" id="Size2">
            <option value="0" <? if ( mysql_result($query_edit,0,"Size2") == 0){ ?> selected<? } ?>>0</option>
            <option value="1" <? if ( mysql_result($query_edit,0,"Size2") == 1){ ?> selected<? } ?>>1</option>
            <option value="2" <? if ( mysql_result($query_edit,0,"Size2") == 2){ ?> selected<? } ?>>2</option>
            <option value="3" <? if ( mysql_result($query_edit,0,"Size2") == 3){ ?> selected<? } ?>>3</option>
          </select>
        </td>
      </tr>
      <tr>
        <td class="td1">Type</td>
        <td class="td2"><?	
						$tyid = mysql_result($query_edit,0,"Type1");
					
                     	 $result = mysql_query('select * from p1_plate_type where tyid = '.$tyid); 
                         while($row = mysql_fetch_array($result)){ 
                				echo $row['plate_type'] ;
						 }
				?>
        </td>
        <td class="td1">Traf .Rcpt No.</td>
        <td class="td2">
          <input type="text" name="traf_recpt" id="traf_recpt" value="<? echo mysql_result($query_edit,0,"traf_recpt");?>" />
        </td>
      </tr>
      <tr>
        <td class="td1"><span id="result_box" lang="en" xml:lang="en"><span title="" closure_uid_iao69q="61" xc="ÇáÝíÈÑ" yc="FIBER">Fiber</span></span></td>
        <td class="td2"><input name="Fiber" type="checkbox" id="Fiber" value="1"  <? if ( mysql_result($query_edit,0,"Fiber") == 1){ ?> checked<? } ?> /></td>
        <td class="td1">Frame</td>
        <td class="td2"><select name="frame" id="frame">
            <option value="0" <? if ( mysql_result($query_edit,0,"frame") == 0){ ?> selected<? } ?>>No Frame</option>
            <option value="1" <? if ( mysql_result($query_edit,0,"frame") == 1){ ?> selected<? } ?>>Black</option>
            <option value="2" <? if ( mysql_result($query_edit,0,"frame") == 2){ ?> selected<? } ?>>Silver</option>
            <option value="3" <? if ( mysql_result($query_edit,0,"frame") == 3){ ?> selected<? } ?>>White</option>
          </select>
        </td>
      </tr>
      <tr>
        <td class="td1">fixing new / screws  </td>
        <td class="td2"><input name="BD1" type="checkbox" id="BD1" value="1"  <? if ( mysql_result($query_edit,0,"BD1") == 1){ ?> checked<? } ?> /></td>
        <td class="td1">&nbsp;</td>
        <td class="td2">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="4" class="td5">Customer Information</td>
      </tr>
      <tr>
        <td class="td1">CPR</td>
        <td class="td2"><input name="cpr" type="text" id="cpr" maxlength="9" value="<? echo mysql_result($query_edit,0,"cpr");?>" /></td>
        <td class="td1">Name</td>
        <td class="td2"><input type="text" name="Name" id="Name" value="<? echo mysql_result($query_edit,0,"Name");?>" /></td>
      </tr>
      <tr>
        <td class="td1">Mobile</td>
        <td class="td2"><input type="text" name="mobile" id="mobile" value="<? echo mysql_result($query_edit,0,"mobile");?>" /></td>
        <td class="td1">&nbsp;</td>
        <td class="td2">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="4" class="td5">Car Information</td>
      </tr>
      <tr>
        <td class="td1">Month Register</td>
        <td class="td2"><select name="month_register" class="select_box" id="month_register">
            <option value="0">0</option>
            <? for ($i=1;$i<13;$i++) { ?>
            <option value="<? echo $i ?>" <? if ( mysql_result($query_edit,0,"month_register") ==  $i){ ?> selected<? } ?>><? echo $i ?></option>
            <? } ?>
        </select></td>
        <td class="td1">Car Type</td>
        <td class="td2"><input type="text" name="car_type" id="car_type" value="<? echo mysql_result($query_edit,0,"car_type");?>"  /></td>
      </tr>
      <tr>
        <td class="td1">Car Model</td>
        <td class="td2"><input type="text" name="car_model" id="car_model" value="<? echo mysql_result($query_edit,0,"car_model");?>"  /></td>
        <td class="td1">&nbsp;</td>
        <td class="td2">&nbsp;</td>
      </tr>
      <tr>
        <td class="td1">Remarks</td>
        <td colspan="3" class="td2"><textarea name="Remarks" id="Remarks" cols="80" rows="3"><? echo mysql_result($query_edit,0,"Remarks");?></textarea></td>
      </tr>
    </table>
    <p align="center">
      <input name="Submit" type="submit" class="Submit" id="Submit" value="   Save   " />
    </p>
    <table width="80%" border="0" align="center">
    </table>
  </form>
<? } if ($_GET['stat'] == 'to_print' ) { ?>
  
  <p><a href="index.php?page=16&stat=print" target="_blank" class="td4">&nbsp;&nbsp;&nbsp;Print&nbsp;&nbsp;&nbsp;</a></p>
  
  
<? } if ($_GET['stat'] == 'edittime' ) { ?>
<table width="80%" border="0">
    <tr>
      <td class="td3"><div align="center">Date</div></td>
      <td class="td3"><div align="center">Max</div></td>
      <td class="td3"><div align="center">Reserved</div></td>
      <td class="td3">Remaining</td>
      <td class="td3">Select</td>
    </tr>
				<?	
						$oid = $_GET['id'];
                        $uid=$_SESSION['Login_uid'];
                        $result = mysql_query('select * from p1_date'); 
                        while($row = mysql_fetch_array($result)){ 
                ?>	
    <tr>
      <td class="td2"><? echo $row['date_name']?></td>
      <td class="td2"><?
	  	$did = $row['did'];
      	$query = mysql_query("select sum(max_number) as max1 from p1_default_time , p1_time_date where p1_default_time.tid =  p1_time_date.tid and did = $did");
		echo mysql_result($query,0,"max1");
		
		$max = mysql_result($query,0,"max1");
	  ?></td>
      <td class="td2"><? 
	 	$did = $row['did'];
		
      	$query = mysql_query("select count(*) as max1 from p1_order_info where did = $did");
		echo mysql_result($query,0,"max1");
		$max1 = mysql_result($query,0,"max1");

	  ?></td>
      <td class="td2"><? echo $max - $max1;?></td>
      <td class="td2"><a href="index.php?page=16&stat=save_date&did=<? echo $row['did'] ?>&date_name=<? echo $row['date_name']?>&oid=<? echo $oid?>" class="td2">Select</a></td>
    </tr>
				<?
                    }
                ?>
  </table>

  <? } if ($_GET['stat'] == 'select_time' ) { ?>
  <span class="td_print1">&nbsp;&nbsp;Date : <? echo $_SESSION['16_date_name'] ?>&nbsp;&nbsp;</span><br />
  <table width="80%" border="0">
    <tr>
      <td class="td3"><div align="center">Time</div></td>
      <td class="td3"><div align="center">Max</div></td>
      <td class="td3"><div align="center">Reserved</div></td>	
      <td class="td3">Remaining</td>
      <td class="td3">Select</td>
    </tr>
    			<?	
                        $did=$_SESSION['16_did'];
                        $result = mysql_query('select * from p1_time_date, p1_default_time where did= '.$did.' and p1_time_date.tid = p1_default_time.tid'); 
                        while($row = mysql_fetch_array($result)){ 
                ?>
    <tr>
      <td class="td2"><? echo $row['time_name']?></td>
                      <td class="td2"><? echo $row['max_number'];
					  $max = $row['max_number'];
					  	?></td>
                      <td class="td2"><? 
                        $tdid = $row['tdid'];
                        $query = mysql_query("select count(*) as max1 from p1_order_info where tdid = $tdid");
                        echo mysql_result($query,0,"max1");
                		$total_max =  $row['max_number'] - mysql_result($query,0,"max1");
						
						$max1 = mysql_result($query,0,"max1");
                      ?></td>
                      <td class="td2"><? echo $max - $max1;?></td>
                      <td class="td2"><? if ($total_max <> 0 ){ ?><a href="index.php?page=16&stat=save_time&tdid=<? echo $row['tdid'] ?>&time_name=<? echo $row['time_name']?>" class="td2">Select</a><? } ?></td>
    </tr>
    <?
                    }
                ?>
  </table>
  
  <p>
  <? } if ($_GET['stat'] == 'print' ) { ?>  <br />
  <br />
    <br />
  </p>
  <p><br />
    
  </p>  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><div align="center"><strong>RECEIPT</strong></div></td>
    </tr>
    <tr>
      <td><table width="90%" border="0" align="right">
        <tr>
          <td colspan="4" rowspan="2"></td>
          <td width="15%" class="td_print3"><div align="left"><strong>&nbsp;Receipt No.</strong></div></td>
          <td width="30%" class="td_print4">&nbsp;<img src="image.php?code=code39&o=1&t=30&r=1&text=<? echo $_SESSION['Inv_no'] ?>&f=3&a1=&a2=" width="169" height="43" /></td>
        </tr>
        <tr>
          <td class="td_print3"><div align="left"><strong>&nbsp;Traf. Rcpt No.</strong></div></td>
          <td class="td_print4">&nbsp;<? echo $_SESSION['Inv_traf_recpt'] ?></td>
        </tr>
        <tr>
          <td class="td_print3"><div align="center"><strong>Date</strong></div></td>
          <td class="td_print4"><div align="center"><? echo $_SESSION['Inv_Date'] ?></div></td>
          <td class="td_print3"><div align="center"><strong>Time :</strong></div></td>
          <td class="td_print4"><div align="center"><? echo $_SESSION['Inv_Time'] ?></div></td>
          <td class="td_print3"><div align="left"><strong>&nbsp;Cashier</strong></div></td>
          <td class="td_print4">&nbsp;<? echo $_SESSION['P1_Login_name'] ?></td>
        </tr>
        <tr>
          <td class="td_print3"><div align="center"><strong>M/S</strong></div></td>
          <td colspan="3" class="td_print4"><div align="center"><? echo $_SESSION['Inv_Name'] ?>&nbsp;</div></td>
          <td class="td_print3"><div align="left"><strong>&nbsp;Mobile No.</strong></div></td>
          <td class="td_print4"><div align="center"><? echo $_SESSION['Inv_mobile'] ?>&nbsp;</div></td>
        </tr>
      </table></td>
    </tr>
 
    <tr>
      <td><table width="95%" border="0" align="right" bordercolor="#000000">
        <tr>
          <td height="9"></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td class="td_print4"><div align="center"><strong>Item No.</strong></div></td>
          <td class="td_print4"><div align="center"><strong>Plate No.</strong></div></td>
          <td class="td_print4"><div align="center"><strong>Descripition</strong></div></td>
          <td class="td_print4"><div align="center"><strong>Quantity</strong></div></td>
          <td class="td_print4"><div align="center"><strong>Unit Price</strong></div></td>
          <td width="18%" class="td_print4"><div align="right"><strong>Amount </strong></div></td>
          </tr>
        <tr>
          <td height="9"></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
      <? 
	  	$tyid = $_SESSION['Inv_Type1'];
			$query = mysql_query("select * from p1_plate_type where tyid = $tyid"); 		
			$plate_type  = mysql_result($query,0,"plate_type");
			$plate_price = mysql_result($query,0,"plate_price");
			
		
	  
	  for ($i = 1 ; $i<=$_SESSION['Inv_number_of_Size1'] ; $i ++) { ?>  
        <tr class="td_print4">
          <td><div align="center"><? echo $i; ?></div></td>
          <td><? echo $_SESSION['Inv_Plate'] ?></td>
          <td>&nbsp;<? echo $plate_type ?> (Long)</td>
          <td>&nbsp;1</td>
          <td>&nbsp;<? echo $plate_price ?></td>
          <td><div align="right">&nbsp;<? echo $plate_price ?>*</div></td>
          </tr>
      <? 
	  		$total_inv = $total_inv+$plate_price;
	   }
	   
	   if ($i > 0 ) 
	   	{
			$i=$i-1;
		}
	  for ($g = 1 ; $g<=$_SESSION['Inv_number_of_Size2'] ; $g ++) { ?>  
        <tr>
          <td class="td_print4"><div align="center"><? echo $i+$g; ?></div></td>
          <td height="30" class="td_print4"><? echo $_SESSION['Inv_Plate'] ?></td>
          <td class="td_print4">&nbsp;<? echo $plate_type ?> (short)</td>
          <td class="td_print4">&nbsp;1</td>
          <td class="td_print4">&nbsp;<? echo $plate_price ?></td>
          <td class="td_print4"><div align="right">&nbsp;<? echo $plate_price ?>*</div></td>
          </tr>
      <? 
	 	 	$total_inv = $total_inv+$plate_price;
	  
	  } 
	 
	 if ( ($i+$g) > 0 ) {
	 	$id_count = $i+$g -1;
	   }else{
	 	$id_count = 0;
	   }
	 
	  if ($_SESSION['Inv_frame'] <> 0 ) { 
	  
	  $id_count=$id_count+1;
	  ?>  
        <tr>
          <td class="td_print4"><div align="center"><? echo $id_count; ?></div></td>
          <td height="30" class="td_print4"><? if ( $_SESSION['Inv_frame'] == 1 ) {
														echo "Black frame";
													} elseif ( $_SESSION['Inv_frame'] == 2 )  {
														echo "Silver frame";
													} elseif ( $_SESSION['Inv_frame'] == 3 )  {
														echo "White frame";
													}
		  
		  ?></td>
          <td class="td_print4">&nbsp;<? echo $plate_type ?></td>
          <td class="td_print4">&nbsp;1</td>
          <td class="td_print4">&nbsp;5</td>
          <td class="td_print4"><div align="right">5</div></td>
          </tr>
      <? 
	 	 	$total_inv = $total_inv+5;
	  
	  } 
	  
	  if ($_SESSION['Inv_Fiber'] <> 0 ) { 
	  
	  $id_count=$id_count+1;
	  ?>  
        <tr>
          <td class="td_print4"><div align="center"><? echo  $id_count; ?></div></td>
          <td height="30" class="td_print4">&nbsp;</td>
          <td class="td_print4">Fiber</td>
          <td class="td_print4">&nbsp;1</td>
          <td class="td_print4">&nbsp;1</td>
          <td class="td_print4"><div align="right">1</div></td>
          </tr>
      <? 
	 	 	$total_inv = $total_inv+1;
	  
	  } 
	  
	  if ($_SESSION['Inv_BD1'] <> 0 ) { 
	  
	  $id_count=$id_count+1;
	  ?>  
        <tr>
          <td class="td_print4"><div align="center"><? echo  $id_count; ?></div></td>
          <td class="td_print4">&nbsp;</td>
          <td class="td_print4">Fixing new / screws</td>
          <td class="td_print4">&nbsp;1</td>
          <td class="td_print4">&nbsp;1</td>
          <td class="td_print4"><div align="right">1</div></td>
          </tr>
      <? 
	 	 	$total_inv = $total_inv+1;
	  
	  }  ?>
     <? for ($g=1 ; $g<(8- $id_count) ; $g++ ) { ?>
    	 <tr>
           <td height="12"></td>
    	   <td></td>
    	   <td></td>
    	   <td></td>
    	   <td></td>
    	   <td></td>
  	   </tr>
      <? } ?>
        <tr>
          <td class="td_print4"><div align="center"><strong>Total </strong></div></td>
          <td colspan="4" class="td_print4">&nbsp;</td>
          <td class="td_print4"><div align="right"><strong><? echo $total_inv ?></strong> BD</div></td>
          </tr>
      </table></td>
    </tr>
    <tr>
      <td><div align="left"><span class="style3"><br />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*   Amount received by  GDT</span></div></td>
    </tr>
    <tr>
      <td height="52"><p align="center"><strong><u>Appointment Date:</strong> <? echo $_SESSION['1_date_name'] ?>  <strong> Time:  </strong> <? echo $_SESSION['1_time_name'] ?></u></p></td>
    </tr>

  </table> 
  <? } ?>
</div>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
//-->
</script>
