function ajax_get_key() { $response = array(); if (isset($_POST["state_name"])) { $state_code = get_state_by_name($_POST["state_name"]); $response["state_code"] = $state_code; } if (isset($_POST["country_name"])) { $country_code = get_country_by_name($_POST["country_name"]); $response["country_code"] = $country_code; } return $response; }
function wt_get_map_str($values = array()) { $address = array(); $country = ""; if (!empty($values["venue_address"])) { $address[] = $values["venue_address"]; } if (!empty($values["venue_city"])) { $address[] = $values["venue_city"]; } if (!empty($values["venue_state"])) { $address[] = get_state_by_name($values["venue_state"]); } if (!empty($values["venue_country"])) { $country = get_country_by_name($values["venue_country"]); } return array("address" => implode($address, ","), "country" => $country); }
public function db_in($post = null) { global $current_user; if (!$post) { $post = $this->data; } if ($post) { $db = $this->dbprepere; $state_code = $post["venue_state"]; $country_code = get_country_by_name($post["venue_country"]); if (!empty($post["venue_state"]) && $country_code == "US") { $state_code = get_state_by_name($post["venue_state"]); if (!$state_code) { $state_code = strtoupper($post["venue_state"]); } } $data = array("venue_name" => $db->str_in($post["venue_name"]), "venue_order" => $db->int_in($post["venue_order"]), "venue_phone" => $db->str_in($post["venue_phone"]), "venue_zip" => $db->str_in($post["venue_zip"]), "venue_address" => $db->str_in($post["venue_address"]), "venue_city" => $db->str_in($post["venue_city"]), "venue_state" => $state_code, "venue_country" => $country_code, "venue_info" => $db->html_in($post["venue_info"]), "venue_url" => $db->link_in($post["venue_url"]), "venue_publish_date" => current_time("mysql", 0), "venue_tour_status" => $db->int_in($post["venue_tour_status"]), "venue_gallery_status" => $db->int_in($post["venue_gallery_status"]), "venue_video_status" => $db->int_in($post["venue_video_status"]), "venue_flickr_status" => $db->int_in($post["venue_flickr_status"]), "venue_post_status" => $db->int_in($post["venue_post_status"]), "venue_author" => $current_user->ID); } return parent::db_in($data); }