<ul class="list-group">
<?php 
    $i=0;
    $select = $db->prepare("SELECT * FROM `tbl_docs` WHERE registID = '".$req."' AND is_dsgn=1 ORDER BY doc_id DESC");
    $select->execute(); 
    while($row = $select->fetch()){
        $doc_id = $row['doc_id'];
        $uploaded_on = $row['uploaded_on'];
        $docName = $row['docName'];
        $rec_dpt = $row['rec_dpt'];
        $usID = $row['usID'];
        $stts_doc = $row['stts_doc'];
        $i++;
        
        //Hide Extension
        $file = new SplFileInfo($docName);
        $ext  = $file->getExtension();
        //Get File Name
        $fileName = basename($docName);
        $fileNameNoExtension = preg_replace("/\.[^.]+$/", "", $fileName);

        //DOC ICON
        if($ext == "pdf"){
        $imgIcon = "pdf.png";
        }if($ext == 'xls' || $ext == 'xlsx'){
        $imgIcon = "excel.png";  
        }if($ext == 'doc' || $ext == 'docx'){
            $imgIcon = "docx.png";
        }if($ext == 'ppt' || $ext == 'pptx'){
            $imgIcon = "pptx.png";
        }if($ext == 'zip' || $ext == 'rar' || $ext == 'tar'){
            $imgIcon = "zip.png";
        }
    ?>   
    <li class="list-group-item header"><?php echo $docName;?> 
    <a href="../docs/<?php echo $docName;?>" class="btn btn-default btn-xs pull-right">
    <img src="../img/icon/<?php echo $imgIcon;?>" width="40" style="padding: 10px;margin-left: 10px;" title="<?php echo $docName;?>">
     </a></li>

    <?php 
    }
    ?>
</ul>