Source for file places.component.php
* $Id: places.component.php 691 2008-04-07 13:55:39Z serov $
* @author Vendelev Artiom
protected function init() {
$this->tree =
$this->obj->places->tree;
$placeId =
$params['params'][1];
$limit =
$params['params'][3];
$page =
$params['params'][4];
$results =
$this->obj->places->GetPopularCountries(0, $page, $limit, $limit);
foreach($results as $res){
$num_rows =
$this->obj->places->getChildNodesCount(1);
$result =
$this->obj->places->GetCountry($placeId, $name, $page, $limit, true);
$data['data'] =
$result['data'];
$num_rows =
$result['num_rows'];
$data['pages'] =
Core::PageLister($limit, $num_rows, $page);
$this->GetSuggest($params, $data);
$placeId =
$params['params'][1];
$limit =
$params['params'][3];
$page =
$params['params'][4];
$result =
$this->obj->places->GetRegion($placeId, $name, $page, $limit, true);
$data['data'] =
$result['data'];
$data['pages'] =
Core::PageLister($limit, $result['num_rows'], $page);
$this->GetSuggest($params, $data);
$placeId =
$params['params'][1];
$limit =
$params['params'][3];
$page =
$params['params'][4];
$result =
$this->obj->places->GetCity($placeId, $name, $page, $limit, true);
$data['data'] =
$result['data'];
$data['pages'] =
Core::PageLister($limit, $result['num_rows'], $page);
$this->GetSuggest($params, $data);
$places_data =
$this->obj->places->GetLevel($this->current_place);
$places_cnt =
count($places_data) +
1;
'cnt_records' =>
$places_cnt,
$region['place_full_name'] =>
$places_data
$this->obj->tpl->Assign(array (
'current_title' =>
_('Choose a city'),
'cols' =>
$this->obj->places->PrepareColCount($places['cnt_records']),
'component_params' =>
implode('/', $url)
$this->obj->tpl->Display( 'places/' .
$template .
'.tpl');
$type = isset
($url[0]) ?
$url[0] :
'abc';
//$places = $this->obj->places->GetCitiesSortByAbc();
if ( $alphabet =
$this->GetAlphabet()){
$arr =
array ('current_title' =>
_('Choose a city by alphabet'), 'alphabet' =>
$alphabet);
$this->obj->tpl->Assign(array ('current_title' =>
_('Choose a city by alphabet') ) );
$this->obj->tpl->Assign(array ('alphabet' =>
$alphabet ) );
$places =
$this->obj->places->GetCitiesSortBySymbol(urldecode($url[1]));
$places =
$this->obj->places->GetCitiesSortBySymbol($alphabet[0]);
$arr['current_symbol'] =
$alphabet[0];
$this->obj->tpl->Assign( $arr );
$template =
'region_places';
$places =
$this->obj->places->GetCitiesSortByRegion();
$this->obj->tpl->Assign(array ('current_title' =>
_('Choose a city by region')));
$this->obj->tpl->Display('places/' .
$template .
'.tpl', array(
'places' =>
$places['records'],
'main_cities' =>
$main_cities,
'cnt_places' =>
$places['cnt_records'],
'component_params' =>
implode('/', $url)
$page =
$params['params'][0];
$limit =
$params['params'][1];
$country_id =
$params['params'][2];
$selected_place =
$params['params'][2];
$auto =
@$params['params'][4];
$num_rows =
$this->obj->places->getChildNodesCount(1);
$pages =
Core::PageLister($limit, $num_rows, $page, 5, $add_limit, ($num_rows >
($add_limit +
$limit)) ?
true :
false);
$countries =
$this->obj->places->GetPopularCountries($country_id, $page, $limit, @$pages['query_limit'] ?
$pages['query_limit'] :
0);
$countries =
$this->obj->places->GetCountry(1, $search_name, $page, $limit, true, 0);
$num_rows =
$countries['num_rows'];
$pages =
Core::PageLister($limit, $num_rows, $page, 5, $add_limit, false);
$countries =
$this->obj->places->GetCountry(1, $search_name, $page, $limit, false, @$pages['query_limit'] ?
$pages['query_limit'] :
0);
$this->obj->tpl->Assign(array(
'countries' =>
$countries,
'block_type' =>
'country',
'block_type_plural' =>
'Countries',
'country_id' =>
$country_id,
'selected_place' =>
$selected_place,
'search_name' =>
$search_name,
'data' =>
array('pages' =>
$pages),
$content =
$this->obj->tpl->Fetch('sch_users/registration/registration_school-choice__select-place.tpl');
if ($auto !=
1 &&
$selected_place)
$js =
'changecountry('.
$selected_place.
');';
if (count($countries) ==
1)
$this->Ajax('top_countries', $content, $js);
if (sizeof($params['params']) <
3)
$page = (int)
$params['params'][0];
$limit = (int)
$params['params'][1];
$country_id = (int)
$params['params'][2];
$selected_place =
@$params['params'][3];
$auto =
@$params['params'][5];
$num_rows =
$this->obj->places->getChildNodesCount($country_id);
$pages =
Core::PageLister($limit, $num_rows, $page, 5, $add_limit, ($num_rows >
($add_limit +
$limit)) ?
true :
false);
$regions =
$this->obj->places->GetPopularRegions($country_id, $page, $limit, $selected_place, @$pages['query_limit'] ?
$pages['query_limit'] :
0);
$regions =
$this->obj->places->GetRegion((int)
$country_id, $search_name, $page, $limit, true, 0);
$num_rows =
$regions['num_rows'];
$pages =
Core::PageLister($limit, $num_rows, $page, 5, $add_limit, false);
$regions =
$this->obj->places->GetRegion((int)
$country_id, $search_name, $page, $limit, false, @$pages['query_limit'] ?
$pages['query_limit'] :
0);
$this->obj->tpl->Assign(array(
'block_type' =>
'region',
'block_type_plural' =>
'Regions',
'country_id' =>
$country_id,
'selected_place' =>
$selected_place,
'search_name' =>
$search_name,
'data' =>
array('pages' =>
$pages),
$content =
$this->obj->tpl->Fetch('sch_users/registration/registration_school-choice__select-place.tpl');
//$content = print_r($params['params'], true);
$js =
($auto !=
3 &&
$selected_place) ?
'changeregion('.
$selected_place.
');' :
'';
if (count($regions) ==
1)
$this->Ajax('top_regions', $content, $js);
if (sizeof($params['params']) <
3)
$page =
$params['params'][0];
$limit =
$params['params'][1];
$region_id =
$params['params'][2];
$selected_place =
@$params['params'][3];
$num_rows =
$this->obj->places->getChildNodesCount($region_id);
$pages =
Core::PageLister($limit, $num_rows, $page, 5, $add_limit, ($num_rows >
($add_limit +
$limit)) ?
true :
false);
$cities =
$this->obj->places->GetPopularCities($region_id, $page, $limit, $selected_place, @$pages['query_limit'] ?
$pages['query_limit'] :
0);
$cities =
$this->obj->places->GetCity((int)
$region_id, $search_name, $page, $limit, true, 0);
$num_rows =
$cities['num_rows'];
$pages =
Core::PageLister($limit, $num_rows, $page, 5, $add_limit, false);
$cities =
$this->obj->places->GetCity((int)
$region_id, $search_name, $page, $limit, false, @$pages['query_limit'] ?
$pages['query_limit'] :
0);
$this->obj->tpl->Assign(array(
'block_type_plural' =>
'Cities',
'country_id' =>
$region_id,
'selected_place' =>
$selected_place,
'search_name' =>
$search_name,
'data' =>
array('pages' =>
$pages),
$content =
$this->obj->tpl->Fetch('sch_users/registration/registration_school-choice__select-place.tpl');
//$content = print_r($cities, true);
$js =
$selected_place ?
'changecity('.
$selected_place.
');' :
'';
$this->Ajax('top_cities', $content, $js);
Documentation generated on Thu, 03 Mar 2011 20:12:09 +0300 by phpDocumentor 1.4.3