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

<div class="bankbranchs index large-9 medium-8 columns content">
   
    <h3><?= __('Bank Branches') ?></h3>
     <div class="btn-link"><?= $this->Html->link(__('Add Bank Branch'), ['action' => 'add'],['class' => 'green-btn']) ?></div>
    <table cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <th scope="col"><?= $this->Paginator->sort('id') ?></th>
                <th scope="col"><?= $this->Paginator->sort('bank_id') ?></th>
                <th scope="col"><?= $this->Paginator->sort('branchaddress') ?></th>
                <th scope="col"><?= $this->Paginator->sort('micrcode') ?></th>
                <th scope="col"><?= $this->Paginator->sort('neftcode') ?></th>
                <th scope="col" class="actions"><?= __('Actions') ?></th>
            </tr>
        </thead>
        <tbody>
            <?php $j=1;
 foreach ($bankbranchs as $bankbranch): ?>
            <tr>
                <td><?= $j ?></td>
                <td><?= $bankbranch->has('bank') ? $this->Html->link($bankbranch->bank->banks, ['controller' => 'Banks', 'action' => 'view', $bankbranch->bank->id]) : '' ?></td>
                <td><?= h($bankbranch->branchaddress) ?></td>
                <td><?= h($bankbranch->micrcode) ?></td>
                <td><?= h($bankbranch->neftcode) ?></td>
                <td class="actions">
                    <?= $this->Html->link(__('View'), ['action' => 'view', $bankbranch->id],['class' => 'view']) ?>
<?php  if($this->request->session()->read('Auth.User.group_id')=='3'){ ?>  
                    <?= $this->Html->link(__('Edit'), ['action' => 'edit', $bankbranch->id],['class' => 'edit']) ?>
                    <!--<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $bankbranch->id],['class' => 'delete'], ['confirm' => __('Are you sure you want to delete # {0}?', $bankbranch->id)]) ?>-->
<?php } ?>
<?php  if($this->request->session()->read('Auth.User.group_id')=='2'){ ?>  
 <?= $this->Html->link(__('Edit'), ['action' => 'edit', $bankbranch->id],['class' => 'edit']) ?>
                    <?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $bankbranch->id],['class' => 'delete'], ['confirm' => __('Are you sure you want to delete # {0}?', $bankbranch->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>
