<?php
/**
 * Template part for displaying Search Classes
 *
 * @package sayara_automotive_pro
 */
?>
<?php 
	$about_section = get_theme_mod( 'sayara_automotive_pro_radio_find_car_enable' );
	if ( 'Disable' == $about_section ) {
	  return;
	}
   
    if( get_theme_mod('sayara_automotive_pro_advance_search_bgcolor','') ) {
      $about_backg = 'background-color:'.esc_attr(get_theme_mod('sayara_automotive_pro_advance_search_bgcolor','')).';';
    }elseif( get_theme_mod('sayara_automotive_pro_advance_search_bgimage','') ){
      $about_backg = 'background-image:url(\''.esc_url(get_theme_mod('sayara_automotive_pro_advance_search_bgimage')).'\')';
    }else{
      $about_backg='';
    }
    $att_style="";
	$image_att = get_theme_mod( 'sayara_automotive_pro_search_car_bg_image_attachment',true );
	if ( 'Scroll' == $image_att ) {
	    $att_style="section_bg_scroll";
	}else{
	    $att_style="section_bg_fixed";
	}
?>
<section id="search-cars" class="<?php echo esc_attr($att_style); ?>" style="<?php echo esc_attr($about_backg); ?>">
	<div class="container search-pg">
		<div class="search-wrap">
			<form action="<?php if(get_theme_mod('sayara_automotive_pro_pagesearch_setting') != ''){  
				echo esc_url(get_permalink(get_theme_mod('sayara_automotive_pro_pagesearch_setting'))); } ?>" method="POST">
				<div class="row ad-search-box">
					<div class="offset-lg-1 col-lg-2 col-md-3 col-sm-6 pr-lg-0 roff">
						<input type="text" id="carname" placeholder="&emsp;<?php echo esc_html(get_theme_mod('sayara_automotive_pro_search_car_form_searchcar')); ?>" name="carname">
					</div>
					<div class="col-lg-2 col-md-3 col-sm-6 pr-lg-0">
						<select id="cartype" name="cartype">
							<option value=""><?php echo esc_html(get_theme_mod('sayara_automotive_pro_select1default_title')); ?>	
							</option>
							<?php $taxonomies = get_terms('carscategory');
	                  			if ($taxonomies) {
	                       			foreach ($taxonomies as $te_taxonomy ) { ?>
	                         			<option value="<?php echo esc_attr($te_taxonomy->name); ?>"><?php echo esc_html($te_taxonomy->name); ?></option> <?php
	                       			}
	                  			}
	                  		?>
						</select>
					</div>
					<div class="col-lg-2 col-md-3 col-sm-6 pr-lg-0">
						<input type="number" id="carminprice" placeholder="&emsp;<?php echo esc_html(get_theme_mod('sayara_automotive_pro_search_car_form_minimum')); ?>" name="carminprice">
					</div>
					<div class="col-lg-2 col-md-3 col-sm-6 pr-lg-0">
						<input type="number" id="carmaxprice" placeholder="&emsp;<?php echo esc_html(get_theme_mod('sayara_automotive_pro_search_car_form_maximum')); ?>" name="carmaxprice">
					</div>
					<div class="col-lg-2 col-md-3 col-sm-12">
						<?php if(get_theme_mod('sayara_automotive_pro_search_form_search_btn',true)!=''){ ?>
							<button type="submit" id="searchcar" class="searchcar">
							<?php echo esc_html(get_theme_mod('sayara_automotive_pro_search_form_search_btn')); ?>
							</button>
						<?php } ?>	
					</div>
				</div>
			</form>
		</div>
	</div>
</section>