示例#1
0
 /**
  * Return data for branding table settings popup
  * @return json
  * @author Ruslan Ushakov
  */
 public function getBrandingTableColumns()
 {
     $site_id = $this->input->post('site_id');
     $view = $this->input->post('view');
     $date_of_upload = $this->input->post('date_of_upload');
     $term_id = $this->input->post('term_id');
     if (($view == '1s1b' || $view == '1s1bpn') && !empty($term_id) && !empty($site_id) && !empty($date_of_upload)) {
         if (is_array($date_of_upload) && count($date_of_upload) > 1) {
             if ($view == '1s1b') {
                 $view = '1s1b1r_md';
             } else {
                 $view = '1s1bpn_md';
             }
         } else {
             if ($view == '1s1b') {
                 $view = '1s1b1r';
             } else {
                 $view = '1s1bpn';
             }
         }
     }
     if ('1s1bpn' == $view && is_array($date_of_upload) && count($date_of_upload) > 1) {
         $view = '1s1bpn_md';
     }
     if ($view == '1srv') {
         if (is_array($date_of_upload) && count($date_of_upload) > 1) {
             $view = '1srv_md';
         } else {
             $this->load->model('sites_model');
             if ($this->sites_model->hasAmazonInCollection($site_id) == 0) {
                 $view = '1srv_na';
             }
         }
     }
     $this->load->library('RankingTable');
     $result = $this->rankingtable->getColumnSettings($view);
     $this->output->set_content_type('application/json')->set_output(json_encode($result));
 }