Esempio n. 1
0
 function changeFilterOptions()
 {
     extract($_POST);
     if ($country_id > 0) {
         $array['id_country'] = $country_id;
         $array['country'] = getValueOfArray(countryOptionData_ioc($country_id));
         if ($state_id > 0) {
             $array['id_state'] = $state_id;
             $array['state'] = getValueOfArray(stateOptionData_ioc($country_id, $state_id));
             if ($city_id > 0) {
                 $array['id_city'] = $city_id;
                 $array['city'] = getValueOfArray(cityOptionData_ioc($country_id, $state_id, $city_id));
                 $geo = $this->geo_lib->getCoordinatesFromAddress($array['city']);
                 $array['longitude'] = $geo['longitude'];
                 $array['latitude'] = $geo['latitude'];
             } else {
                 $array['id_city'] = 0;
                 $array['city'] = null;
                 $array['longitude'] = null;
                 $array['latitude'] = null;
             }
         } else {
             $geo = $this->geo_lib->getCoordinatesFromAddress($array['country']);
             $array['id_state'] = 0;
             $array['state'] = null;
             $array['id_city'] = 0;
             $array['city'] = null;
             $array['longitude'] = $geo['longitude'];
             $array['latitude'] = $geo['latitude'];
         }
     } else {
         $array['id_country'] = 0;
         $array['country'] = null;
         $array['id_state'] = 0;
         $array['state'] = null;
         $array['id_city'] = 0;
         $array['city'] = null;
         $array['longitude'] = null;
         $array['latitude'] = null;
     }
     $array['chat_gender'] = $gender;
     $array['chat_age_from'] = $age_from;
     $array['chat_age_to'] = $age_to;
     $array['address'] = $address;
     $array['postal_code'] = $zipcode;
     if (!$array['longitude'] or !$array['latitude']) {
         $infoArray = $this->geo_lib->getLocationInfoFromIP();
         $array['longitude'] = $infoArray['longitude'];
         $array['latitude'] = $infoArray['latitude'];
     }
     if ($id = getAccountUserId()) {
         $this->user_io_m->update_map($array, $id);
         echo 'ok';
         exit;
     }
     echo 'User not existed.';
 }
 function editAccountInfo()
 {
     $userdataobj = getAccountUserDataObject(true);
     if (!$this->phpvalidator->is_email($this->input->post('email'))) {
         echo json_encode(array('result' => 'ERROR', 'message' => 'Email is not valid format'));
         exit;
     }
     if (!checkRealEmail($this->input->post('email'))) {
         echo json_encode(array('result' => 'ERROR', 'message' => 'Email is not real'));
         exit;
     }
     $usercheckobj = $this->user_io_m->init('email', $this->input->post('email'));
     if ($usercheckobj and $userdataobj->id_user != $usercheckobj->id_user) {
         echo json_encode(array('result' => 'ERROR', 'message' => 'Email is used by other account.'));
         exit;
     }
     $new_email = $this->input->post('email');
     $country_id = $this->input->post('country_id', 0);
     $state_id = $this->input->post('state_id', 0);
     $city_id = $this->input->post('city_id', 0);
     if ($country_id > 0) {
         $update['id_country'] = $country_id;
         $update['country'] = getValueOfArray(countryOptionData_ioc($country_id));
         if ($state_id > 0) {
             $update['id_state'] = $state_id;
             $update['state'] = getValueOfArray(stateOptionData_ioc($country_id, $state_id));
             if ($city_id > 0) {
                 $update['id_city'] = $city_id;
                 $update['city'] = getValueOfArray(cityOptionData_ioc($country_id, $state_id, $city_id));
                 $geo = $this->geo_lib->getCoordinatesFromAddress($update['city']);
                 $update['longitude'] = $geo['longitude'];
                 $update['latitude'] = $geo['latitude'];
             } else {
                 $update['id_city'] = 0;
                 $update['city'] = null;
                 $geo = $this->geo_lib->getCoordinatesFromAddress($update['state']);
                 $update['longitude'] = $geo['longitude'];
                 $update['latitude'] = $geo['latitude'];
             }
         } else {
             $update['id_state'] = 0;
             $update['state'] = null;
             $update['id_city'] = 0;
             $update['city'] = null;
             $geo = $this->geo_lib->getCoordinatesFromAddress($update['country']);
             $update['longitude'] = $geo['longitude'];
             $update['latitude'] = $geo['latitude'];
         }
     }
     /*
     		else{
     			$update['id_country'] = 0;
     			$update['country'] = null;
     			$update['id_state'] = 0;
     			$update['state'] = null;
     			$update['id_city'] = 0;
     			$update['city'] = null;
     			$update['longitude'] = null;
     			$update['latitude'] = null;
     		}*/
     $update['first_name'] = $this->input->post('first_name');
     $update['last_name'] = $this->input->post('last_name');
     //$update['email'] = $this->input->post('email');
     $update['cell_no'] = $this->input->post('cell_no');
     $update['address'] = $this->input->post('address');
     $update['postal_code'] = $this->input->post('postal_code');
     $update['timezone'] = $this->input->post('timezone');
     $update['dob'] = dbDay($this->input->post('birthday'));
     $this->user_io_m->update_map($update, $userdataobj->id_user);
     if ($new_email != $userdataobj->email) {
         $checkemail = "<br/>You have changed email account, please go to your email inbox and click on the link to active new email.";
         $this->email_sender->juzonSendEmail_JUZ_ACCOUNT_CHANGED_EMAIL($userdataobj->id_user, $new_email);
     } else {
         $checkemail = '';
     }
     echo json_encode(array('result' => 'ok', 'message' => 'Update successfully.' . $checkemail));
     exit;
 }
Esempio n. 3
0
		<?php 
    echo form_dropdown($name = 'state_id', stateOptionData_ioc($country_id = $userdataobj->id_country), array($userdataobj->id_state), $extra = " id='state_id' class='account-profile' ");
    ?>
		<?php 
    echo loader_image_s("id='state_loader' class='hidden'");
    ?>
	</div>
	<div class="clear"></div>
	
	<label><?php 
    echo language_translate('contact_info_label_city');
    ?>
</label> 
	<div class="inputcls">
		<?php 
    echo form_dropdown($name = 'city_id', cityOptionData_ioc($country_id = $userdataobj->id_country, $state_id = $userdataobj->id_state), array($userdataobj->id_city), $extra = " id='city_id' class='account-profile' ");
    ?>
		<?php 
    echo loader_image_s("id='city_loader' class='hidden'");
    ?>
	</div>
	<div class="clear"></div>
	
	<label><?php 
    echo language_translate('contact_info_label_address');
    ?>
</label> 
	<div class="inputcls">
		<textarea class="textareacls" name="address" ><?php 
    echo $userdataobj->address;
    ?>