<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" />
<div align="center">
<? if ($_GET['stat'] == '' ) { ?>
<table width="100%" border="0">
  <tr>
    <td rowspan="2" class="td1">Date</td>
    <td rowspan="2" class="td1">Time</td>
    <td rowspan="2" class="td1">Plate No.</td>
    <td rowspan="2" class="td1">Type</td>
    <td colspan="2" class="td1">Size</td>
    <td rowspan="2" class="td1">Remarks</td>
    <td rowspan="2" class="td1">Printing</td>
    <td rowspan="2" class="td1">Urgency</td>
</tr>
  <tr>
    <td class="td1">Long</td>
    <td class="td1">Short</td>
  </tr>

		<?
            $result = mysql_query('SELECT *  FROM p1_order_info where status = 0 and stop1 = 0 order by Type2 ,aid , oid,Time_a',$db); 
            while($row = mysql_fetch_array($result)){ 
        
        ?>
    <tr <? if( $row['Type2'] == '1') { ?>class="td4" <? }else{ ?> class="td2" <? } ?>>
    <td><div align="center"><? echo $row['Date_a']; ?></div></td>
    <td><div align="center"><? echo $row['Time_a']; ?></div></td>
    <td><div align="center"><? echo $row['Plate']; ?></div></td>
    <td><div align="center" class="p_c<? echo $row['Type1']?>">
      <?	
                        $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><div align="center"><? echo $row['Size1']; ?></div></td>
    <td><div align="center"><? echo $row['Size2']; ?></div></td>
    <td><div align="center"><? echo $row['Remarks']; ?></div></td>
    <td><div align="center"><a href="index.php?page=2&stat=printed&id=<? echo $row['oid']; ?>&plate=<? echo $row['Plate']; ?>" <? if( $row['Type2'] == '1') { ?>class="td4" <? }else{ ?> class="td2" <? } ?>>Printing</a></div></td>
    <td> <? if( $row['Type2'] == '1') { ?>Yes<? } elseif( $row['Type2'] == '0')  { ?>No<? }elseif( $row['Type2'] == '2'){ 
	
	
	
	?>Agent <?
   
     $aid = $row['aid'];
	$query1 = mysql_query("SELECT p1_agent_order.aid, p1_agent_order.tid, p1_agent.agent_name, p1_agent_order.agent_date, p1_agent_order.status
FROM p1_agent INNER JOIN p1_agent_order ON p1_agent.tid = p1_agent_order.tid where aid = $aid");
	if (mysql_num_rows($query1) <> "0")
				{
					echo  " (".mysql_result($query1,0,"agent_name").") ";
				}
	}elseif( $row['Type2'] == '3') { ?>VIP<? }
				?></td>
  </tr>
    <tr >
      <td colspan="10" height="6"></td>
    </tr>
		<?
			}
		
		?>
</table>

<? } if ($_GET['stat'] == 'printed' ) { ?>
<form id="form1" name="form1" method="post" action="index.php?page=2&stat=change&id=<? echo $_GET['id']; ?>">
  <table width="50%" border="0">
    <tr>
      <td width="40%" class="td1">Plate No.</td>
      <td class="td2">&nbsp;<? echo $_GET['plate'];?></td>
    </tr>
    <tr>
      <td class="td1">Rack No.</td>
      <td class="td2"><span id="sprytextfield1">
        <label>
        <input type="text" name="Rack" id="Rack" />
        </label>
        <span class="textfieldRequiredMsg">*</span></span></td>
    </tr>
  </table>
  <p>
    <input name="Submit" type="submit" class="Submit" id="Submit" value="   Save   " />
  </p>
</form>
  <p>&nbsp;</p>


<? } ?>


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