<?php
use com\cminds\maplocations\model\Labels;
use com\cminds\maplocations\model\Settings;
$zipcode = '';
if(isset($_GET['zipcode'])) {
	$zipcode = esc_html(sanitize_text_field($_GET['zipcode']));
}
$search = '';
if(isset($_GET['s'])) {
	$search = esc_html(sanitize_text_field($_GET['s']));
}
?>
<div class="cmloc-location-index-top"><?php echo $text; ?></div>
<?php
if(Settings::getOption(Settings::OPTION_INDEX_SEARCH_ENABLE) == '1') {
?>
<div class="cmmrm-route-search-shortcode">
<div class="cmloc-location-index-filter cmloc-filter">
<form action="" class="cmloc-location-filter-form">
	<label class="cmloc-field-search">
		<?php
		if(Settings::getOption(Settings::OPTION_INDEX_SEARCH_MODE) == 'nearest') {
			?>
			<input type="text" name="zipcode" placeholder="Search..." class="cmloc-input-search" style="margin-bottom:10px !important;" value="<?php echo $zipcode; ?>" />
			<?php
		} else {
			?>
			<input type="text" name="s" placeholder="Search..." class="cmloc-input-search" style="margin-bottom:10px !important;" value="<?php echo $search; ?>" />
			<?php
		}
		?>
		<button type="submit" class="cmloc-submit-btn" title="Search">
			<span class="dashicons dashicons-search"></span>
		</button>
	</label>
</form>
</div>
</div>
<?php
}
?>