public function ShowSearch(&$JS = '') { $show_count = array_reverse(array("20" => $this->lang['show_count_20'], "10" => $this->lang['show_count_10'], "5" => $this->lang['show_count_5'], "3" => $this->lang['show_count_3'], "2" => $this->lang['show_count_2'], "1" => $this->lang['show_count_1'], "0" => $this->lang['show_count_all']), true); if ($this->use_country) { $this->tpl->Set($this->tpl->Selection($this->countries, 'country_id', $this->search_array['country_id'], 'id="country_id_search"'), "{country}"); $this->tpl->SetBlock('country'); } if ($this->use_region) { $this->tpl->Set($this->tpl->Selection($this->regions, 'region_id', $this->search_array['region_id'], 'id="region_id_search"'), "{region}"); $this->tpl->SetBlock('region'); } $this->tpl->Set($this->tpl->Selection($this->cities, 'city_id', $this->search_array['city_id'], 'id="city_id_search"'), "{city}"); $this->tpl->Set($this->tpl->Selection($this->marks, 'mark_id', $this->search_array['mark_id'], 'id="mark_id_search"'), "{mark}"); $this->tpl->Set($this->tpl->Selection($this->models, 'model_id', $this->search_array['model_id'], 'id="model_id_search"'), "{model}"); $this->tpl->Set($this->tpl->Selection($this->currency_array, 'currency', $this->search_array['currency']), "{currency}"); $this->tpl->Set($this->tpl->Selection(array(0 => $this->lang['year_any']) + $this->year_array, 'year_min', $this->search_array['year_min']), "{year_min}"); $this->tpl->Set($this->tpl->Selection(array(0 => $this->lang['year_any']) + $this->year_array, 'year_max', $this->search_array['year_max']), "{year_max}"); $this->tpl->Set($this->tpl->inputCheckbox('isset_photo', 1, $this->search_array['isset_photo']), "{isset_photo}"); $this->tpl->Set($this->tpl->Selection($show_count, 'search_count_day', $this->search_array['search_count_day']), "{sel_count}"); $fields = array("race", "capacity_motor_min", "capacity_motor_max", "power_min", "power_max", "cost_min", "cost_max"); foreach ($fields as $field) { $this->tpl->Set($this->search_array[$field], "{" . $field . "}"); } foreach ($this->sel_fields as $name => $value) { if ($value['values']) { $this->tpl->Set($this->tpl->Selection(array(0 => $this->lang['any']) + $value['values'], $name, $this->search_array[$name]), "{" . $name . "}"); } } foreach ($this->checkbox_fields as $name => $value) { $this->tpl->Set($this->tpl->InputCheckbox($name, 1, $this->search_array[$name]), "{" . $name . "}"); } $JS .= $this->_getSearchJS(); }
public function ShowSearchResume(array $options = array(), &$JS = '') { if ($this->use_country) { $this->tpl->SetBlock('country')->Set($this->tpl->Selection($this->GetCountries('search'), 'country_id', $this->search_array['country_id'], 'id="country_id_search"'), "{country}"); } if ($this->use_city) { $this->tpl->SetBlock('city')->Set($this->tpl->Selection($this->GetCities($this->search_array['country_id'], 'search'), 'city_id', $this->search_array['city'], 'id="city_id_search"'), "{city}"); } $this->tpl->Set($this->tpl->Selection($this->GetSpheres('search'), 'sphere_id', $this->search_array['sphere_id'], "id='sphere_id_search'"), '{sphere}'); $this->tpl->Set($this->tpl->Selection($this->GetSpecialties($this->search_array['sphere_id'], 'search'), 'specialty_id', $this->search_array['specialty_id'], "id='specialty_id_search'"), '{specialty}'); $this->tpl->Set($this->tpl->Selection(Job::$currecy_array, 'currency', $this->search_array['currency']), '{currency}'); $fields = array("age_min", "age_max", "salary_min", "salary_max", "description"); foreach ($fields as $field) { if (!empty($this->search_array[$field])) { $this->tpl->Set($this->search_array[$field], '{' . $field . '}'); } } foreach (Resume::$fields as $field_name => $values_array) { if (empty($this->search_array[$field_name])) { $this->search_array[$field_name] = ''; } $this->tpl->Set($this->tpl->Selection(array(0 => $this->lang['any']) + $values_array, $field_name, $this->search_array[$field_name]), '{' . $field_name . '}'); } $this->tpl->Set($this->tpl->Selection(array(0 => $this->lang['any'], "M" => $this->lang['sex_man'], "W" => $this->lang['sex_woman']), 'sex'), "{sex}"); $this->ShowSearch($JS); if ($JS) { $JS = <<<JS \$(document).ready(function() { \t{$JS} }); JS; } }