56 lines
1.6 KiB
PHP
56 lines
1.6 KiB
PHP
|
<?php
|
||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||
|
|
||
|
use Brick\Money\Context\AutoContext;
|
||
|
use Brick\Money\CurrencyConverter;
|
||
|
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
|
||
|
use Brick\Money\ExchangeRateProvider\PDOProvider;
|
||
|
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
|
||
|
use Brick\Money\Money;
|
||
|
|
||
|
class CareRequests extends CI_Controller
|
||
|
{
|
||
|
private $context = null;
|
||
|
|
||
|
function __construct()
|
||
|
{
|
||
|
parent::__construct();
|
||
|
|
||
|
// Load member model
|
||
|
$this->load->model('pagination/CareRequests_model', 'model');
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
function getLists()
|
||
|
{
|
||
|
$data = $row = array();
|
||
|
|
||
|
// Fetch member's records
|
||
|
$witData = $this->model->getRows($_POST);
|
||
|
|
||
|
$i = $_POST['start'];
|
||
|
$current_url = $_POST['currentURL'];
|
||
|
foreach ($witData as $row) {
|
||
|
$buttons = "<button class='btn btn-success treat-demand' style='margin-right: 10px;' data-id='$row->id' data-action='ACCEPT'>".$this->lang->line('accept')."</button>".
|
||
|
"<button class='btn btn-danger treat-demand' data-id='$row->id' data-action='REJECT'>".$this->lang->line('reject')."</button>";
|
||
|
|
||
|
$data[] = array($row->request_id , $row->user_lastname.' '.$row->user_firstname , $row->user_phone, $row->act_code , $row->act_name,
|
||
|
mb_strtoupper($this->lang->line($row->state),'UTF-8'), $row->created_at , $row->state === 'UNDER_VALIDATION' ? $buttons : null);
|
||
|
|
||
|
}
|
||
|
|
||
|
$output = array(
|
||
|
"draw" => $_POST['draw'],
|
||
|
"recordsTotal" => $this->model->countAll($_POST),
|
||
|
"recordsFiltered" => $this->model->countFiltered($_POST),
|
||
|
"data" => $data,
|
||
|
);
|
||
|
|
||
|
// Output to JSON format
|
||
|
echo json_encode($output);
|
||
|
}
|
||
|
|
||
|
}
|