<?php 
$submit_url = $file_name."?page=view_uk_holiday"; 
$show_all_page = "page=view_uk_holiday";
?>
<!-- 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">
			<label for="category" class="col-sm-2 col-12 control-label">Year</label>
			<div class="col-sm-5 col-12">
                       <select id="year" name="holiday_year" class="form-control select2">
							<option value="">Select Year</option>
							<?php
								$startYear = date("Y") - 4; // Four years prior to the current year
								$endYear = date("Y") + 4;   // Four years subsequent to the current year
								$holiday_year = isset($holiday_year) && $holiday_year != '' ? $holiday_year : date("Y"); // Default to current year if not set

								for ($year = $startYear; $year <= $endYear; $year++) {
									$selected = ($year == $holiday_year) ? 'selected' : '';
									echo "<option value=\"$year\" $selected>$year</option>";
								}
								?>

						</select>
			</div>
			<div class="col-sm-5 col-12">
				<button type="submit" class="btn btn-success">Search
					<i class="fa fa-refresh 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-primary">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>