コード例 #1
0
 function index()
 {
     $html_syntext = $_POST['html_syntext'];
     //echo $html_syntext;
     $property_info = json_decode($html_syntext, TRUE);
     $position = mb_strrpos($property_info[3], "\\");
     $filename = mb_substr($property_info[3], $position + 1);
     $filelocation = base_url() . 'assets/images/property_listing/' . $filename;
     //$this->load->model('cb_manage_property');
     $property_info['Name'] = $property_info[1];
     $property_info['Price'] = $property_info[2];
     //$property_info['Property_info_image'] = $property_info[3];
     $property_info['Property_info_image'] = $filelocation;
     //$this->cb_manage_property->set_property_info(json_encode($property_info));
     $gen_func = new GeneralFunc();
     $val_return = $gen_func->CB_Send_Service_Request("CB_Property:create_request", json_encode($property_info));
     //echo $return;
 }
コード例 #2
0
 private function _get_about_us()
 {
     $val_return = GeneralFunc::CB_Receive_Service_Request("CB_Ressphere_Home:get_about_us");
     $about_us = json_decode($val_return, TRUE);
     $text = "<strong>Ressphere</strong> is founded on 17th of March, 2014.<BR> \r\n           Ressphere's vision is to create a platform that joins people from different background, different location, having different interest, mastering different expertise together to communicate and collaborate. \r\n           <br> \r\n           Its name is derived from “Resonance/Resolution” and “Sphere” which symbolizes a society that contains people from all around the world where they can work together to achieve consensus that bring the best solution to each other.\r\n           <br><br> \r\n           <B>We strike to achieve 4 missions that is aligned with our vision</B><br>\r\n           <ol><li>Affiliate join forces by creating a boundaryless environment</li>\r\n               <li>Communicate - prepare an effective and efficient communication channel via internet</li>\r\n               <li>Enhance - build an online society that complement daily life</li>\r\n               <li>Secure - create a safe and trustworthy virtual online platform</li>\r\n            </ol><br>\r\n            <B>We aim to complete our A.C.E.S missions with </B><br>\r\n            <ul>\r\n            <li>Superior competency</li>\r\n            <li>Passionate attitude</li>\r\n            <li>Intelligent solution</li>\r\n            <li>Contemporary style</li>\r\n            <li>Endless creativity</li>\r\n            </ul><br>\r\n            The company now offers a circle binding platform, property circle and service circle. <br>\r\n            In the future, where there will be more circles that touch on different parts of our life to be launched.";
     if (count($about_us["data"]["result"]) > 0) {
         $text = html_entity_decode($about_us["data"]["result"][0]['content']);
         $text = html_entity_decode($text);
     }
     $news = array();
     array_push($news, array('text', $text));
     return $news;
 }
コード例 #3
0
 private function set_property_info_list($ref_tag)
 {
     $ref_param = array("ref_tag" => $ref_tag);
     $val_return_json = GeneralFunc::CB_SendReceive_Service_Request("CB_Property:listing_detail", json_encode($ref_param));
     $val_return = json_decode($val_return_json, TRUE);
     if ($val_return["status_information"] === sprintf("Info: Successfully retrieve data for %s", $ref_tag)) {
         $this->session->set_userdata('owner_email', $val_return["data"]["email"]);
         $this->session->set_userdata('ref_tag', $ref_tag);
         $this->property_info_list = $val_return["data"];
     } else {
         $error = "Your selected property does not exist";
         show_error($this->get_listing_not_found($error), 300, "");
     }
 }
コード例 #4
0
 public function activate_listing($ref_tag, $user_id, $activate, &$val_return_array)
 {
     $activate_data = array();
     $activate_data["ref_tag"] = $ref_tag;
     $activate_data["user_id"] = $user_id;
     $activate_data["activate"] = $activate;
     if ($activate === "true") {
         if (!$this->is_listing_available($user_id)) {
             return FALSE;
         }
     }
     $val_return = GeneralFunc::CB_SendReceive_Service_Request("CB_Property:change_listing_activate", json_encode($activate_data));
     $val_return_array = json_decode($val_return, true);
     if ($val_return_array["status_information"] === "Info: Complete change activation status") {
         return TRUE;
     }
     return FALSE;
 }
コード例 #5
0
ファイル: base.php プロジェクト: ressphere/cb_iloveproperty
 public function get_list_of_currency()
 {
     $val_return = GeneralFunc::CB_Receive_Service_Request("CB_Currency:get_currency_list");
     $this->_print($val_return);
 }
