<?php
// no direct access
defined('_JEXEC') or die('Restricted access');

/**
 *
 * @package  VehicleManager
 * @copyright 2012 Andrey Kvasnevskiy-OrdaSoft(akbet@mail.ru); Rob de Cleen(rob@decleen.com);
 * Homepage: http://www.ordasoft.com
  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @version: 3.0 Free
 *
 **/
 
?>
<div class = "vehiclemanager_mod_search" >
<!--======================================================================================-->
       <div class="vm_search_inline">
          <div class="VM_search_vehicles">
              <div><?php echo _VEHICLE_MANAGER_SEARCH_DESC1; ?></div>
              <!-- <input class="inputbox input-medium" type="text" name="searchtext" size="20" maxlength="20"/> -->
              <?php echo $searchtext; ?>
          </div>
          <?php if($showCategory_options==0){?>
          <div class="VM_search_category">
                  <?php echo '<span>' . _VEHICLE_HEADER_CATEGORY. '</span>' .$clist ?>
          </div>
          <?php } elseif($showCategory_options==1){ ?>
              <input type="hidden" name="Category_options" value="on">
          <?php } ?>
        </div>

<noscript>Javascript is required to use Vehicle Manager <a href="http://ordasoft.com/Vehicle-Manager/vehiclemanager-basic-and-pro-feature-comparison.html">Vehicle manager software Joomla extension for Auto Dealers, Auto Dealership Companies and other Enterprises selling Vehicles</a>, <a href="http://ordasoft.com/Vehicle-Manager/vehiclemanager-basic-and-pro-feature-comparison.html">Vehicle Manager create own vehicle web portal for sell, rent,  buy vehicles</a></noscript>

<?php 

//price, year,  dates from-to, milage
$pricefrom_val = $jinput->getRaw('pricefrom') ? $jinput->getRaw('pricefrom') : 0;
$priceto_val = $jinput->getRaw('priceto') ? $jinput->getRaw('priceto') : $max_price;

$yearfrom_val = $jinput->getRaw('yearfrom') ? $jinput->getRaw('yearfrom') : 0;
$yearto_val = $jinput->getRaw('yearto') ? $jinput->getRaw('yearto') : date('Y') + 1;

$search_date_from_val =  $jinput->getRaw('search_date_from1') ? $jinput->getRaw('search_date_from1') : '';
$search_date_until_val =  $jinput->getRaw('search_date_until1') ? $jinput->getRaw('search_date_until1') : '';

