method : 'feed', link : '<?php echo base_url() . uri_string(); ?> ', caption: 'KEPPO.MY', picture: '<?php echo $image_url; ?> ', name:'<?php echo $merchant_name; ?> ', description: '<?php echo limit_character($description, 150, 1); ?> ' }, function(response) { if (response && !response.error_code) { //alert('Post was published.'); $.ajax({ type: "POST", url: post_url, dataType: "json", data: "&advertise_id=" + the_id + "&advertise_type=mua", }); } else { //alert('Post was not published.'); }
public function merchant_dashboard($slug = NULL, $bottom_part = NULL, $user_id = NULL) { $the_row = FALSE; if ($user_id != NULL) { $the_row = $this->m_custom->get_one_table_record('users', 'id', $user_id, 0, 0, 'main_group_id', $this->group_id_merchant, 1); } if (!$the_row) { $the_row = $this->m_custom->get_one_table_record('users', 'id', $bottom_part, 0, 0, 'main_group_id', $this->group_id_merchant, 1); } if (!$the_row) { $the_row = $this->m_custom->get_one_table_record('users', 'id', $slug, 0, 0, 'main_group_id', $this->group_id_merchant, 1); } if (!$the_row) { $the_row = $this->m_custom->get_one_table_record('users', 'slug', $slug, 0, 0, 'main_group_id', $this->group_id_merchant, 1); } if ($the_row) { $user_id = $the_row->id; $this->data['image_path'] = $this->album_merchant_profile; $this->data['image'] = $the_row->profile_image; $this->data['company_name'] = $the_row->company; $this->data['browser_title'] = $the_row->company; $this->data['address'] = $the_row->address; $this->data['description'] = $the_row->description; $this->data['phone'] = $the_row->phone; $this->data['show_outlet'] = base_url() . 'all/merchant_outlet/' . $slug . '/' . $user_id; $this->data['website_url'] = $the_row->me_website_url; $this->data['facebook_url'] = $the_row->me_facebook_url; //$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message'))); $this->data['message'] = NULL; $this->data['page_path_name'] = 'merchant/dashboard'; $this->data['hot_deal'] = base_url() . 'all/merchant-dashboard/' . $slug . '//' . $user_id . '#dashboard-navigation'; $this->data['candie_promotion'] = base_url() . 'all/merchant-dashboard/' . $slug . '/promotion/' . $user_id . '#dashboard-navigation'; $this->data['user_picture'] = base_url() . 'all/merchant-dashboard/' . $slug . '/picture/' . $user_id . '#dashboard-navigation'; $this->data['user_upload_for_merchant'] = base_url() . 'user/upload_for_merchant/' . $user_id; $this->data['show_expired'] = "<a href='" . base_url() . "all/album_merchant/'. {$slug}>Show Expired</a><br/>"; $this->data['user_id'] = $user_id; //$this->data['me_is_halal'] = $the_row->me_is_halal; $this->data['me_halal_way'] = $the_row->me_halal_way; // $me_is_halal = $the_row->me_is_halal; // $this->data['checkbox_halal'] = array( // 'name' => 'checkbox_halal', // 'id' => 'checkbox_halal', // 'checked' => $me_is_halal == "1" ? TRUE : FALSE, // 'value' => $the_row->me_is_halal, // ); //FOLLOWER or FOLLOWING COUNT $this->data['follower_count'] = $this->albert_model->follower_count($user_id); $this->data['following_count'] = $this->albert_model->following_count($user_id); $this->data['temp_folder'] = $this->temp_folder; $meta = array(array('property' => 'og:type', 'content' => 'article'), array('property' => 'og:title', 'content' => $the_row->company), array('property' => 'og:description', 'content' => limit_character($the_row->address, 150)), array('property' => 'og:image', 'content' => base_url() . $this->album_merchant_profile . $the_row->profile_image)); $this->data['meta_fb'] = meta_fb($meta); if ($bottom_part == 'promotion') { $this->data['hotdeal_list'] = $this->m_custom->getAdvertise('pro', NULL, $user_id, 1, NULL, NULL, 0, 0, 0, 0, 1); $this->data['title'] = "Redemption"; $this->data['bottom_path_name'] = 'share/redemption_grid_list5_old'; //ADVERTISE SUGGESTION $where_user = array('id' => $user_id); $main_category_id = $this->albert_model->read_user($where_user)->row()->me_category_id; $where_read_category2 = array('main_category_id' => $main_category_id); $result_array_sub_category_id = $this->albert_model->read_category($where_read_category2)->result_array(); $array_sub_category_id = array_column($result_array_sub_category_id, 'category_id'); $this->data['query_advertise_suggestion'] = $this->albert_model->read_advertise_redemption_suggestion($array_sub_category_id)->result_array(); $this->data['advertise_suggestion_page_path_name'] = 'all/hot_deal_list_suggestion'; $this->data['advertise_suggestion_page_title'] = 'Redemption Suggestion'; } else { if ($bottom_part == 'picture') { $this->data['album_list'] = $this->m_custom->getAlbumUserMerchant(NULL, $user_id); $this->data['title'] = "User's Pictures"; $this->data['bottom_path_name'] = 'all/album_user_merchant'; } else { $this->data['hotdeal_list'] = $this->m_custom->getAdvertise('hot', NULL, $user_id, 1, NULL, NULL, 0, 0, 0, 0, 1); $this->data['title'] = "Food & Beverage"; $this->data['bottom_path_name'] = 'share/hot_deal_grid_list5_old'; //ADVERTISE SUGGESTION $where_user = array('id' => $user_id); $main_category_id = $this->albert_model->read_user($where_user)->row()->me_category_id; $where_read_category2 = array('main_category_id' => $main_category_id); $result_array_sub_category_id = $this->albert_model->read_category($where_read_category2)->result_array(); $array_sub_category_id = array_column($result_array_sub_category_id, 'category_id'); $this->data['query_advertise_suggestion'] = $this->albert_model->read_advertise_hot_deal_suggestion($array_sub_category_id)->result_array(); $this->data['advertise_suggestion_page_path_name'] = 'all/hot_deal_list_suggestion'; $this->data['advertise_suggestion_page_title'] = 'Food & Beverage Suggestion'; } } $this->data['message'] = $this->session->flashdata('message'); $this->load->view('template/index_background_blank', $this->data); } else { redirect('/', 'refresh'); } }