コード例 #6
0
 public function begin_reset_password()
 {
     $CI =& get_instance();
     $CI->load->helper('url');
     $CI->load->library('session');
     $CI->load->library('extemplate');
     $msg = "";
     $success = TRUE;
     $data = NULL;
     $forgot_pass_obj = NULL;
     $pass = $this->_get_posted_value('password');
     $confirmed_pass = $this->_get_posted_value('confirmed_password');
     if (is_null($pass)) {
         $msg = "<span class='error'>Password cannot be empty</span>";
         $success = FALSE;
     } elseif (is_null($confirmed_pass)) {
         $msg = "<span class='error'>Confirmed password cannot be empty</span>";
         $success = FALSE;
     } elseif ($confirmed_pass !== $pass) {
         $msg = "<span class='error'>Password does not match with confirmed password</span>";
         $success = FALSE;
     }
     if ($success) {
         $data["new_password"] = $pass;
         $forgot_pass_obj = $CI->session->userdata("forgotpassword");
         if (!$forgot_pass_obj && (!isset($forgot_pass_obj["user_id"]) || !isset($forgot_pass_obj["new_pass_key"]))) {
             $msg = var_dump($forgot_pass_obj);
             //$data['new_pass_key'];
             $success = FALSE;
         } else {
             #$msg = var_dump($forgot_pass_obj);
             $data['user_id'] = $forgot_pass_obj["user_id"];
             $data['new_pass_key'] = $forgot_pass_obj["new_pass_key"];
         }
     }
     if ($success) {
         $val_return = GeneralFunc::CB_SendReceive_Service_Request("CB_Member:reset_password", json_encode($data));
         $data = json_decode($val_return, TRUE);
         $data = $data["data"]["result"];
         if (!is_null($data)) {
             $data['site_name'] = $CI->config->item('website_name');
             if (isset($data["error"])) {
                 $success = FALSE;
                 $msg = $data["error"];
                 #$msg = "<span class='error'>" . var_dump($forgot_pass_obj) . "</span>";
             } else {
                 $success = TRUE;
                 $msg = "Success";
             }
         } else {
             $msg = "<span class='error'>Your password cannot been reset, please check with the admin.</span>";
             $success = FALSE;
         }
     }
     $data["msg"] = $msg;
     $this->_print(json_encode($data));
 }
コード例 #7
0
 public function get_converted_currency_value()
 {
     $currency_value = $this->_get_posted_value('currency_value');
     $from_currency = $this->_get_posted_value('from_currency');
     $to_currency = $this->_get_posted_value('to_currency');
     $argument = json_encode(array("currency_value" => $currency_value, "from_currency" => $from_currency, "to_currency" => $to_currency));
     $val_return_json = GeneralFunc::CB_SendReceive_Service_Request("CB_Currency:get_converted_currency_value", $argument);
     $val_return = json_decode($val_return_json, TRUE);
     $converted_currency_value = $val_return['data']['result'];
     $this->_print($converted_currency_value);
 }
コード例 #8
0
 public function test_gateway()
 {
     $command_array = array();
     $this->client->__soapCall("_CB_Test_Gateway", array($command_array));
     $basic_component_set = GeneralFunc::filterSoapMessage($this->client->__getLastResponse());
     return json_encode($basic_component_set);
 }
コード例 #9
0
 protected function _check_recaptcha($website_name, $response_field, $challenge_field)
 {
     $captcha_code["remote_addr"] = $website_name;
     $captcha_code["challenge_field"] = $challenge_field;
     $captcha_code["response_field"] = $response_field;
     $val_return_json = GeneralFunc::CB_SendReceive_Service_Request("CB_Member:check_recaptcha", json_encode($captcha_code));
     $val_return = json_decode($val_return_json, TRUE);
     return $val_return["data"]["result"];
 }
