load->model('pagination/GeolocatedUsers_model', 'gu_model'); } function getLists() { $list = array(); // Fetch member's records $datas = $this->gu_model->getRows($_POST); foreach ($datas as $row) { $status = $this->lang->line($row->active==1 ? 'Oui' : 'Non'); $code_parrain = $row->code_parrain; if($row->code_parrain==$this->session->userdata('member_code')){ $code_parrain = $this->lang->line("Vous"); } $data = array("", $row->lastname,$row->adresse, $row->code_membre , $row->email, $row->phone , $row->provider_class ,$status); if($_POST['category'] == 'geolocated'){ if($row->qr_code) $data[] = "" . $this->lang->line('display') . ""; else $data[] = ""; } if ($this->session->userdata("category") == "0" or $this->session->userdata("category") == "hyper") $data[] = ""; $list[] = $data; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->gu_model->countAll($_POST), "recordsFiltered" => $this->gu_model->countFiltered($_POST), "data" => $list, ); // Output to JSON format echo json_encode($output); } }