Example #1
0
 public function actionGetList($page = null)
 {
     if ($page == "agent") {
         $modelProfile = new UserAgentProfile();
         $country_id = isset($_POST['UserAgentProfile']['country_id']) ? $_POST['UserAgentProfile']['country_id'] : '';
     } elseif ($page == "builder") {
         $modelProfile = new UserBuilderProfile();
         $country_id = isset($_POST['UserBuilderProfile']['country_id']) ? $_POST['UserBuilderProfile']['country_id'] : '';
     } elseif ($page == "specialist") {
         $modelProfile = new UserSpecialistProfile();
         $country_id = isset($_POST['UserSpecialistProfile']['country_id']) ? $_POST['UserSpecialistProfile']['country_id'] : '';
     } else {
         $modelProfile = new UserProfiles();
         $country_id = isset($_POST['UserProfiles']['country_id']) ? $_POST['UserProfiles']['country_id'] : '';
     }
     $list = null;
     if ($country_id != "") {
         $list = GeoStateApi::getList($country_id);
     }
     if ($page == 'register') {
         $this->renderPartial('getListRegister', array('list' => $list, 'modelProfile' => $modelProfile, 'page' => $page));
     } elseif ($page == "agent" || $page == "builder" || $page == "specialist") {
         $this->renderPartial('getListProfile', array('list' => $list, 'modelProfile' => $modelProfile, 'page' => $page));
     } else {
         $this->renderPartial('getList', array('list' => $list, 'modelProfile' => $modelProfile, 'page' => $page));
     }
 }
Example #2
0
 public function actionGetCityList($state = '', $model = '', $display = 'table', $class = null)
 {
     if (!$model) {
         $model = new GeoCity();
     }
     if (!$class) {
         $class = 'select_box';
     }
     $stateId = '';
     if (isset($_POST['GeoState']['state'])) {
         $stateId = $_POST['GeoState']['state'];
     } elseif ($state) {
         $state = GeoStateApi::getState($state);
         if ($state) {
             $stateId = $state->id;
         }
     }
     if ($stateId) {
         $list = GeoCityApi::getList($stateId);
     } else {
         $list = GeoCityApi::getCityList($stateId);
     }
     //	$list = null;
     $this->renderPartial('getCityList', array('list' => $list, 'model' => $model, 'display' => $display, 'class' => $class));
 }
		</tr>
		</table>
		</div>
	</li>
	<li>
		<h3>Location</h3>	
		<div class="acc-section">
		
			<div id="state_content" class="pad10"><ul>
			<li><span><?php 
echo $form->label($modelState, 'id');
?>
</span></li>
			 <li>
			<?php 
echo $form->dropdownList($modelState, 'id', GeoStateApi::getStateListByCountry('india'), array('empty' => 'All', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('/location/city/getList/page/register'), 'update' => '#city_content', 'data' => 'js:jQuery(this).serialize()')));
?>
</li>
			<li class="error_message"><?php 
echo $form->error($modelState, 'id');
?>
</li>
			</ul>
			<div id="city_content" class="pad10">
			<ul>
			<li><span><?php 
echo $form->label($modelCity, 'id');
?>
</span></li>
			<li>
			<?php