<nav class="large-3 medium-4 columns" id="actions-sidebar">
      <?= $this->element('admin_sidebar') ?>
</nav>

<div class="plans index large-9 medium-8 columns content">
    <div class="col-md-3">
	<h3><?= __('FD Plan Master') ?></h3>
	</div>
	
	<div class="search-wrapper">
<div class="col-md-7">	
<div class="search-filter"><?= $this->Search->filterForm($searchFilters) ?></div></div>
<div class="col-md-2">
    <div class="btn-link" ><?= $this->Html->link(__('Add Plan'), ['action' => 'add'],['class'=>'green-btn', 'title' => 'Add New Plan', 'type' => 'button']) ?></div></div>
	</div>
    <table class="tbl-wrapper" cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <th style="width:40px;" scope="col"><?= $this->Paginator->sort('Sr No') ?></th>
                <th scope="col"><?= $this->Paginator->sort('Company') ?></th>
                <th scope="col"><?= $this->Paginator->sort('Product Name') ?></th>
                <th scope="col"><?= $this->Paginator->sort('Scheme') ?></th>
                <th scope="col"><?= $this->Paginator->sort('Plan Name') ?></th>
             <!--   <th scope="col"><?= $this->Paginator->sort('Tenure') ?></th>
               <th scope="col"><?= $this->Paginator->sort('Monthly % p.a') ?></th>
               <th scope="col"><?= $this->Paginator->sort('Quarterly % p.a') ?></th>
               <th scope="col"><?= $this->Paginator->sort('Half yearly % p.a') ?></th>
               <th scope="col"><?= $this->Paginator->sort('Yearly % p.a') ?></th> -->
               
                <th scope="col" class="actions"><?= __('Actions') ?></th>
            </tr>
        </thead>
        <tbody>
            <?php $srlno = ($this->request->params['paging']['Plans']['page']-1) * $this->request->params['paging']['Plans']['perPage'];
            $j=1;
foreach ($plans as $plan): $srlno++;?>
            <tr>
                <td style="width:40px;"><?= $srlno ?></td>
                <td><?= $plan->has('company') ? $this->Html->link($plan->company->company, ['controller' => 'Companies', 'action' => 'view', $plan->company->id]) : '' ?></td>
                <td><?= $plan->has('product') ? $this->Html->link($plan->product->productname, ['controller' => 'Products', 'action' => 'view', $plan->product->id]) : '' ?></td>
                <td><?= h($plan->scheme) ?></td>
                <td><?= h($plan->Planname) ?></td>
              <!--  <td><?= h($plan->tenure) ?></td>
                <td><?= h($plan->monthly) ?></td>
                <td><?= h($plan->quarterly) ?></td>
                <td><?= h($plan->halfyearly) ?></td>
                <td><?= h($plan->yearly) ?></td> -->
                <td class="actions">
                    <?= $this->Html->link(__('View'), ['action' => 'view', $plan->id],['class' => 'view','title'=>__('View')]) ?>
                    <?= $this->Html->link(__('Edit'), ['action' => 'edit', $plan->id],['class' => 'edit','title'=>__('Edit')]) ?>
                    <!--<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $plan->id], ['class' => 'delete','title'=>__('Delete'),'confirm' => __('Are you sure you want to delete # {0}?', $plan->id)]) ?>-->
                </td>
            </tr>
            <?php $j++;
endforeach; ?>
        </tbody>
    </table>
<div class="btn-link"><input type="button" value="Back" onclick="window.history.back()" class="green-btn" /> </div>
    <div class="paginator">
        <ul class="pagination">
           <?= $this->Paginator->first(__('First', true), array('class' => 'disabled')); ?>
            <?= $this->Paginator->prev('< ' . __('previous',true), array('class' => 'disabled')) ?>
            <?= $this->Paginator->numbers() ?>
            <?= $this->Paginator->next(__('next' . ' >',true), array('class' => 'disabled')) ?>
		 <?=  $this->Paginator->last(__('Last', true), array('class' => 'disabled')); ?>
        </ul>
        <p><?= $this->Paginator->counter() ?></p>
    </div>
</div>
