
<div class="card">
        <div class="card-header bg-white p-0 header">
            <div class="p-3 d-flex flex-row">
                <div class="d-block ml-2">
                    <span class="h6 font-weight-bold text-uppercase d-block m-0">
                        <?php echo $title;?>
                    </span>
                    <div class="clearfix"></div>  
                </div>
            </div>
        </div>    

        <div class="card-body">

        <table id="dt-basic-example" class="table table-hover w-100" style="font-size: 11px;">
            <thead class="header bg-primary">
                <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.'" ORDER BY regst_id DESC');
                    $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'];?>
                        <?php if($ffReq['info_sts']==2){ ?>
                            <label class="btn btn-success btn-xs" style="font-weight: bold;"><i class="fa fa-bell" aria-hidden="true"></i>new</label>
                        <?php }?>
                    </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>

    </div>
</div>


<script>
    $(document).ready(function(){
    $('.b-tr').click(function(){
        window.location = $(this).attr('href');
        return false;
        });
    });
</script>