コード例 #10
0
 function obtain_search_result()
 {
     // display per page
     $limit = 9;
     //
     $search_result["nav_total_page"] = 0;
     $search_result["total_result"] = 0;
     $search_result["search_result"] = array();
     $ref_tag_list = array();
     // Special handle for property_type_selection
     $property_category_selection = $this->_get_array_value($_GET, "property_category_selection");
     if ($property_category_selection === "All Category") {
         $property_category_selection = NULL;
     }
     $property_type_selection = $this->_get_array_value($_GET, "property_type_selection");
     if ($property_type_selection === "All Type") {
         $property_type_selection = NULL;
     }
     // Process page nav if no pass in
     $page_nav_num = $this->_get_array_value($_GET, "nav_page");
     if ($page_nav_num == NULL || $page_nav_num <= 0) {
         $page_nav_num = 1;
     }
     $origin_max = $this->_get_array_value($_GET, "max_price");
     $origin_min = $this->_get_array_value($_GET, "min_price");
     $origin_currency = $this->_get_array_value($_GET, "currency");
     $measurement_max = $this->_get_array_value($_GET, "max_sqft");
     $measurement_min = $this->_get_array_value($_GET, "min_sqft");
     $origin_measurement_type = $this->_get_array_value($_GET, "measurement_type");
     //$supported_currency = $this->get_currency_list();
     //$val_return = GeneralFunc::CB_SendReceive_Service_Request("CB_Currency:get_currency_list", NULL);
     $supported_currency = $this->get_currency_list();
     //$supported_currency = json_decode($val_return, TRUE)['data']['result'];
     for ($i = 0; $i < count($supported_currency); $i++) {
         $currency_enum_to_string = $this->convert_currency_from_enum_to_string($i);
         for ($j = 0; $j < measurement_type::__len; $j++) {
             $price_range = $this->construct_currency_range($origin_max, $origin_min, $origin_currency, $i);
             $width_range = $this->construct_width_range($measurement_max, $measurement_min, $origin_measurement_type, MeasurementFactory::get_measurement_type_string($j));
             $filter_array = array("limit" => $limit, "offset" => $limit * ($page_nav_num - 1), "filter" => array("activate" => 1, "service_type" => $this->session->userdata('action'), "state" => $this->_get_array_value($_GET, "selected_state"), "country" => $this->_get_array_value($_GET, "selected_country"), "property_category" => $property_category_selection, "property_type" => $property_type_selection, "unit_name" => $this->_get_array_value($_GET, "place_name"), "price <=" => $price_range[1] === "" || $price_range[1] === "0.00" ? NULL : $price_range[1], "price >=" => $price_range[0], "buildup <=" => $width_range[1] === "" || $width_range[1] === "0.00" ? NULL : $width_range[1], "buildup >=" => $width_range[0], "currency" => $currency_enum_to_string, "size_measurement_code" => MeasurementFactory::get_measurement_type_string($j)));
             // Invoke webservice to retrieve filter data
             $service = "CB_Property:filter_listing";
             $val_return = GeneralFunc::CB_SendReceive_Service_Request($service, json_encode($filter_array));
             if ($val_return === NULL) {
                 continue;
             }
             $val_return_json_array = json_decode($val_return, true);
             // @todo - require better error handing
             $val_return_array = $val_return_json_array["data"];
             // Align the data with output requirement
             foreach ($val_return_array["listing"] as $query_data) {
                 if (in_array($query_data["ref_tag"], $ref_tag_list)) {
                     $val_return_array["count"] = $val_return_array["count"] - 1;
                 } else {
                     $data = $this->convert_search_result_to_data($query_data);
                     array_push($search_result["search_result"], $data);
                     array_push($ref_tag_list, $data["ref_tag"]);
                 }
             }
             $search_result["nav_total_page"] += ceil($val_return_array["count"] / $limit);
             $search_result["total_result"] += $val_return_array["count"];
         }
     }
     echo json_encode($search_result);
 }
コード例 #11
0
 public function is_user_allowed_to_create_new_listing()
 {
     $user_id = $this->session->userdata('user_id');
     $allowed = true;
     if ($user_id) {
         //setup the listing filter by user id
         $filter_struct["filter"]["user_id"] = $user_id;
         $filter_struct["filter"]["activate"] = 1;
         //get the filtered listing details
         $user_listing_limit = GeneralFunc::CB_SendReceive_Service_Request("CB_Member:get_user_property_listing_limit", json_encode($user_id));
         $listing_limit = json_decode($user_listing_limit, TRUE)["data"]["result"];
         $user_existing_listing = GeneralFunc::CB_SendReceive_Service_Request("CB_Property:filter_listing", json_encode($filter_struct));
         $number_of_listings = sizeof(json_decode($user_existing_listing, TRUE)["data"]["listing"]);
         if ($number_of_listings < $listing_limit) {
             $allowed = true;
         } else {
             $allowed = false;
         }
         return $allowed;
     } else {
         $this->set_error("function:get_number_of_listings failed with invalid user id: (" . $user_id . ")");
     }
 }
コード例 #12
0
 protected function _get_wsdl_base_url()
 {
     $val_return = GeneralFunc::CB_Receive_Service_Request("CB_Info:base_url");
     $wsdl_base_url = json_decode($val_return, TRUE);
     $wsdl_base_url = $wsdl_base_url["data"]["result"];
     return $wsdl_base_url;
 }
コード例 #13
0
 public function SendReceive_Service($service, $argument)
 {
     // Benchmark the function required time
     $this->benchmark->mark("ws_code_start");
     $val_return = GeneralFunc::CB_SendReceive_Service_Request($service, $argument);
     $this->benchmark->mark("ws_code_end");
     $data = "{$service} - " . $this->benchmark->elapsed_time('ws_code_start', 'ws_code_end');
     $this->benchmark_dump_file($data);
     return $val_return;
 }