$mileagefrom_val = $jinput->getRaw('mileagefrom') ? $jinput->getRaw('mileagefrom') : 0;
$mileageto_val = $jinput->getRaw('mileageto') ? $jinput->getRaw('mileageto') : $max_mileage;

 ?>


        <?php if($params->get('rent') == 0){ ?>
            <script>
              jQuerVEH(function() {
                  jQuerVEH( "#vm_search_date_from_mod, #vm_search_date_until_mod" ).datepicker(
                  {
                  minDate: "+0",
                  dateFormat: "<?php echo filterDateVmSearchMod(); ?>",
                  });
              });
            </script>
          <div class="vm_search_inline">
            <div class="VM_search_rent">
            <div><?php echo _VEHICLE_MANAGER_LABEL_BUTTON_RENT; ?>:</div>
              <div class="box_from" >
                  <span class="col_01"><?php echo _VEHICLE_MANAGER_LABEL_AVAILABLE_FOR_RENT_FROM; ?></span>
                  <input type="text" id="vm_search_date_from_mod" name="search_date_from1"  value="<?php echo $search_date_from_val ?>" >
              </div>
              <div class="box_from" >
                  <span class="col_01"><?php echo _VEHICLE_MANAGER_LABEL_AVAILABLE_FOR_RENT_UNTIL; ?></span>
                  <input type="text" id="vm_search_date_until_mod" name="search_date_until1" value="<?php echo $search_date_until_val ?>">
              </div>
            </div>
        </div>
            <?php } ?>


        <?php if($params->get('year') == 0){ ?>
            <script type="text/javascript">
              jQuerVEH(function() {
                jQuerVEH("#vm_slider_mod_year").slider({
                  min: 1900,
                  max: <?php echo date('Y') + 1; ?>,
                  values: [<?php echo $yearfrom_val;?>,<?php echo $yearto_val;?>],
                  range: true,
                  stop: function(event, ui) {
                    jQuerVEH(".vehiclemanager_mod_search input#yearfrom").val(jQuerVEH("#vm_slider_mod_year").slider("values",0));
                    jQuerVEH(".vehiclemanager_mod_search input#yearto").val(jQuerVEH("#vm_slider_mod_year").slider("values",1));
                  },
                  slide: function(event, ui){
                    jQuerVEH(".vehiclemanager_mod_search input#yearfrom").val(jQuerVEH("#vm_slider_mod_year").slider("values",0));
                    jQuerVEH(".vehiclemanager_mod_search input#yearto").val(jQuerVEH("#vm_slider_mod_year").slider("values",1));
                  }
                });

                jQuerVEH(".vehiclemanager_mod_search input#yearfrom").change(function(){
                  var value1=jQuerVEH(".vehiclemanager_mod_search input#yearfrom").val();
                  var value2=jQuerVEH(".vehiclemanager_mod_search input#yearto").val();
                  if(parseInt(value1) > parseInt(value2)){
                    value1 = value2;
                    jQuerVEH(".vehiclemanager_mod_search input#yearfrom").val(value1);
                  }
                  jQuerVEH("#vm_slider_mod_year").slider("values",0,value1);
                });
                      
                jQuerVEH(".vehiclemanager_mod_search input#yearto").change(function(){
                  var value1=jQuerVEH(".vehiclemanager_mod_search input#yearfrom").val();
                  var value2=jQuerVEH(".vehiclemanager_mod_search input#yearto").val();
                  if(parseInt(value1) > parseInt(value2)){
                    value2 = value1;
                    jQuerVEH(".vehiclemanager_mod_search input#yearto").val(value2);
                  }
                  jQuerVEH("#vm_slider_mod_year").slider("values",1,value2);
                });
              });
            </script>
        <div class="vm_search_inline">
            <div class="VM_search_year">
             <span class="price_label"><?php echo _VEHICLE_MANAGER_LABEL_YEAR; ?></span>
                <div id="vm_slider_mod_year" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all"></div>
                <div class="yearfrom2">
                    <span><?php echo _VEHICLE_MANAGER_LABEL_FROM; ?></span>
                    <input type="text" id="yearfrom" name="yearfrom"  value="<?php echo $yearfrom_val; ?>"/>
                </div>
                <div class="yearto2">
                    <span><?php echo _VEHICLE_MANAGER_LABEL_TO; ?></span>
                    <input type="text" id="yearto" name="yearto" value="<?php echo $yearto_val; ?>"/>
                </div>
                <div style="clear: both;"></div>
            </div>
        </div>
        <?php } 

        if($params->get('price') == 0){ ?>
            <script type="text/javascript">
              jQuerVEH(function() {
                jQuerVEH("#vm_slider_mod_price").slider({
                  min: 0,
                  max: <?php echo $max_price; ?>,
                  values: [<?php echo $pricefrom_val; ?>,<?php echo $priceto_val; ?>],
                  range: true,
                  stop: function(event, ui) {
                    jQuerVEH(".vehiclemanager_mod_search input#pricefrom").val(jQuerVEH("#vm_slider_mod_price").slider("values",0));
                    jQuerVEH(".vehiclemanager_mod_search input#priceto").val(jQuerVEH("#vm_slider_mod_price").slider("values",1));
                  },
                  slide: function(event, ui){
                    jQuerVEH(".vehiclemanager_mod_search input#pricefrom").val(jQuerVEH("#vm_slider_mod_price").slider("values",0));
                    jQuerVEH(".vehiclemanager_mod_search input#priceto").val(jQuerVEH("#vm_slider_mod_price").slider("values",1));
                  }
                });

                jQuerVEH(".vehiclemanager_mod_search input#pricefrom").change(function(){
                  var value1=jQuerVEH(".vehiclemanager_mod_search input#pricefrom").val();
                  var value2=jQuerVEH(".vehiclemanager_mod_search input#priceto").val();
                  if(parseInt(value1) > parseInt(value2)){
                    value1 = value2;
                    jQuerVEH(".vehiclemanager_mod_search input#pricefrom").val(value1);
                  }
                  jQuerVEH("#vm_slider_mod_price").slider("values",0,value1);
                });
                    
                jQuerVEH(".vehiclemanager_mod_search input#priceto").change(function(){
                  var value1=jQuerVEH(".vehiclemanager_mod_search input#pricefrom").val();
                  var value2=jQuerVEH(".vehiclemanager_mod_search input#priceto").val();
                  if(parseInt(value1) > parseInt(value2)){
                    value2 = value1;
                    jQuerVEH(".vehiclemanager_mod_search input#priceto").val(value2);
                  }
                  jQuerVEH("#vm_slider_mod_price").slider("values",1,value2);
                });
              });
            </script>
        <div class="vm_search_inline">
            <div class="VM_search_price">
              <span class="vm_price_label"><?php echo _VEHICLE_MANAGER_LABEL_PRICE; ?></span>
              <div id="vm_slider_mod_price" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all"></div>
              <div class="vm_pricefrom_2">
                <span><?php echo _VEHICLE_MANAGER_LABEL_FROM; ?></span>
                <input type="text" id="pricefrom" name="pricefrom"  value="<?php echo $pricefrom_val; ?>"/>
              </div>
              <div class="vm_priceto_2">
                <span><?php echo _VEHICLE_MANAGER_LABEL_TO; ?></span>
                <input type="text" id="priceto" name="priceto" value="<?php echo $priceto_val; ?>"/>
              </div>
              <div style="clear: both;"></div>
            </div>
        </div>
<?php } 

      if($params->get('showMileage') == 0){ ?>
            <script type="text/javascript">
              jQuerVEH(function() {
                jQuerVEH("#vm_slider_mod_mileage").slider({
                  min: 0,
                  max: <?php echo $max_mileage; ?>,
                  values: [<?php echo $mileagefrom_val; ?>,<?php echo $mileageto_val; ?>],
                  range: true,
                  stop: function(event, ui) {
                    jQuerVEH(".vehiclemanager_mod_search input#mileagefrom").val(jQuerVEH("#vm_slider_mod_mileage").slider("values",0));
                    jQuerVEH(".vehiclemanager_mod_search input#mileageto").val(jQuerVEH("#vm_slider_mod_mileage").slider("values",1));
                  },
                  slide: function(event, ui){
                    jQuerVEH(".vehiclemanager_mod_search input#mileagefrom").val(jQuerVEH("#vm_slider_mod_mileage").slider("values",0));
                    jQuerVEH(".vehiclemanager_mod_search input#mileageto").val(jQuerVEH("#vm_slider_mod_mileage").slider("values",1));
                  }
                });

                jQuerVEH(".vehiclemanager_mod_search input#mileagefrom").change(function(){
                  var value1=jQuerVEH(".vehiclemanager_mod_search input#mileagefrom").val();
                  var value2=jQuerVEH(".vehiclemanager_mod_search input#mileageto").val();
                  if(parseInt(value1) > parseInt(value2)){
                    value1 = value2;
                    jQuerVEH(".vehiclemanager_mod_search input#mileagefrom").val(value1);
                  }
                  jQuerVEH("#vm_slider_mod_mileage").slider("values",0,value1);
                });
                    
                jQuerVEH(".vehiclemanager_mod_search input#mileageto").change(function(){
                  var value1=jQuerVEH(".vehiclemanager_mod_search input#mileagefrom").val();
                  var value2=jQuerVEH(".vehiclemanager_mod_search input#mileageto").val();
                  if(parseInt(value1) > parseInt(value2)){
                    value2 = value1;
                    jQuerVEH(".vehiclemanager_mod_search input#mileageto").val(value2);
                  }
                  jQuerVEH("#vm_slider_mod_mileage").slider("values",1,value2);
                });
              });
            </script>
          <div class="vm_search_inline">
            <div class="VM_search_mileage">
              <span class="vm_price_label"><?php echo _VEHICLE_MANAGER_LABEL_MILEAGE; ?></span>
              <div id="vm_slider_mod_mileage" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all"></div>
              <div class="vm_mileagefrom_2">
                <span><?php echo _VEHICLE_MANAGER_LABEL_FROM; ?></span>
                <input type="text" id="mileagefrom" name="mileagefrom"  value="<?php echo $mileagefrom_val; ?>"/>
              </div>
              <div class="vm_mileageto_2">
                <span><?php echo _VEHICLE_MANAGER_LABEL_TO; ?></span>
                <input type="text" id="mileageto" name="mileageto" value="<?php echo $mileageto_val; ?>"/>
              </div>
              <div style="clear: both;"></div>
            </div>
        </div>
<?php } ?>


    <div class="VM_search_select">
      <?php  if($params->get('maker') == 0){ ?>
        <div  class="VM_search_maker">
          <?php echo '<span>' . _VEHICLE_MANAGER_LABEL_MAKER .'</span>' . ':&nbsp;'. $maker;?>&nbsp;
        </div>
      <?php } ?>
        <?php if($params->get('model') == 0){ ?>
         <script type="text/javascript">
            <?php
                $makers2  = $temp[0];
                $models2  = $temp[1];
                echo 'var modelscars2 = [];';
                for ($c = 0; $c < count($makers2); $c++):
                  $makers2[$c] = '\'' . $makers2[$c] . '\'';
                  foreach ($models2[$c] as $temp => $model_item) $models2[$c][$temp] = '\'' . $model_item . '\'';
                  echo 'var temp2=new Array(' . implode(',', $models2[$c]) . ",'other');\n";
                  echo 'modelscars2[' . $c . "]=temp2;\n";
                endfor;
                echo 'var makers2=new Array(' . implode(',', $makers2) . ');';
            ?>

            function changedMaker2(maker){
                var id = in_array2(maker.value,makers2);
                var model = document.getElementsByName('vm_model')[0]
                if(model.tagName.toLowerCase()=='input'){
                    var select =  document.createElement('select');
                    select.name='vm_model';
                    select.setAttribute('onchange','changedModel2(this)');
                    model.parentNode.appendChild(select);
                    model.parentNode.removeChild(model);
                }
                if(maker.value=='other'){
                    setTextfield2();
                    return;
                }
                clearSelectModel2();
                createOptionModel2('<?php echo _VEHICLE_MANAGER_LABEL_ALL ?>', '<?php echo _VEHICLE_MANAGER_LABEL_ALL ?>');
                for(var c=0;c<modelscars2[id].length;c++) createOptionModel2(modelscars2[id][c],modelscars2[id][c]);
            }

            function clearSelectModel2(){
                var objSelect=document.getElementsByName('vm_model')[0];
                while(objSelect.options.length > 0) objSelect.remove(0);
                return objSelect;
            }

            function in_array2(what, where){
                for(var i=0; i<where.length; i++) if(what == where[i]) return i;
                return false;
            }

            function setTextfield2(){
                var select=document.getElementsByName('vm_model')[0];
                var textfield = document.createElement('input');
                select.parentNode.appendChild(textfield);
                select.parentNode.removeChild(select);
                textfield.name='vm_model';
                textfield.size='35';
            }

            function createOptionModel2(newValue,newText){
                var objSelect = document.getElementsByName('vm_model')[0];
                var objOption = document.createElement("option");
                objOption.text = newText
                objOption.value = newValue
                if(document.all && !window.opera) objSelect.add(objOption); else objSelect.add(objOption, null);
            }

            function changedModel2(select){
                if(select.value=='other') setTextfield2();
            }
        </script>
<!-- ======================================================================================= -->
            <div class="VM_search_model">
                    <?php echo _VEHICLE_MANAGER_LABEL_MODEL . ':&nbsp;'. $model;?>&nbsp;
            </div>
<!-- ======================================================================================= -->
    <?php if($vehiclemanager_configuration['show_country_region_city_as_text_field'] == 0) { ?>
      <?php  if($params->get('country') == 0) { ?>
        <div  class="VM_search_maker">
          <div><?php echo '<span>' . _VEHICLE_MANAGER_LABEL_COUNTRY .'</span>' . ':&nbsp;'.  $country; ?>&nbsp;</div>
        </div>
        <?php if($vehiclemanager_configuration['show_country_region_city_as_text_field'] == 0){ ?>
        <script type="text/javascript">
        <?php

        $countrys2  = $countrys_regions_citys[0];
        $regions2   = $countrys_regions_citys[1];
        $regs2      = $countrys_regions_citys[2];
        $citys2     = $countrys_regions_citys[3];

        echo 'var countrysregions2 = [];';

        for($c=0; $c<count($countrys2); $c++){
          $countrys2[$c]='\''.$countrys2[$c].'\'';
          foreach($regions2[$c] as $temp=>$region2)
            $regions2[$c][$temp]='\''.$region2.'\'';
          echo 'var temp2=new Array("'._VEHICLE_MANAGER_LABEL_ALL.'",'.implode(',',$regions2[$c]).");\n";
          echo 'countrysregions2['.$c."]=temp2;\n";
        }
        echo 'var countrys2=new Array('.implode(',',$countrys2).');';

        echo 'var regionscitys2 = [];';

        for($c=0; $c<count($regs2); $c++){
          $regs2[$c]='\''.$regs2[$c].'\'';
          foreach($citys2[$c] as $temp=>$city2)
            $citys2[$c][$temp]='\''.$city2.'\'';
          echo 'var temp2=new Array("'._VEHICLE_MANAGER_LABEL_ALL.'",'.implode(',',$citys2[$c]).");\n";
          echo 'regionscitys2['.$c."]=temp2;\n";
        }
        echo 'var regs2=new Array('.implode(',',$regs2).');'; ?>

        //label 21.06.17
        function vm_changedCountry2(country){
          var id = vm_in_array2(country.value,countrys2);
          var region = document.getElementsByName('region')[0];

          if(typeof(region) == 'undefined'){
            return;
          }

          vm_clearSelectList2('region');
          //clear city
          vm_clearSelectList2('city');
          vm_setAllselect2('city');

          if(country.value=='<?php echo _VEHICLE_MANAGER_LABEL_ALL;?>'){
            vm_setAllselect2('region');
            return;
          }

          for(var c=0;c<countrysregions2[id].length;c++){
              vm_createOptionList2('region', countrysregions2[id][c],countrysregions2[id][c]);
          }
        }
        //end region

        //citys
        function vm_changedRegion2(region){
          var id = vm_in_array2(region.value,regs2);
          var city = document.getElementsByName('city')[0];

          if(typeof(city) == 'undefined'){
            return;
          }

          vm_clearSelectList2('city');

          if(region.value=='<?php echo _VEHICLE_MANAGER_LABEL_ALL;?>'){
            vm_setAllselect2('city');
            return;
          }

          for(var c=0;c<regionscitys2[id].length;c++){
              vm_createOptionList2('city', regionscitys2[id][c],regionscitys2[id][c]);
          }
        }
        //end city

        function vm_clearSelectList2(elementName){
          var objSelect=document.getElementsByName(elementName)[0];
          while(objSelect.options.length > 0){objSelect.remove(0);}
          return objSelect;
        }

        function vm_in_array2(what, where) {
          for(var i=0; i<where.length; i++)
            if(what == where[i])
              return i;
          return false;
        }

        function vm_createOptionList2(elementName, newValue,newText){
          var objSelect = document.getElementsByName(elementName)[0];
          var objOption = document.createElement("option");
          objOption.text = newText
          objOption.value = newValue
          if(document.all && !window.opera){
            objSelect.add(objOption);
          }else{
            objSelect.add(objOption, null);
          };
        }

        function vm_setAllselect2(elementName){
          vm_createOptionList2(elementName, '<?php echo _VEHICLE_MANAGER_LABEL_ALL;?>','<?php echo _VEHICLE_MANAGER_LABEL_ALL;?>');
        }
      </script>
    <?php } ?>
    
      <?php } ?>
        <?php if($params->get('country') == 0) { ?>
          <div  class="VM_search_maker">
            <div><?php echo '<span>' . _VEHICLE_MANAGER_LABEL_REGION .'</span>' . ':&nbsp;'.  $region; ?>&nbsp;</div>
          </div>
        <?php } ?>

        <?php  if($params->get('country') == 0) { ?>
          <div  class="VM_search_maker">
            <div><?php echo '<span>' . _VEHICLE_MANAGER_LABEL_CITY .'</span>' . ':&nbsp;'.  $city; ?>&nbsp;</div>
          </div>
        <?php } ?>
      <?php } ?>
        <?php } if($params->get('vehicle_type_list') == 0){ ?>
            <div class="VM_search_vehicle">
                    <?php echo _VEHICLE_MANAGER_LABEL_VEHICLE_TYPE . ':&nbsp;'. $vehicle_type_list; ?>&nbsp;
            </div>
        <?php } ?>

        <?php if($params->get('drive_type_list') == 0){ ?>
            <div class="VM_search_drive">
                    <?php echo _VEHICLE_MANAGER_LABEL_DRIVE_TYPE . ':&nbsp;'. $drive_type_list; ?>&nbsp;
            </div>
        <?php } ?>
            
        <?php if($params->get('listing_type_list') == 0){ ?>
            <div class="VM_search_listing">
                    <?php echo _VEHICLE_MANAGER_LABEL_LISTING_TYPE . ':&nbsp;'. $listing_type_list; ?>&nbsp;
            </div>
        <?php } ?>
        
        <?php if($params->get('condition_status_list') == 0){ ?>
            <div class="VM_search_condstatus">
                    <?php echo _VEHICLE_MANAGER_LABEL_CONDITION_STATUS . ':&nbsp;'. $condition_status_list; ?>&nbsp;
            </div>
        <?php } ?>

        <?php if($params->get('transmission_type_list') == 0){ ?>
            <div class="VM_search_transmission">
                    <?php echo _VEHICLE_MANAGER_LABEL_TRANSMISSION_TYPE . ':&nbsp;'. $transmission_type_list; ?>&nbsp;
            </div>
        <?php } ?>

        <?php if($params->get('fuel_type_list') == 0){ ?>
            <div class="VM_search_fuel">
                    <?php echo _VEHICLE_MANAGER_LABEL_FUEL_TYPE . ':&nbsp;'. $fuel_type_list; ?>&nbsp;
            </div>
        <?php } ?>
            
        <?php if($params->get('cylinder_list') == 0){ ?>
            <div class="VM_search_cylinder">
                    <?php echo _VEHICLE_MANAGER_LABEL_NUMBER_CYLINDERS . ':&nbsp;'. $cylinder_list; ?>&nbsp;
            </div>
        <?php } ?>
            
        <?php if($params->get('num_speed_list') == 0){ ?>
            <div class="VM_search_speed">
                    <?php echo _VEHICLE_MANAGER_LABEL_NUMBER_SPEEDS . ':&nbsp;'. $num_speed_list; ?>&nbsp;
            </div>
        <?php } ?>
            
        <?php if($params->get('listing_status_list') == 0){ ?>
            <div class="VM_search_liststatus">
                    <?php echo _VEHICLE_MANAGER_LABEL_LISTING_STATUS . ':&nbsp;'. $listing_status_list; ?>&nbsp;
            </div>
        <?php } ?>

        <?php if($params->get('doors_list') == 0){ ?>
            <div class="VM_search_doors">
                    <?php echo _VEHICLE_MANAGER_LABEL_NUMBER_DOORS . ':&nbsp;'. $doors_list; ?>&nbsp;
            </div>
        <?php } ?>

        <?php if($params->get('price_type_list') == 0){ ?>
            <div class="VM_search_pricetype">
                    <?php echo _VEHICLE_MANAGER_LABEL_PRICE_TYPE . ':&nbsp;'. $price_type_list; ?>&nbsp;
            </div>
        <?php } ?>

        <?php for($i=6;$i<=10;$i++){

                if ($params->get('dropdownfield'.$i) == 0){

                ?><div class="VM_search_extra">
                    <?php
                    if($i == 6){
                      echo _VEHICLE_MANAGER_LABEL_EXTRA6 . ':&nbsp;'. $params->get('extrafield'.$i);
                    }
                    if($i == 7){
                      echo _VEHICLE_MANAGER_LABEL_EXTRA7 . ':&nbsp;'. $params->get('extrafield'.$i);
                    }
                    if($i == 8){
                      echo _VEHICLE_MANAGER_LABEL_EXTRA8 . ':&nbsp;'. $params->get('extrafield'.$i);
                    }
                    if($i == 9){
                      echo _VEHICLE_MANAGER_LABEL_EXTRA9 . ':&nbsp;'. $params->get('extrafield'.$i);
                    }
                    if($i == 10){
                      echo _VEHICLE_MANAGER_LABEL_EXTRA10 . ':&nbsp;'. $params->get('extrafield'.$i);
                    }
                    ?>
                </div>
        <?php
                }
            }
            ?>
    </div>

