<nav class="large-3 medium-4 columns" id="actions-sidebar">
      <?= $this->element('admin_sidebar') ?>
</nav>
<div class="bankdetails index large-9 medium-8 columns content">
    <h3><?= __('Bank Details') ?></h3>
	<div class="search-wrapper"> 
     <div class="btn-link"><?= $this->Html->link(__('New Bankdetail'), ['action' => 'add'],['class'=>'green-btn', 'title' => 'Add New BankDetail', 'type' => 'button']) ?> </div>
	</div>
    <table class="tbl-wrapper" cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <th scope="col"><?= $this->Paginator->sort('id') ?></th>
                <th scope="col"><?= $this->Paginator->sort('Bank Name') ?></th>
                <th scope="col"><?= $this->Paginator->sort('Account No') ?></th>
                <th scope="col"><?= $this->Paginator->sort('Branch Address') ?></th>
                <th scope="col"><?= $this->Paginator->sort('Account Type') ?></th>
                <th scope="col"><?= $this->Paginator->sort('MICR Code') ?></th>
                <th scope="col"><?= $this->Paginator->sort('RTGS/NEFT/IFSC code') ?></th>
                <th scope="col" class="actions"><?= __('Actions') ?></th>
            </tr>
        </thead>
        <tbody>
            <?php $j=1;
foreach ($bankdetails as $bankdetail): ?>
            <tr>
                <td><?= $j ?></td>
                <td><?= $bankdetail->has('bank') ? $this->Html->link($bankdetail->bank->id, ['controller' => 'Banks', 'action' => 'view', $bankdetail->bank->id]) : '' ?></td>
                <td><?= h($bankdetail->accountno) ?></td>
                <td><?= h($bankdetail->branchaddress) ?></td>
                <td><?= h($bankdetail->accounttype) ?></td>
                <td><?= h($bankdetail->micrcode) ?></td>
                <td><?= h($bankdetail->neftcode) ?></td>
                <td class="actions">
                    <?= $this->Html->link(__('View'), ['action' => 'view', $bankdetail->id],['class' => 'view','title'=>__('View')]) ?>
<?php  if($this->request->session()->read('Auth.User.group_id')=='2'){ ?>
                    <?= $this->Html->link(__('Edit'), ['action' => 'edit', $bankdetail->id],['class' => 'edit','title'=>__('Edit')]) ?>
                   <?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $bankdetail->id], ['class' => 'delete','title'=>__('Delete'),'confirm' => __('Are you sure you want to delete # {0}?', $bankdetail->id)]) ?>
<?php } ?>
<?php  if($this->request->session()->read('Auth.User.group_id')=='3'){ ?>
 <?= $this->Html->link(__('Edit'), ['action' => 'edit', $bankdetail->id],['class' => 'edit','title'=>__('Edit')]) ?>
                   <!-- <?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $bankdetail->id], ['class' => 'delete','title'=>__('Delete'),'confirm' => __('Are you sure you want to delete # {0}?', $bankdetail->id)]) ?>-->
<?php } ?>
                </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->prev('< ' . __('previous')) ?>
            <?= $this->Paginator->numbers() ?>
            <?= $this->Paginator->next(__('next') . ' >') ?>
        </ul>
        <p><?= $this->Paginator->counter() ?></p>
    </div>
</div>
