<?php 
$submit_url = $file_name."?page=view"; 
$show_all_page = "page=view";
?>
<!-- search form -->
<form class="form-horizontal" action="<?php echo $submit_url;?>" method="post" name="search_form" id="search_form">
	<div class="card-body">
		<div class="row">
			<div class="col-lg-2 col-12">
				<label for="Invoice Number" class="control-label">Purchase Order No.</label>
				<?php echo $gsi->getPurchaseOrderList("purchase_order_search",$purchase_order_search,"100%",false,"form-control select2","",""); ?>
			</div>
			<div class="col-lg-2 col-12">
				<label for="Invoice Number" class="control-label">Invoice Number</label>
				<input type="text" class="form-control" id="invoice_number" name="invoice_number" value="<?php echo $invoice_number;?>" placeholder="Invoice Number" autocomplete="off">
			</div>
			<div class="col-lg-2 col-12">
				<label for="Invoice From" class="control-label">Invoice From</label>
				<input type="text" class="form-control datepicker" id="from_invoice_date" name="from_invoice_date" value="<?php echo (isset($from_invoice_date) && $from_invoice_date !="") ? utility::getFormatedDate($from_invoice_date) : "";?>" placeholder="DD-MM-YYYY" autocomplete="off">
			</div>
			<div class="col-lg-2 col-12">
				<label for="Invoice To" class="control-label">Invoice To</label>
				<input type="text" class="form-control datepicker" id="to_invoice_date" name="to_invoice_date" value="<?php echo (isset($to_invoice_date) && $to_invoice_date !="") ? utility::getFormatedDate($to_invoice_date) : "";?>" placeholder="DD-MM-YYYY" autocomplete="off">
			</div>
			<div class="col-lg-2 col-12">
				<label for="Status" class="control-label">Status</label>
				<?php echo $gsi->POInvoicesStatusTypeList("po_inv_status",$po_inv_status,"100%",false,"form-control select2",""); ?>
			</div>
			<div style="clear:both;"></div>
			<div class="col-lg-4 col-12">
				<label for="Postcode" class="control-label">&nbsp;</label><br>
				<button type="submit" class="btn btn-success">Search
					<i class="fas fa-sync-alt fa-spin" style="display:none;" id="page_load_div"></i>
				</button>
				<button type="button" value="Show All" onclick="javascript:window.location='?<?php echo $show_all_page ?>'" class="btn btn-info">Clear</button>
			</div>
		</div>
	</div>
</form>
<!-- /.search form -->
<script type="text/javascript">
$(document).ready(function(){
	$('#search_form').submit(function(){
		$("#submit").attr("disabled", true);
		$('#page_load_div').show();
	});
});
</script>