<link href="wstyle.css" rel="stylesheet" type="text/css" />
<? if ($_GET['stat'] == '' ) { ?>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<p align="center" class="link">General Report</p>
<form action="index.php?page=55&stat=print" method="post" name="form1" target="_blank" id="form1">
  <table width="80%" border="0" align="center">
    <tr>
      <td class="td1">From Date</td>
      <td class="td2"><span id="sprytextfield1">
      <label>
      <input type="text" name="from_date" id="from_date" />
      </label>
      <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">*</span></span>  YYYY-MM-DD</td>
    </tr>
    <tr>
      <td class="td1">To Date</td>
      <td class="td2"><span id="sprytextfield2">
      <label>
      <input type="text" name="to_date" id="to_date" />
      </label>
      <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">*</span></span>  YYYY-MM-DD</td>
    </tr>
  </table>
  <p align="center">
    <input name="Submit" type="submit" class="Submit" id="Submit" value="   Show   " />
  </p>
</form>
<? } if ($_GET['stat'] == 'print' ) { 

    		?>
						<p align="center" class="link">General Report</p>
<table width="60%" border="1" align="center" bordercolor="#000000">
                          <tr>
                            <td class="td_print1">Date</td>
                            <td class="td_print1">Traf .Rcpt No.</td>
                            <td class="td_print1">Plate No.</td>
                            <td class="td_print1">Amount</td>
                            <td class="td_print1">Type</td>
                          </tr>
                        <?

							$result = mysql_query("select * from p1_order_info where Date_a between  '".$_POST['from_date']."' AND '".$_POST['to_date']."' and stop1=0"); 
							
							while($row = mysql_fetch_array($result)){ 
						?>
                          <tr>
                            <td class="td_print2"><? echo $row['Date_a'];?></td>
                            <td class="td_print2"><? echo $row['traf_recpt'];?></td>
                            <td class="td_print2"><? echo $row['Plate'];?></td>
                            <td class="td_print2"><?	
                        $result1 = mysql_query('select * from p1_plate_type where tyid = '.$row['Type1']); 
                        while($row1 = mysql_fetch_array($result1)){ 
                				echo $row1['plate_price']*$row['number_of_plate'] ;
								
            
					}
				?></td>
                            <td class="td_print2"><?	
                        $result1 = mysql_query('select * from p1_plate_type where tyid = '.$row['Type1']); 
                        while($row1 = mysql_fetch_array($result1)){ 
                				echo $row1['plate_type'] ;
								
            
					}
				?></td>
                          </tr>
						<? 
						
								
						
							}
						?>
                        </table>
<p align="center">&nbsp;</p>


<? } ?>
<p>&nbsp;</p>
<div align="center">



</div>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "date", {format:"yyyy-mm-dd", useCharacterMasking:true});
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "date", {useCharacterMasking:true, format:"yyyy-mm-dd"});
//-->
</script>
