function update_map($array_key_value, $where_array, $table) { foreach ($array_key_value as $key => $value) { $this->db->set($key, $value); } $this->db->where(getKeyOfArray($where_array), getValueOfArray($where_array))->update($table); }
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; }
<label><?php echo language_translate('contact_info_label_state'); ?> </label> <?php if ($userdataobj->id_state) { echo getValueOfArray(stateOptionData_ioc($userdataobj->id_country, $userdataobj->id_state)); } ?> <div class="clear sep"></div> <label><?php echo language_translate('contact_info_label_city'); ?> </label> <?php if ($userdataobj->id_city) { echo getValueOfArray(cityOptionData_ioc($userdataobj->id_country, $userdataobj->id_state, $userdataobj->id_city)); } ?> <div class="clear sep"></div> <label><?php echo language_translate('contact_info_label_address'); ?> </label> <?php echo $userdataobj->address; ?> <div class="clear sep"></div> <label><?php echo language_translate('contact_info_label_zip_code'); ?>
function quickEditUserFilter($data) { if ($data['country']) { $array['id_country'] = $data['country']; $array['country'] = getValueOfArray(countryOptionData_ioc($data['country'])); $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']; $array['address'] = NULL; $array['postal_code'] = NULL; } if ($data['gender']) { $array['chat_gender'] = $data['gender']; } if ($data['age_from']) { $array['chat_age_from'] = intval($data['age_from']); } if ($data['age_to']) { $array['chat_age_to'] = intval($data['age_to']); } if (!isset($array['longitude']) or !isset($array['latitude']) or !$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); } return; }
function checkRealEmail($email) { /** $array = json_decode(file_get_contents("http://verify-email.org/api.html?format=raw&usr=vaodiemm&pwd=lucnap&check=$email")); if($array['verify_status'] == '1'){ return true; } return false; **/ if (ENVIRONMENT == PYRO_DEVELOPMENT) { return true; } else { require_once "./asset/SMTP_validateEmail.php"; $SMTP = new SMTP_validateEmail(); $array = $SMTP->validate(array($email), '*****@*****.**'); if (getValueOfArray($array) == 1) { return true; } return false; } }