<div class="VM_search_checkbox">
      <?php if($VID==0){?>
            <div class="VM_search_VID">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_VEHICLEID ?>:&nbsp;<input type="checkbox" name="VID" checked="checked">
                </label>
            </div>
        <?php } elseif($showDescription==1){ ?>
            <input type="hidden" name="VID" value="on">
        <?php } ?>
            
       <?php if($showDescription==0){?>
            <div class="VM_search_comment">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_COMMENT ?>:&nbsp;<input type="checkbox" name="Description" checked="checked">
                </label>
            </div>
        <?php } elseif($showDescription==1){ ?>
            <input type="hidden" name="Description" value="on">
        <?php } ?>

        <?php if($showTitle==0){ ?>
            <div class="VM_search_title">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_TITLE ?>:&nbsp;<input type="checkbox" name="Title" checked="checked">
                </label>
            </div>
        <?php } elseif($showTitle==1){ ?>
            <input type="hidden" name="Title" value="on">
        <?php } ?>

    <?php if($vehiclemanager_configuration['show_country_region_city_as_text_field'] == 1) { ?>
      <?php if($showCountry==0) { ?>
          <div class="VM_search_country">
            <label>
                <?php echo _VEHICLE_MANAGER_LABEL_COUNTRY; ?>:&nbsp;<input type="checkbox" name="Country" checked="checked">
            </label>
          </div>
        <?php } elseif($showCountry==1){?>
            <input type="hidden" name="Country" value="on">
        <?php } ?>

      <?php if($showRegion==0){ ?>
            <div class="VM_search_region">
              <label>
                  <?php echo _VEHICLE_MANAGER_LABEL_REGION; ?>:&nbsp;<input type="checkbox" name="Region" checked="checked">
              </label>
            </div>
        <?php } elseif($showRegion==1){ ?>
            <input type="hidden" name="Region" value="on">
        <?php } ?>

      <?php if($showCity==0){?>
            <div class="VM_search_city">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_CITY; ?>:&nbsp;<input type="checkbox" name="City" checked="checked">
                </label>
            </div>
        <?php } elseif($showCity==1){ ?>
            <input type="hidden" name="City" value="on">
        <?php } ?>
      <?php } ?>

        <?php if($showDistrict==0){?>
            <div class="VM_search_district">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_DISTRICT; ?>:&nbsp;<input type="checkbox" name="District" checked="checked">
                </label>
            </div>
        <?php } elseif($showDistrict==1){ ?>
            <input type="hidden" name="District" value="on">
        <?php }?>

        <?php if($showAddress==0){ ?>
            <div class="VM_search_address">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_ADDRESS ?>:&nbsp;<input type="checkbox" name="Address" checked="checked">
                </label>
            </div>
        <?php } elseif($showAddress==1){ ?>
            <input type="hidden" name="Address" value="on">
        <?php }?>

