load->model('pagination/AcceptedCreditRequests_model', 'acr_model'); } function getLists() { $data = $row = array(); // Fetch member's records $acrData = $this->acr_model->getRows($_POST); $i = $_POST['start']; $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL ); foreach ($acrData as $row) { $origin = $row->agent." | ".$row->phone; $destination = $row->name_parrain." | ".$row->phone_parrain; if ($row->codeMembre == $this->session->userdata('member_code')) { $origin = $this->lang->line('Vous'); } if ($row->codeParrain == $this->session->userdata('member_code')) { $destination = $this->lang->line('Vous'); } $disabled = $row->canceled_by_hypervisor ? "disabled" : ""; $data[] = array($row->demande_id, $origin, $destination, $fmt->format($row->montant), $row->dateAjout, $row->dateModif , traitementTemps($row->temps, $row->dateAjout,$this), getDelayOfTreatmentInSeconds($row->temps, $row->dateAjout)/60, ''); } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->acr_model->countAll($_POST), "recordsFiltered" => $this->acr_model->countFiltered($_POST), "data" => $data, ); // Output to JSON format echo json_encode($output); } }