<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 {
    position: absolute;
    bottom: 0px;
    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('invoicesPaid'=>'/invoicesPaid/');

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"><p class="blockquote">Invoices Paid</p></div>
<div class="row">
<?php foreach($invoicesPaid as $v){?>
<div class="thumbnail">
<a href="<?php echo $v?>" class="thumbitem" target="_blank"><img src="filebrowse/images/document.png"></a>
<div class="thumbtype">PDF</div>
<div class="thumbfooter"><?php echo getName($v, 'invoicesPaid')?></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');


$('#navBox').html('<a href="index.php?t=includes/finance&p=finance_invoices.php" class="s1">Finance - Invoices</a><a href="index.php?t=includes/finance&p=finance_paid.php" class="s2">Paid</a><a href="javascript:void(0)" class="sa">Reports</a>');
</script>