<!--         <?php if($showMileage==0){ ?>
            <div class="VM_search_mileage">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_MILEAGE ?>:&nbsp;<input type="checkbox" name="Mileage" checked="checked">
                </label>
            </div>
        <?php } elseif($showMileage==1){ ?>
            <input type="hidden" name="Mileage" value="on">
        <?php }?> -->

        <?php if($showEngine_type==0){?>
            <div class="VM_search_engine">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_ENGINE_TYPE ?>:&nbsp;<input type="checkbox" name="Engine_type" checked="checked">
                </label>
            </div>
        <?php } elseif($showEngine_type==1){ ?>
            <input type="hidden" name="Engine_type" value="on">
        <?php }?>

        <?php if($showWheeltype==0){?>
            <div class="VM_search_wheeltype">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_WHEELTYPE ?>:&nbsp;<input type="checkbox" name="Wheeltype" checked="checked">
                </label>
            </div>
        <?php } elseif($showWheeltype==1){ ?>
            <input type="hidden" name="Wheeltype" value="on">
        <?php }?>

        <?php if($showExterior_colors==0){ ?>
            <div class="VM_search_excolors">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_EXTERIOR_COLORS ?>:&nbsp;<input type="checkbox" name="Exterior_colors" checked="checked">
                </label>
            </div>
        <?php } elseif($showExterior_colors==1){ ?>
            <input type="hidden" name="Exterior_colors" value="on">
        <?php }?>

        <?php if($showExterior_extras==0){ ?>
            <div class="VM_search_extras">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_EXTERIOR_EXTRAS ?>:&nbsp;<input type="checkbox" name="Exterior_extras" checked="checked">
                </label>
            </div>
        <?php } elseif($showExterior_extras==1){ ?>
            <input type="hidden" name="Exterior_extras" value="on">
        <?php }?>

        <?php if($showInterior_colors==0){ ?>
            <div class="VM_search_intcolors">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_INTERIOR_COLORS ?>:&nbsp;<input type="checkbox" name="Interior_colors" checked="checked">
                </label>
            </div>
        <?php } elseif($showInterior_colors==1){ ?>
            <input type="hidden" name="Interior_colors" value="on">
        <?php }?>

        <?php if($showDashboard_options==0){ ?>
            <div class="VM_search_dashboard">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_DASHBOARD_OPTIONS ?>:&nbsp;<input type="checkbox" name="Dashboard_options" checked="checked">
                </label>
            </div>
        <?php } elseif($showDashboard_options==1){ ?>
            <input type="hidden" name="Dashboard_options" value="on">
        <?php }?>

        <?php if($showInterior_extras==0){ ?>
            <div class="VM_search_intextras">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_INTERIOR_EXTRAS ?>:&nbsp;<input type="checkbox" name="Interior_extras" checked="checked">
                </label>
            </div>
        <?php } elseif($showInterior_extras==1){ ?>
            <input type="hidden" name="Interior_extras" value="on">
        <?php }?>

        <?php if($showSafety_options==0){?>
            <div class="VM_search_safety">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_SAFETY_OPTIONS ?>:&nbsp;<input type="checkbox" name="Safety_options" checked="checked">
                </label>
            </div>
        <?php } elseif($showSafety_options==1){ ?>
            <input type="hidden" name="Safety_options" value="on">
        <?php }?>

        <?php if($showWarranty_options==0){?>
            <div class="VM_search_warranty">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_WARRANTY_OPTIONS ?>:&nbsp;<input type="checkbox" name="Warranty_options" checked="checked">
                </label>
            </div>
        <?php } elseif($showWarranty_options==1){ ?>
            <input type="hidden" name="Warranty_options" value="on">
        <?php }?>

        <?php if($showOwner==0){?>
            <div class="VM_search_ownername">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_OWNER ?>:&nbsp;<input type="checkbox" name="Ownername" checked="checked">
                </label>
            </div>
        <?php } elseif($showOwner==1){ ?>
            <input type="hidden" name="Ownername" value="on">
        <?php }?>
            
      <?php if($showzipcode==0){?>
            <div class="VM_search_zipcode">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_ZIPCODE ?>:&nbsp;<input type="checkbox" name="Zipcode" checked="checked">
                </label>
            </div>
        <?php } elseif($showzipcode==1){ ?>
            <input type="hidden" name="Zipcode" value="on">
        <?php } ?>

      <?php if($ContactInformation==0){?>
            <div class="VM_search_contacts">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_CONTACTS ?>:&nbsp;<input type="checkbox" name="ContactInformation" checked="checked">
                </label>
            </div>
        <?php } elseif($ContactInformation==1){ ?>
            <input type="hidden" name="ContactInformation" value="on">
        <?php } ?>

      <?php if($CityMPGKPL==0){?>
            <div class="VM_search_cityMPG">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_CITY_FUEL_MPG ?>:&nbsp;<input type="checkbox" name="CityMPGKPL" checked="checked">
                </label>
            </div>
        <?php } elseif($CityMPGKPL==1){ ?>
            <input type="hidden" name="CityMPGKPL" value="on">
        <?php } ?>
            
      <?php if($HighwayMPGKPL==0){?>
            <div class="VM_search_highway">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_HIGHWAY_FUEL_MPG ?>:&nbsp;<input type="checkbox" name="HighwayMPGKPL" checked="checked">
                </label>
            </div>
        <?php } elseif($HighwayMPGKPL==1){ ?>
            <input type="hidden" name="HighwayMPGKPL" value="on">
        <?php } ?>

      <?php if($Wheelbase==0){?>
            <div class="VM_search_wheelbase">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_WHEELBASE ?>:&nbsp;<input type="checkbox" name="Wheelbase" checked="checked">
                </label>
            </div>
        <?php } elseif($Rear_axel_type==1){ ?>
            <input type="hidden" name="Wheelbase" value="on">
        <?php } ?>
            
      <?php if($Rear_axel_type==0){?>
            <div class="VM_search_rearaxel">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_REARAXE_TYPE ?>:&nbsp;<input type="checkbox" name="Rear_axel_type" checked="checked">
                </label>
            </div>
        <?php } elseif($Rear_axel_type==1){ ?>
            <input type="hidden" name="Rear_axel_type" value="on">
        <?php } ?>

      <?php if($Brakes_type==0){?>
            <div class="VM_search_brakes">
                <label>
                    <?php echo _VEHICLE_MANAGER_LABEL_BRAKES_TYPE ?>:&nbsp;<input type="checkbox" name="Brakes_type" checked="checked">
                </label>
            </div>
        <?php } elseif($Brakes_type==1){ ?>
            <input type="hidden" name="Brakes_type" value="on">
        <?php } ?>
       
  <?php for($i=1;$i<=5;$i++){
          if ($params->get('extra'.$i) == 0){
            ?><div class="VM_search_labextra">
            <label>
              <?php echo _VEHICLE_MANAGER_LABEL_EXTRA.'_'.$i ?>:&nbsp;<input type="checkbox" name="extra<?php echo $i;?>" checked="checked">
            </label>
          </div>
          <?php
          }
        }
  ?>
</div>
</div>
<div class="VM_search_batton">
    <input type="submit" value="<?php echo _VEHICLE_MANAGER_LABEL_SEARCH_BUTTON; ?>" class="button"  ></input>
    <input type="hidden" name="option" value="com_vehiclemanager" />
    <input type="hidden" name="task" value="search_vehicle" />
    <input type="hidden" name="Itemid" value="<?php echo $ItemId ?>" />
</div>

<!-- <div style="text-align: center;" ><a href="http://ordasoft.com" style="font-size: 10px;">Powered by OrdaSoft!</a></div> -->
