<?php
include "top.php";
?> 
<div class="content-wrapper"> 
<section class="content-header sty-one">
<h1>Newsletter Subscriber <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'=>'Pages','action'=>'page'),array('escape' => false));?></li>
<li><i class="fa fa-angle-right"></i> Newsletter Subscriber</li>
</ol>
</section>

<section class="content">
<div class="panel-heading">
<div class="filter"><i class="fa fa-filter"></i> Filter</div>
<div class="btn"><?php echo $this->Html->link('Add New',array('controller'=>'users','action'=>'usersadd'),array('escape'=>false));?></div>
<div class="filterbar-panel">
<?php echo $this->Form->create('meetings', ['url' => ['controller' => 'users', 'action' => 'newsletters'],'method' => 'get']);?>
<div class="row">
<div class="col-md-3 col-sm-12"><?php echo $this->Form->control('email', array('class'=>'form-control','label'=>'EMAIL','value'=>$this->request->getQuery('email')));?></div>
<div class="col-md-3 col-sm-12"><?php echo $this->Form->control('startdate', array('id'=>'createdate','class'=>'form-control','label'=>'SUBSCRIBE date from','value'=>$this->request->getQuery('startdate')));?></div>
<div class="col-md-3 col-sm-12"><?php echo $this->Form->control('enddate', array('id'=>'modifieddate','class'=>'form-control','label'=>'SUBSCRIBE date to','value'=>$this->request->getQuery('enddate')));?></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>ID</th>
<th>EMAIL</th>
<th>SUBSCRIBE DATE</th>
<th>ACTION</th>
</tr>
<?php
$i=1;
foreach($querypages as $value)
{	
?>
<tr>
<td><?php echo $i++;?></td>
<td><?php echo $value['email'];?></td>
<td><?php echo date_format($value['date'],'Y-m-d');?></td>
<td><?php echo $this->Html->link('<i class="fa fa-trash"></i>', array('pages'=>'users','action'=>'newslettersremove',$value['id']),array("onclick"=>"return deleterecord('newslettersremove/$value[id]')",'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";
?>