59 lines
1.6 KiB
PHP
Executable File
59 lines
1.6 KiB
PHP
Executable File
<?php
|
|
defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
|
|
class AcceptedCreditRequests extends CI_Controller
|
|
{
|
|
|
|
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
|
|
// Load member model
|
|
$this->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,
|
|
'<button id="cancelDemand" class="btn btn-danger" data-id-demand="'.$row->demande_id.'"'.$disabled .'>'. $this->lang->line('cancel') .'</button>');
|
|
}
|
|
|
|
$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);
|
|
}
|
|
|
|
}
|