<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">UnDelivered</p>
<form action="index.php?page=60&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">UnDelivered</p>
<table width="70%" border="1" align="center" bordercolor="#000000">
                          <tr>
                            <td class="td_print1">ID</td>
                            <td class="td_print1">Date</td>
                            <td class="td_print1">Plate </td>
                            <td class="td_print1">Name</td>
                            <td class="td_print1">Mobile</td>
                          </tr>
                        <?
							//$result = mysql_query("SELECT p1_order_info.oid, p1_order_info.Date_a, p1_order_info.Plate,p1_order_info.Name, p1_order_info.mobile, p1_order_info.Type1  FROM p1_out_order RIGHT JOIN p1_order_info ON p1_out_order.oid = p1_order_info.oid  WHERE  (p1_order_info.Date_a between  '".$_POST['from_date']."' AND '".$_POST['to_date']."')  and p1_out_order.status  Is Null  AND p1_order_info.aid=0 AND p1_order_info.vid=0"); 
							
							$result = mysql_query("select * from p1_order_info where Date_a  between '".$_POST['from_date']."' AND '".$_POST['to_date']."' and delivered = 0 and aid = 0 and vid = 0");
							
							$i = 0;
							while($row = mysql_fetch_array($result)){ 
							$i = $i+1;
						?>
                          <tr>
                            <td class="td2"><? echo $i;?></td>
                            <td class="td2"><? echo $row['Date_a'];?></td>
                            <td class="td2"><? echo $row['Plate'];?></td>
                            <td class="td2"><? echo $row['Name'];?></td>
                            <td class="td2"><? echo $row['mobile'];?></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>
