2021-11-19 05:10:52 +00:00
|
|
|
<?php
|
|
|
|
defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
|
|
|
|
class GeolocatedUsers extends CI_Controller
|
|
|
|
{
|
|
|
|
|
|
|
|
function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
|
|
|
|
// Load member model
|
|
|
|
$this->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("<button class='btn btn-default btn-center openSupervisorModal' data-code_parrain='$row->code_parrain'>$code_parrain</button>",
|
|
|
|
$row->lastname,$row->adresse, $row->code_membre , $row->email, $row->phone , $row->provider_class ,$status);
|
|
|
|
|
2022-01-24 08:08:05 +00:00
|
|
|
if($_POST['category'] == 'geolocated'){
|
|
|
|
if($row->has_qr_code)
|
|
|
|
$data[] = "<a href='" . WALLET_SERVICE_URL . "/qrcodes/agents/" . $row->id . ".pdf' class='btn btn-success btn-center' target='_blank'>" . $this->lang->line('display') . "</a>";
|
|
|
|
else
|
|
|
|
$data[] = "<button class='btn btn-primary btn-center generateQRCode' data-id_agent='$row->id'>" . $this->lang->line('generate') . "</button>";
|
|
|
|
}
|
2021-11-19 05:10:52 +00:00
|
|
|
|
|
|
|
if ($this->session->userdata("category") == "0" or $this->session->userdata("category") == "hyper")
|
2022-01-24 08:08:05 +00:00
|
|
|
$data[] = "<button data-toggle='modal' data-category='$row->category' data-lastname='$row->lastname' data-adresse='$row->adresse' data-network_agent_id='$row->network_agent_id' data-provider_class_id='$row->provider_class_id'
|
|
|
|
data-network='$row->network' data-member_code='$row->code_membre' data-email='$row->email' data-phone='$row->phone' class='open-modal modif btn btn-success' data-target='#editModal'><i class='fa fa-edit'></i></button>";
|
2021-11-19 05:10:52 +00:00
|
|
|
|
|
|
|
|
2022-01-24 08:08:05 +00:00
|
|
|
$list[] = $data;
|
2021-11-19 05:10:52 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$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);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|