/** * Get All group params * @return json */ function getGroupParams() { $group_id = (int) $this->input->post('group_id'); $this->load->model('ranking_model'); $group_info = $this->ranking_model->getGroupInfoByGroupId($group_id); $sites = $this->ranking_model->getSitesForGroups($group_id); $keywords = $this->ranking_model->getTermsIdsByGroupId($group_id); $this->output->set_content_type('application/json')->set_output(json_encode(array('status' => 'ok', 'group_name' => $group_info->name, 'sites' => $sites, 'keywords' => $keywords, 'enabled' => $group_info->enabled))); }
public function GetKeywordsAndBrandsByItsGroups($group_id, $type) { $this->load->model('ranking_model'); if ($type == 'keyword') { $return = $this->ranking_model->getTermsIdsByGroupId($group_id); } else { if ($type == 'brand') { $return = $this->ranking_model->getRankingBrandsByGroupId($group_id); } else { $return = false; } } $this->output->set_content_type('application/json')->set_output(json_encode($return)); }