<table> 
    <tr>
        <th style="width:40px;">Id</th>
        <th>Mutualfund Id</th>
        <th>Customer Name</th>
        <th>Fund name</th>
        <th>Plan Name</th>
        <th>Bank Name</th>
        <th>Branch Name</th>
        <th>Bank Account No</th>
        <th>Cheque/DD No</th>
        <th>Amount Invested</th>
        <th>Net Amount Paid</th>
        <th>Action</th>
    </tr>
<?php foreach ($data as $investmentdetail) { ?>
    <tr>
        <td><?php echo $investmentdetail->id; ?></td>
        <td><?= $investment[$investmentdetail->id]->has('mutualfund') ? $this->Html->link($investment[$investmentdetail->id]->mutualfund->applicationno, ['controller' => 'Mutualfunds', 'action' => 'view', $investment[$investmentdetail->id]->mutualfund->id]) : '' ?></td>                       
        <td>
            <?= $investment[$investmentdetail->id]->has('customer') ? $this->Html->link($investment[$investmentdetail->id]->customer->accountno, ['controller' => 'Customers', 'action' => 'view', $investment[$investmentdetail->id]->customer->id]) : '' ?>
         </td>
        <td><?= $investment[$investmentdetail->id]->has('mffund') ? $this->Html->link($investment[$investmentdetail->id]->mffund->fundname, ['controller' => 'Mffunds', 'action' => 'view', $investment[$investmentdetail->id]->mffund->id]) : '' ?></td>
        <td><?= $investment[$investmentdetail->id]->has('plan') ? $this->Html->link($investment[$investmentdetail->id]->plan->Planname, ['controller' => 'Plans', 'action' => 'view', $investment[$investmentdetail->id]->plan->id]) : '' ?></td>
        <td><?= $investment[$investmentdetail->id]->has('bank') ? $this->Html->link($investment[$investmentdetail->id]->bank->banks, ['controller' => 'Banks', 'action' => 'view', $investment[$investmentdetail->id]->bank->id]) : '' ?></td>
        <td><?= $investment[$investmentdetail->id]->has('bankbranch') ? $this->Html->link($investment[$investmentdetail->id]->bankbranch->branchaddress, ['controller' => 'Banks', 'action' => 'view', $investment[$investmentdetail->id]->bankbranch->id]) : '' ?></td>
        <td><?php echo $investmentdetail->bankACNo; ?></td>
        <td><?php echo $investmentdetail->chequeDDNo; ?></td>
        <td><?php echo $investmentdetail->amountinvested; ?></td>
        <td><?php echo $investmentdetail->netamountpaid; ?></td>
        <td><?= $this->Form->postLink(
            __('Delete'),
            ['action' => 'delete', $investmentdetail->id],
            ['confirm' => __('Are you sure you want to delete # {0}?', $investmentdetail->id)]
        )
    ?></td>
    </tr>
<?php } ?>       
</table>
