<style>
.doc{background-image: url('filebrowse/images/document.png'); background-size: contain; height:65px; width:70px; float: left; display: inline-block; position: relative}
.thumbnail {
    display: inline-block;
    border: #e8e8e8 1px solid;
    width: 150px;
    height: 120px;
    overflow: hidden;
    margin: 4px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    font-size: 11px;
    border-radius: 6px;
    background-color: #f4f4f4;
}
a.thumbitem {
    display: block;
    border: none;
    width: 100%;
    height: 100%;
    text-align: center;
}
.thumbfooter {

    width: 100%;
    padding: 5px 0px;
    background-color: rgba(0,0,0,0.6);
    text-align: center;
	color:#fff
}
.thumbtype {
    position: absolute;
    top: 25%;
    left: 15px;
    background-color: rgba(50,163,167,0.8);
    padding: 5px 0px;
    font-size: 1.1em;
    color: #ffffff;
    width: 40px;
    text-align: center;
    /* box-shadow: 2px 2px 5px #888888; */
}

</style>
<?php
$dir="output/reps/";
$files = glob("output/reps/*.pdf");
$fileNames=array('invoicesUnPaid'=>'/invoicesUnPaid/');

function getName($n,$t){
$name=str_replace('output/reps/000_','',$n);
$name=str_replace('.pdf','',$name);
$name=str_replace($t."_",'',$name);
$name=str_replace('_',' / ',$name);
return $name;
}

foreach($fileNames as $k=>$v){
$$k = preg_grep($v, $files);
}
?>

<div class="row mt-n4"><h2 class="blockquote">Invoices outstanding generated reports</h2></div>
<div class="row mx-3">
<?php foreach($invoicesUnPaid as $v){?>
<div class="card">
<div class="card-header p-0">
<div class="thumbfooter p-1"><?php echo getName($v, 'invoicesUnPaid')?></div>
</div>
<div class="card-body">
<a href="<?php echo $v?>" class="thumbitem" target="_blank"><img src="filebrowse/images/document.png"></a>
<div class="thumbtype">PDF</div>
</div>
<div class="card-footer p-0">
<div class="row">
    <div class="col-6"><a href="<?php echo $v?>" target="_blank" class="btn btn-block btn-secondary my-0"><i class="fad fa-download"></i></a></div>
    <div class="col-6"><a class="btn btn-block btn-danger my-0" onclick="remove('<?php echo $v?>')"><i class="fad fa-trash"></i></a></div>
</div>
</div>
</div>
<?php }?>
</div>

<hr class="clearfix" />



<script>

$('.kv-file-remove').css('display','none');
$('.fileinput-remove').css('display','none');
$('.file-caption-main').css('display','none');
$('.file-drag-handle').css('display','none');

function remove(item){

}

$('#navBox').html('<li class="breadrumb-item"><a href="index.php?t=includes/finance&p=finance_invoices.php">Finance - Invoices</a><i class="fad fa-angle-double-right mx-2 mt-1"" aria-hidden="true"></i></li><li class="breadrumb-item"><a href="index.php?t=includes/finance&p=finance_unpaid.php">Outstanding</a><i class="fad fa-angle-double-right mx-2 mt-1"" aria-hidden="true"></i></li><li class="breadrumb-item active">Reports</li>');



</script>