public function view_data() { $div = $this -> session -> userdata('user_group'); //getting the session user group $div2 = $this -> session -> userdata('district_province_id'); $data['emailsnsms'] = array(); if ($div == 1) { $data['emailsnsms'] = Emails::getNational(); } if ($div == 2) { $data['emailsnsms'] = Emails::getNational(); } if ($div == 3) { $data['emailsnsms'] = Emails::getRegional($div2); } if ($div == 4) { $data['emailsnsms'] = Emails::getDistrict($div2); } $data['title'] = "Email and SMS Management"; $data['module_view'] = "email_recipients_view"; $this -> base_params($data); }