<?php  use Cake\ORM\TableRegistry;
	$users = TableRegistry::get('Users');
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
      <?= $this->element('admin_sidebar') ?>
</nav>
<div class="fds index large-9 medium-8 columns content">
<div class="col-md-3">
    <h3><?= __('User Wise FD') ?></h3></div>
    <div class="search-wrapper">
        <div class="col-md-9">
            <div class="search-filter">
                <div class=""><?= $this->Search->filterForm($searchFilters) ?></div>
            </div>
        </div>
    </div>
	 <?php if(!empty($results)): ?>
    <table class="tbl-wrapper" cellpadding="0" cellspacing="0">
    <thead>
		<tr>
		   <th style="width:40px;" scope="col">Sr No</th>
			<th scope="col">FD done by whom</th>
			<th scope="col">No of entry done</th>
		</tr>
    </thead> 
	<tbody>
		<?php 
		 $i=1;$total='';
	  foreach ($results as $result): ?>
		<tr>
			<td><?= $i++ ?></td>
			 <td>
				<?php if($result['postedby'] > 0){
        				$posteddata = $users->find()->where(['id' => $result['postedby']]);
        				$data = $posteddata->toArray();
        				if($data){
        					echo $data[0]->username;
        				 }
    			     } ?>
			</td>
			 <td>
			 <?php echo $result['cnumber'];?>		
			</td>
		</tr>
	   <?php endforeach; ?>
	</tbody>
    </table>
	 <?php endif; ?>
</div>