<?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-6 col-12">
				<label for="Name" class="control-label">Company Name</label>
				<input type="text" class="form-control" id="search" name="search" value="<?php echo $search;?>" placeholder="Company Name">
			  </div>
			  <?if(!isset($_SESSION['is_consultant']) && $_SESSION['is_consultant'] ==""){?>
			  <div class="col-lg-6 col-12 hide">
					<label for="Consultant" class="control-label">Consultant</label>
					<? Admin::getAdminList("admin_id_search",$admin_id_search,"100%",false,"form-control"); ?>
			  </div>
			  <?}?>
			  <div class="col-lg-4 col-12 hide">
				<label for="From" class="control-label">From</label>
				<input type="text" class="form-control datepicker" id="from_date" name="from_date" value="<?php (isset($from_date) && $from_date !="") ? utility::getFormatedDate($from_date) : "";?>">
			  </div>
			  <div class="col-lg-4 col-12 hide">
				<label for="To" class="control-label">To</label>
				<input type="text" class="form-control datepicker" id="to_date" name="to_date" value="<?php (isset($to_date) && $to_date !="") ? utility::getFormatedDate($to_date) : "";?>">
			  </div>
			  <div class="col-lg-4 col-12 hide">
				<label for="County" class="control-label">County</label>
				<? $gsi->getCountyList("county",$county,"100%",false,"form-control"); ?>
			  </div>	  
			  <div class="col-lg-1 col-12 hide">
				<label for="Archived" class="control-label">Archived</label><br>
				<input type="checkbox" class="flat-red" id="is_archive" name="is_archive" value="1"  <? echo ($is_archive ==1) ? 'checked':''; ?>>
			  </div>
			  
			  <div class="col-lg-4 col-12">
				<label for="Postcode" class="control-label">&nbsp;</label><br>
				<button type="submit" id="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">Show All</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>