
<div class="table-responsive">
    <table id="dt-basic-example" class="table table-hover table-striped w-100" style="font-size: 11px;">
        <thead class="bg-primary" style="color: #fff;">
            <tr>
            <th></th>
            <th>NAMES</th>
            <th>COMPANY</th>
            <th>TYPE</th>
            <th>SUPP/SUBCON CATEGORY</th>
            <th>CONTACT</th>
            <th>TIN N<sup>o</sup></th>
            <th>STATUS</th>
            <th>ACTION</th>
            </tr>
        </thead>
        <tbody>
        <?php

        $i=0;
        $sttmt = $conn->prepare("SELECT *FROM tbl_sub_supp s
        INNER JOIN tbl_categ_su c ON c.ctg_id=s.ctg_su
        INNER JOIN tbl_s_s ss ON ss.ss_id=s.su_type
        INNER JOIN tbl_rank r ON r.rank_id=s.ss_rank
        order by subsup_id desc");
        $sttmt->execute();
        while($Get=$sttmt->fetch()){

        $subsup_id = $Get['subsup_id'];
        $ss_status = $Get['ss_status'];
        $i++;
        ########## RANK ###########
        if($Get['rank_id']!=18){
            $rankname=$Get['rank_name'];
        }else{
            $rankname="";
        }
        ########## RANK ###########
        ?>

        <tr>
        <td><?php  echo $i."."; ?></td>
        <td><?php echo "<b>".$rankname."</b>"." ".$Get['own_name'];?></td>
        <td><?php echo $Get['cpny_name'];?></td>
        <td><?php echo $Get['namesu'];?></td>
        <td><?php echo $Get['ctg_name'];?></td>
        <td><?php echo $Get['tel_cont'];?></td>
        <td><?php echo $Get['tin'];?></td>

        <td class="text-center">
            <?php
            if($ss_status==0)
                { 
            ?>
                <a href="gate?b=supsub&acid=<?php echo $subsup_id;?>" class="btn btn-danger btn-xs">Inactive</a>
                <?php }elseif($ss_status == 1){?>
                <a href="gate?b=supsub&did=<?php echo $subsup_id;?>" class="btn btn-success btn-xs">Active</a>
            <?php }?>
        </td>
        
        <td align="center" style="width:10%;">
            <a href="gate?b=supsub&ssid=<?php echo $subsup_id;?>" title="Edit user info."><i class="fa fa-pencil-square-o" style="color: #5a5a5a;"></i> Edit</strong></a>
            |      
            <a href="javascript:void(0)" title="Delete record" data-toggle="modal" data-target="#del<?php echo $subsup_id;?>" style="color: #a61212;"><i class="fa fa fa-trash-o" style="color: #a61212;"></i> Delete</strong></a><br>
        </td>
        
        </tr>
        <?php
        include 'delete-ss.php';
        }
        ?>
    </tbody>              
</table>
</div>