<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('vatexpenditure'=>'/vatexpenditure/','vatreceipts'=>'/vatreceipts/');

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">Vat IN</p></div>
<div class="row">
<?php foreach($vatexpenditure 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, 'vatexpenditure')?></div>
</div>
<?php }?>
</div>

<hr class="clearfix" />

<div class="row"><p class="blockquote">Vat OUT</p></div>
<div class="row">
<?php foreach($vatreceipts 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, 'vatreceipts')?></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('<li class="breadrumb-item"><a href="index.php?t=includes/finance&p=finance_invoices.php">Finance</a><i class="fad fa-angle-double-right mx-2 mt-1"" aria-hidden="true"></i></li><li class="breadrumb-item active">VAT Reports</li>')
</script>