
<div class="subheader">
    <h1 class="subheader-title" style="font-weight: bold;">
        <i class='subheader-icon fa fa-bars text-primary'></i><?php echo $title;?> 
    </h1>
    <div class="d-flex mr-4">
    <li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
    </div>
</div>


<table id="dt-basic-example" class="table table-hover w-100" style="font-size: 11px;">
    <thead class="header bg-primary" style="color: #fff;">
        <tr>
            <th style="font-weight: bold;width: 5px;"></th>            
            <th style="font-weight: bold;">TYPE</th>            
            <th style="font-weight: bold;">SUBJECT MATTER</th>
            <th style="font-weight: bold;">CLIENT NAME</th>
            <th style="font-weight: bold;">REQUEST DATE</th>
        </tr>
    </thead>

    <tbody>
        <?php 
            $ii=0;
            ####### FETCH ######
            $stmtReq = $db->prepare('SELECT *FROM tbl_info_register i
            INNER JOIN tbl_con_infos cn ON cn.reg_info_id=i.regst_id 
            INNER JOIN tbl_clients c ON c.ct_id=i.clnt_id 
            INNER JOIN tbl_reqs_type r ON r.reqtype_id=i.reqtype
            WHERE i.doctype=3 AND i.stts_reg=5 AND cn.dRcv="'.$role_id.'"');
            $stmtReq->execute();
            while($ffReq = $stmtReq->fetch()){
            $regstid = $ffReq['regst_id'];
            $con_info_id = $ffReq['con_info_id'];
            $dSent=$ffReq['dSent'];
            $ii++;

            #######Check Sender #####
            $sendr=$db->prepare('SELECT *FROM tbl_role WHERE role_id="'.$dSent.'"');
            $sendr->execute();
            $getSdr=$sendr->fetch();
            $sndName=$getSdr['role_name'];
        ?>
        <tr class="b-tr" href="gate?b=reqDet&con=<?php echo $con_info_id;?>" style="cursor: pointer;">
            <td><?php echo $ii;?></td>
            <td><?php echo "REQUEST FOR ".$ffReq['reqtype_name'];?></td>              
            <td><?php echo $ffReq['sub_matt'];?></td>
            <td><?php echo $ffReq['ct_names'];?></td>
            <td>
                <?php echo date('d/m/Y',strtotime($ffReq['requestDate']));?>
               <br><small class="text-primary"><i><?php echo $sndName;?></i></small>
            </td>            
        </tr>
        
    <?php 
        }
    ?>
    </tbody>                           
</table>