<?php
include "top.php";
?> 
<div class="content-wrapper"> 
<section class="content-header sty-one">
<h1>orders <small><?php echo $this->Paginator->counter('{{count}} record(s)');?> </small></h1>
<ol class="breadcrumb">
<li><?php echo $this->Html->link('<i class="fa fa-home"></i>Home', array('controller'=>'Sales','action'=>'products'),array('escape' => false));?></li>
<li><i class="fa fa-angle-right"></i> orders</li>
</ol>
</section>

<section class="content">
<div class="panel-heading">
<div class="filter"><i class="fa fa-filter"></i> Filter</div>
<div class="filterbar-panel">
<?php echo $this->Form->create('meetings', ['url' => ['controller' => 'sales', 'action' => 'orders'],'method' => 'get']);?>
<div class="row">
<div class="col-md-2 col-sm-12"><?php echo $this->Form->control('txnid', array('class'=>'form-control','label'=>'txnid','value'=>$this->request->getQuery('txnid')));?></div>
<div class="col-md-2 col-sm-12"><?php echo $this->Form->control('paymentstatus', array('class'=>'form-control','label'=>'payment status','default'=>$this->request->getQuery('paymentstatus'),'empty'=>true,'options'=>array('Shipped'=>'Shipped','Pending'=>'Pending')));?></div>
<div class="col-md-2 col-sm-12"><?php echo $this->Form->control('paymentmode', array('class'=>'form-control','label'=>'payment mode','default'=>$this->request->getQuery('paymentmode'),'empty'=>true,'options'=>array('COD'=>'COD','ONLINE'=>'ONLINE')));?></div>
<div class="col-md-2 col-sm-12"><?php echo $this->Form->control('orderid', array('class'=>'form-control','label'=>'orderid','value'=>$this->request->getQuery('orderid')));?></div>
<div class="col-md-2 col-sm-12"><?php echo $this->Form->control('invoiceno', array('class'=>'form-control','label'=>'invoiceno','value'=>$this->request->getQuery('invoiceno')));?></div>
<div class="col-md-2 col-sm-12"><?php echo $this->Form->control('total', array('class'=>'form-control','label'=>'amount','value'=>$this->request->getQuery('total')));?></div>

<div class="col-md-2 col-sm-12"><?php echo $this->Form->control('userid', array('class'=>'form-control','label'=>'email','value'=>$this->request->getQuery('userid')));?></div>
<div class="col-md-2 col-sm-12"><?php echo $this->Form->control('name', array('class'=>'form-control','label'=>'name','value'=>$this->request->getQuery('name')));?></div>
<div class="col-md-2 col-sm-12"><?php echo $this->Form->control('mobile', array('class'=>'form-control','label'=>'mobile','value'=>$this->request->getQuery('mobile')));?></div>
<div class="col-md-2 col-sm-12"><?php echo $this->Form->control('city', array('class'=>'form-control','label'=>'city','value'=>$this->request->getQuery('city')));?></div>
<div class="col-md-2 col-sm-12"><?php echo $this->Form->control('datefrom', array('class'=>'form-control','label'=>'date from','value'=>$this->request->getQuery('datefrom')));?></div>
<div class="col-md-2 col-sm-12"><?php echo $this->Form->control('dateto', array('class'=>'form-control','label'=>'date to','value'=>$this->request->getQuery('dateto')));?></div>
</div>
<div class="row">
<div class="col-md-3 col-sm-12"><?php echo $this->Form->submit('filter',array( 'div' => false,'name' => 'filter','class'=>'filterbtn'));?></div>
</div>
<?php echo $this->Form->end();?>
</div>
</div>


<table class="table">
<tr>
<th>orderid</th>
<th>mode</th>
<th>payment</th>
<th>total</th>
<th>email</th>
<th>NAME</th>
<th>mobile</th>
<th>city</th>
<th>date</th>
<th>ACTION</th>
</tr>
<?php
$i=1;
foreach($querypages as $value)
{	
?>
<tr>
<td><?php echo $value['orderid'];?></td>
<td><?php echo $value['paymentmode'];?></td>
<td><?php echo $value['paymentstatus'];?></td>
<td><?php echo $value['total'];?></td>
<td><?php echo $value['userid'];?></td>
<td><?php echo $value['name'];?></td>
<td><?php echo $value['mobile'];?></td>
<td><?php echo $value['city'];?></td>
<td style="white-space: nowrap;"><?php echo date_format($value['date'],'Y-m-d');?></td>
<td><?php echo $this->Html->link('<i class="fa fa-search-plus"></i>',array('controller'=>'sales','action'=>'orderview',$value['orderid']),array('target'=>'_blank','class'=>'btn','escape'=>false));?></td>
</tr>
<?php
}
?>
</table>


<div class="pagination-panel">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="pagination">
<?php echo $this->Paginator->first('First',array('currentTag'=>'a','escape' => false));?>
<?php echo $this->Paginator->numbers();?>
<?php echo $this->Paginator->last('Last', array('currentTag' => 'a', 'escape' => false));?>
</div>
</div>
</div>
</div>
</div>

</section>
</div>
<?php
include "footer.php";
?>