
<p class="blockquote mt-n5">
<span class="float-right"><a class="btn btn-secondary" href="index.php?t=includes/finance&p=commission_reports.php"><i class="fal fa-file-invoice"></i> View Reports </a></span>Select the date range you wish to view.

</p>
<div class="row">
<div class="col-sm-12 col-md-3">
<div class="input-group row">
<div class="col-sm-12 col-md-5"><label class="lead control-label" for="date">Start date</label></div>
<div class="col-sm-12 col-md-7 input-group"><input class="form-control form-control-sm datepicker" type="text" name="sdate" id="sdate" value="<?php echo $date?>" placeholder="DD-MM-YYYY" /></div>
</div>
</div>

<div class="col-sm-12 col-md-3">
<div class="input-group row">
<div class="col-sm-12 col-md-5"><label class="lead control-label" for="date">End date</label></div>
<div class="col-sm-12 col-md-7 input-group"><input class="form-control form-control-sm datepicker" type="text" name="edate" id="edate" value="<?php echo $date?>" placeholder="DD-MM-YYYY" /></div>

</div>
</div>

<div class="col-sm-12 col-md-3">
<div class="input-group row">
<button id="loadButton" type="button" class="btn btn-secondary m-0 px-3 py-2">Load report</button>
</div>
</div>

</div>

<div class="clearfix"></div>
<hr>
<div id="commissionData"></div>

<script>
$('#loadButton').on('click',function(){
var s=$('#sdate').val()
var e=$('#edate').val()
if(s=="" || e=="" ){response("danger","You must set a START and END date to report on");}
else{
$.post('includes/finance/finance_commission_data.php',{start:s,end:e},function(r){
if($.trim(r)!=="error"){$('#commissionData').html(r)}
})
}
})


$('#navBox').html('<li class="breadrumb-item"><a href="javascript:void(0)">Finance</a><i class="fad fa-angle-double-right mx-2 mt-1"" aria-hidden="true"></i></li><li class="breadrumb-item active">Commission</li>')

</script>
