Init Nano Sante

This commit is contained in:
Djery-Tom 2021-10-05 07:34:11 +01:00
parent e4dc4be372
commit a377a99f4d
11 changed files with 1073 additions and 222 deletions

View File

@ -1616,11 +1616,11 @@ class Gestion extends CI_Controller
}elseif ($taux->type == 'autre') {
$res = $this->wallet_model->getSharingRateByNetwork($network_id);
$data['commission'] = $res ? $res->first_row()->balance_com : 0 ;
}elseif($taux->type == 'ilink_sante'){
}
$hyper = $this->wallet_model->getNetworkHyper($network_id)->first_row();
$data['walletHyper'] = $this->wallet_model->getWallet($hyper->agent_id);
$data['network_id'] = $network_id;
@ -1640,6 +1640,8 @@ class Gestion extends CI_Controller
$this->load->view('gestion_wallet');
elseif ($taux->type == 'ilink')
$this->load->view('gestion_wallet_ilink');
// elseif ($taux->type == 'ilink_sante')
// $this->load->view('nano_health/admin/gestion_wallet_ilink_sante');
elseif ($taux->type == 'autre')
$this->load->view('gestion_wallet_autre');
$this->load->view('footer');
@ -1664,18 +1666,21 @@ class Gestion extends CI_Controller
{
if($this->isLogged()){
if (isset($_POST)) {
$country_id = $_POST['country_id'];
$network_id = $_POST['network_id'];
$type = $_POST['type'];
$res = false;
if($method == 'create')
{
$res = $this->wallet_model->addConfigWallet($network_id , $type);
// if($res)
// $this->generateAllWallets($network_id);
if($method == 'create') {
if($type == 'ilink'){
$exist = $this->wallet_model->verifyConfigWalletInCountry($type,$country_id);
if($exist){
echo json_encode("403");
return;
}
else if($method == 'update'){
}
$res = $this->wallet_model->addConfigWallet($network_id , $type);
} else if($method == 'update'){
if($type == 'visa'){
$taux_client_r = $_POST['taux_client_r'];
@ -1852,6 +1857,22 @@ class Gestion extends CI_Controller
}
public function disable_config_wallet()
{
if($this->isLogged()){
if (isset($_POST)) {
$network_id = $_POST['network_id'];
$res = $this->wallet_model->disableConfigWallet($network_id);
if ($res != false) {
echo json_encode("200");
} else {
echo json_encode("500");
}
}
}
}
private function isLogged()
{
@ -2235,7 +2256,7 @@ class Gestion extends CI_Controller
} elseif ($this->input->get('group')) {
$this->users_group_details($data['network_id'],$this->input->get('group'));
} else {
$data['groups'] = $this->nano_credit_model->getUsersGroups($data['network_id']);
$data['insurances'] = $this->nano_health_model->getAllInsurances($data['network_id']);
$data['configWallet'] = $this->wallet_model->getConfigWallet($data['network_id'])->first_row();
$networkDetails = $this->user_model->getNetworkDetails($data['network_id']);
if ($networkDetails) {
@ -2250,7 +2271,7 @@ class Gestion extends CI_Controller
$data['rates_epargne'] = $this->nano_credit_model->getNanoCreditRates($data['configWallet']->id, 'epargne');
$data['taxes_epargne'] = $this->wallet_model->getTaxes($data['configWallet']->id, 'epargne');
$this->load->view('header_gestion', $data);
$this->load->view('nano_credit/gestion_nano_credit_admin');
$this->load->view('nano_health/config_nano_health');
$this->load->view('footer');
}
} else {

View File

@ -629,4 +629,10 @@ $lang['analysis_by_supervisor'] ="Analysis by supervisor";
$lang['press_here_to_see_selection'] = "Press here to see the selection";
$lang['show_selection'] = "Show selection";
$lang['cancel_selection'] = "Cancel selection";
$lang['network_already_exist_in_country'] = 'This type of network already exists in this country';
$lang['nano_health_management'] = 'Nano health management';
$lang['edit_nano_health'] = 'nano health configuration';
$lang['insurances_list'] = 'Insurance list';
$lang['add_insurance'] = 'Add an insurance';
$lang['wallet_disabled'] = "Wallet disabled"
?>

View File

@ -641,4 +641,10 @@ $lang['analysis_by_supervisor'] ="Analyse par superviseur";
$lang['press_here_to_see_selection'] = "Appuyer ici pour voir la sélection";
$lang['show_selection'] = "Afficher la selection";
$lang['cancel_selection'] = "Annuler la selection";
$lang['network_already_exist_in_country'] = "Ce type de réseau existe deja dans ce pays";
$lang['nano_health_management'] = 'Gestion du nano santé';
$lang['edit_nano_health'] = 'Configuration du nano santé';
$lang['insurances_list'] = 'Liste des assurances';
$lang['add_insurance'] = "Ajouter une assurance";
$lang['wallet_disabled'] = "Wallet désactivé"
?>

View File

@ -10,6 +10,18 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Nano_health_model extends CI_Model
{
public function createConfig($id_network){
$this->db->query("INSERT INTO nh_networks_configs (network_id) VALUES ($id_network)");
return $this->db->insert_id();
}
public function getAllInsurances($id_network)
{
$query = $this->db->query("SELECT * FROM nh_insurances WHERE network_id = $id_network");
return $query->num_rows() > 0 ? $query : false ;
}
// Nano sante
public function getAllIlinkWorldNetworks()
{
@ -22,6 +34,4 @@ class Nano_health_model extends CI_Model
return false;
}
}
}

View File

@ -11,6 +11,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Wallet_model extends CI_Model
{
public function __construct()
{
$this->load->model('nano_health_model');
}
//wallet
public function getActiveNetwork(){
$query = $this->db->query("SELECT networks.id,networks.name,countries.name AS country
@ -243,7 +248,8 @@ class Wallet_model extends CI_Model
// Wallet
public function getAllActivatedNetworks(){
$query = $this->db->query("SELECT networks.name AS network,networks.status AS status,networks.id,countries.name AS country,networks.country_id , configWallet.id_network , configWallet.type FROM `networks`
$query = $this->db->query("SELECT networks.name AS network,networks.status AS status,networks.id,countries.name AS country,networks.country_id ,
configWallet.id_network , configWallet.type , configWallet.enabled FROM `networks`
INNER JOIN countries ON networks.country_id=countries.id LEFT JOIN configWallet ON configWallet.id_network = networks.id WHERE status = 1");
if($query->num_rows()>0){
return $query;
@ -262,11 +268,30 @@ class Wallet_model extends CI_Model
}
}
public function verifyConfigWalletInCountry($type, $country_id){
$sql='SELECT * FROM `configWallet` cw JOIN networks n ON cw.id_network = n.id
WHERE cw.type = ? AND n.country_id = ?;' ;
$query = $this->db->query($sql , array($type,$country_id));
return $query->num_rows()>0 ;
}
public function addConfigWallet($network_id , $type){
$sql='SELECT * FROM `configWallet` WHERE id_network = ?' ;
$existQuery = $this->db->query($sql , array($network_id));
if($existQuery->num_rows() > 0){
$query = $this->db->query("UPDATE `configWallet` SET enabled = 1 AND type = $type WHERE id_network = '".$network_id."'");
return $query;
}else{
$sql='INSERT INTO `configWallet` (`id_network`, `type`) VALUES (?,?);' ;
$query = $this->db->query($sql , array($network_id, $type));
if($query && $type == 'ilink_sante'){
// Creer la config du nano santé
$configID = $this->nano_health_model->createConfig($network_id);
$query = $this->db->query("UPDATE `configWallet` SET nh_network_config_id = $configID WHERE id_network = '".$network_id."'");
}
return $query;
}
}
public function updateConfigWallet($network_id , $taux_client_r , $taux_client_d, $taux_ag_r , $taux_ag_d , $taux_sup_r , $taux_sup_d , $taux_bq_r , $taux_bq_d , $frais_d ){
$sql= 'UPDATE `configWallet` SET `taux_com_client_retrait` = ?, `taux_com_client_depot` = ?, `taux_com_ag_retrait` = ?, `taux_com_ag_depot` = ?, `taux_com_sup_retrait` = ? , `taux_com_sup_depot` = ?, `part_banque_retrait` = ?, `part_banque_depot` = ?, `frais_min_banque_depot` = ? WHERE (`id_network` = ?);';
@ -274,6 +299,11 @@ class Wallet_model extends CI_Model
return $query;
}
public function disableConfigWallet($network_id){
$query = $this->db->query("UPDATE `configWallet` SET enabled = 0 WHERE `configWallet`.`id_network` = '".$network_id."'");
return $query;
}
public function deleteConfigWallet($network_id){
$query = $this->db->query("DELETE FROM `configWallet` WHERE `configWallet`.`id_network` = '".$network_id."'");
return $query;

View File

@ -1,12 +1,12 @@
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('Gestion des wallets'); ?>
<?= $this->lang->line('Gestion des wallets'); ?>
</h1>
<?php
$site_url = base_url();
@ -18,7 +18,7 @@
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?php echo $message; ?>
<?= $message; ?>
</div>
<?php
@ -27,7 +27,7 @@
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
<?= $message; ?>
</div>
<?php
@ -41,7 +41,7 @@
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Réseaux activés'); ?></h3>
<h3 class="box-title"><?= $this->lang->line('Réseaux activés'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
@ -57,10 +57,10 @@
<thead>
<tr>
<th align='center'></th>
<th><?php echo $this->lang->line('Reseau'); ?></th>
<th><?php echo $this->lang->line('Pays'); ?></th>
<th><?= $this->lang->line('Reseau'); ?></th>
<th><?= $this->lang->line('Pays'); ?></th>
<th align='center'> Wallet </th>
<th align='center'><?php echo $this->lang->line('Activer/Désactiver'); ?></th>
<th align='center'><?= $this->lang->line('Activer/Désactiver'); ?></th>
<th align='center'> Action </th>
</tr>
</thead>
@ -75,21 +75,23 @@
<td>$row->country</td>";
?>
<?php
if($row->id_network){
if($row->enabled){
?>
<td><span class="label label-success"><?= strtoupper($row->type) ?></span></td>
<td><button type="button" data-toggle="modal" data-target="#disableWallet" data-network-id="<?php echo $row->id ?>" class="btn btn-danger openModal"><?php echo $this->lang->line('Désactiver'); ?></button></td>
<td><span class="label label-success"><?= strtoupper(str_replace('_',' ',$row->type)) ?></span></td>
<td><button type="button" data-toggle="modal" data-target="#disableWallet" data-network-id="<?= $row->id ?>" data-country-id="<?= $row->country_id ?>"
class="btn btn-danger openModal"><?= $this->lang->line('Désactiver'); ?></button></td>
<?php
}else{
?>
<td><span class="label label-danger"><?php echo $this->lang->line('Inactif'); ?></span></td>
<td><button type="button" data-network-id="<?php echo $row->id ?>" data-toggle="modal" data-target="#enableWallet" class="btn btn-primary openModal" ><?php echo $this->lang->line('Activer'); ?></button></td>
<td><span class="label label-danger"><?= $this->lang->line('Inactif'); ?></span></td>
<td><button type="button" data-network-id="<?= $row->id ?>" data-country-id="<?= $row->country_id ?>"
data-toggle="modal" data-target="#enableWallet" class="btn btn-primary openModal" ><?= $this->lang->line('Activer'); ?></button></td>
<?php
}
?>
<td>
<a href="<?php echo current_url().($row->id_network ? '?id='.$row->id_network : '')?>" class="btn btn-primary btn-block" <?php if(!$row->id_network) echo "disabled"?> >
<b><?php echo $this->lang->line('Voir plus...'); ?></b>
<a href="<?= current_url().($row->enabled ? '?id='.$row->id_network : '')?>" class="btn btn-primary btn-block" <?php if(!$row->enabled) echo "disabled"?> >
<b><?= $this->lang->line('Voir plus...'); ?></b>
</a>
</td>
<?php
@ -117,14 +119,14 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"><?php echo $this->lang->line('Suppression du wallet'); ?></h3>
<h3 class="modal-title"><?= $this->lang->line('Suppression du wallet'); ?></h3>
</div>
<div class="modal-body">
<h4> Etes vous certain de vouloir ?</h4>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
<button type="button" class="btn btn-primary" id="deleteWallet" > <?php echo $this->lang->line('Valider'); ?></button>
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
<button type="button" class="btn btn-primary" id="disableWallet" > <?= $this->lang->line('Valider'); ?></button>
</div>
</div>
</div>
@ -133,20 +135,21 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"><?php echo $this->lang->line('choose_wallet_type'); ?></h3>
<h3 class="modal-title"><?= $this->lang->line('choose_wallet_type'); ?></h3>
</div>
<div class="modal-body">
<div class="login-box">
<div class="login-box-body">
<button type="button" class="btn btn-primary enableWallet" style="width: 100% ; margin-bottom: 15px" value="visa" data-dismiss="modal">VISA</button>
<button type="button" class="btn btn-primary enableWallet" value="ilink" style="width: 100%; margin-bottom: 15px" data-dismiss="modal">ILINK WORLD</button>
<button type="button" class="btn btn-primary enableWallet" value="ilink_sante" style="width: 100%; margin-bottom: 15px" data-dismiss="modal">ILINK SANTE</button>
<button type="button" class="btn btn-primary enableWallet" value="autre" style="width: 100%" data-dismiss="modal">AUTRE</button>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
</div>
</div>
</div>
@ -160,23 +163,23 @@
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<script src="<?= base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?= base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
<script>
$(function() {
@ -191,42 +194,45 @@
toastr.options.closeEasing = 'swing';
var network_id = null;
var country_id = null;
$(document).on("click", ".openModal", function () {
network_id = $(this).data('network-id');
country_id = $(this).data('country-id');
})
$(document).on("click", ".enableWallet", function () {
// const network_id = $(this).data('network-id');
const type = $(this).val();
$.ajax({
url : '<?php echo base_url('index.php/Gestion/config_wallet/create')?>',
url : '<?= base_url('index.php/Gestion/config_wallet/create')?>',
type : 'POST',
dataType : 'json',
data: {"network_id": network_id , "type" : type},
data: {"network_id": network_id , country_id : country_id , "type" : type},
success : function(data){
if(data=='200'){
if(data==='403'){
toastr.error("<?= $this->lang->line('network_already_exist_in_country')?>" , "<?= $this->lang->line('request_error')?>");
}else if(data==='200'){
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('wallet_created')?>",
text: "<?php echo $this->lang->line('informations_updated')?>",
title: "<?= $this->lang->line('wallet_created')?>",
text: "<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" :
}else{
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
},
error : function(resultat, statut, error){
console.log(resultat+" "+error );
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
}).done(function () {
$.ajax({
url : '<?php echo base_url('index.php/Gestion/generateAllWallets')?>',
url : '<?= base_url('index.php/Gestion/generateAllWallets')?>',
type : 'POST',
dataType : 'json',
data : {"network_id": network_id , "type" : type},
@ -239,31 +245,31 @@
});
});
$('#deleteWallet').click(function(){
$('#disableWallet').click(function(){
$.ajax({
url : '<?php echo base_url('index.php/Gestion/delete_config_wallet')?>',
url : '<?= base_url('index.php/Gestion/disable_config_wallet')?>',
type : 'POST',
dataType : 'json',
data: {"network_id": network_id },
success : function(data, statut){
if(data=='200'){
if(data==='200'){
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('wallet_deleted')?>",
text: "<?php echo $this->lang->line('informations_updated')?>",
title: "<?= $this->lang->line('wallet_disabled')?>",
text: "<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
}else{
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
},
error : function(resultat, statut, erreur){
console.log(resultat+" "+erreur);
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
});

View File

@ -159,11 +159,11 @@
</a>
</li>
<li class="<?php if ($active == "nano_health") {echo "active";} ?>">
<a href="<?php echo base_url('index.php/Gestion/nano_health') ?>">
<i class="glyphicon glyphicon-heart"></i> <span><?php echo $this->lang->line('nano_health'); ?></span>
</a>
</li>
<!-- <li class="--><?php //if ($active == "nano_health") {echo "active";} ?><!--">-->
<!-- <a href="--><?php //echo base_url('index.php/Gestion/nano_health') ?><!--">-->
<!-- <i class="glyphicon glyphicon-heart"></i> <span>--><?php //echo $this->lang->line('nano_health'); ?><!--</span>-->
<!-- </a>-->
<!-- </li>-->
<!-- <li class="--><?php ////if($active=="map"){echo "active";} ?><!--">-->
<!-- <a href="--><?php ////echo base_url('index.php/Gestion/map') ?><!--">-->
<!-- <i class="glyphicon glyphicon-map-marker"></i> <span>Carte</span>-->

View File

@ -77,8 +77,7 @@ $context = new \Brick\Money\Context\AutoContext();
</div>
</div>
<div class="row centered"
">
<div class="row centered">
<div class="col-lg-3 col-xs-12">
<div class="box">
<div class="box-header">
@ -202,7 +201,7 @@ $context = new \Brick\Money\Context\AutoContext();
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">

View File

@ -0,0 +1,456 @@
<link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>">
<link rel="stylesheet"
href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
<link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
<link rel="stylesheet"
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<?php
function convertDate($date)
{
$month = null;
switch ($date) {
case "Jan":
$month = 1;
break;
case "Feb":
$month = 2;
break;
case "Mar":
$month = 3;
break;
case "Apr":
$month = 4;
break;
case "May":
$month = 5;
break;
case "Jun":
$month = 6;
break;
case "Jul":
$month = 7;
break;
case "Aug":
$month = 8;
break;
case "Sep":
$month = 9;
break;
case "Oct":
$month = 10;
break;
case "Nov":
$month = 11;
break;
case "Dec":
$month = 12;
break;
}
return $month;
}
$month = time();
$months[] = convertDate(date("M"));
$label_months [] = date("M") . " " . date("Y");
$years[] = date("Y");
for ($i = 1; $i <= 11; $i++) {
$month = strtotime('last month', $month);
$months [] = convertDate(date("M", $month));
$years[] = date("Y", $month);
$label_months [] = date("M", $month) . " " . date("Y", $month);
}
/**
** Retraits
**/
$date = date("Y");
$retraits_data[] = '';
$retraits_data = array();
for ($i = 1; $i <= 12; $i++) {
$retraits_query_mounth = $this->db->query("SELECT id FROM infos_transaction
WHERE network_id='" . $network_id . "'
AND MONTH(date_created) = '" . $months[$i - 1] . "'
AND YEAR(date_created) = '" . $years[$i - 1] . "'
AND type_transac='debit'");
$retraits_data[] = $retraits_query_mounth->num_rows();
}
$startDate = (new DateTime('01-' . $months[11] . '-' . $years[11]))->format('Y-m-d H:i:s');
$endDate = date_create_from_format('m/Y', $months[0] . '/' . $years[0])->format('Y-m-d H:i:s');
$retraits = $this->db->query("SELECT * FROM infos_transaction
WHERE network_id='" . $network_id . "'
AND date_created BETWEEN '" . $startDate . "' AND '" . $endDate . "'
AND type_transac='debit'");
/**
** Dépots
**/
$date = date("Y");
$depots_data[] = '';
$depots_data = array();
for ($i = 1; $i <= 12; $i++) {
$depots_query_mounth = $this->db->query("SELECT id FROM infos_transaction
WHERE network_id='" . $network_id . "'
AND MONTH(date_created) = '" . $months[$i - 1] . "'
AND YEAR(date_created) = '" . $years[$i - 1] . "'
AND type_transac='credit'");
$depots_data[] = $depots_query_mounth->num_rows();
}
$depots = $this->db->query("SELECT * FROM infos_transaction
WHERE network_id='" . $network_id . "'
AND date_created BETWEEN '" . $startDate . "' AND '" . $endDate . "'
AND type_transac='credit'");
if ($transactions != false) {
$transac = $transactions->num_rows();
$array_transac = array();
$num = 0;
if ($transac > 0) {
foreach ($transactions->result() as $row) {
$num++;
$array_transac[] = $row->type_transac;
}
$vals_transac = array_count_values($array_transac);
$pieChart = array();
foreach (array_keys($vals_transac) as $paramName) {
$color = dechex(rand(0x000000, 0xFFFFFF));
$trash = array("value" => $vals_transac[$paramName],
"color" => "#" . $color,
"highlight" => "#" . $color,
"label" => $paramName);
$pieChart[] = $trash;
}
}
} else {
$pieChart = array();
}
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?>
</h1>
<?php
$site_url = base_url();
if ($alert == "ok") {
if (!$success == "ok") {
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row centered">
<div class="col-lg-2 col-lg-offset-2 col-xs-6">
<div class="small-box bg-red-active">
<div class="inner">
<h3><?php echo $taux_client_r; ?><sup style="font-size: 20px">%</sup></h3>
<p><?php echo $this->lang->line('Taux de commission client sur retrait') ?></p>
</div>
<div class="icon">
<i class="ion ion-android-arrow-up"></i>
</div>
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_client_r" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
</div>
</div>
<div class="col-lg-2 col-xs-6">
<div class="small-box bg-aqua-active">
<div class="inner">
<h3><?php echo $taux_ag_r; ?><sup style="font-size: 20px">%</sup></h3>
<p><?php echo $this->lang->line('Taux de commission agent géolocalisé sur retrait') ?> </p>
</div>
<div class="icon">
<i class="ion ion-android-arrow-up"></i>
</div>
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_ag_r" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
</div>
</div>
<div class="col-lg-2 col-xs-6">
<div class="small-box bg-aqua-active">
<div class="inner">
<h3><?php echo $taux_sup_r; ?><sup style="font-size: 20px">%</sup></h3>
<p><?php echo $this->lang->line('Taux de commission superviseur sur retrait') ?> </p>
</div>
<div class="icon">
<i class="ion ion-android-arrow-up"></i>
</div>
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_sup_r" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
</div>
</div>
<div class="col-lg-2 col-xs-6">
<div class="small-box bg-aqua-active">
<div class="inner">
<h3><?php echo $taux_bq_r; ?><sup style="font-size: 20px">%</sup></h3>
<p><?php echo $this->lang->line('Part de la banque sur le retrait') ?> </p>
</div>
<div class="icon">
<i class="ion ion-android-arrow-up"></i>
</div>
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_bq_r" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
</div>
</div>
</div>
<div class="row">
<div class="col-lg-2 col-lg-offset-1 col-xs-6">
<div class="small-box bg-green-active">
<div class="inner">
<h3><?php echo $taux_client_d; ?><sup style="font-size: 20px">%</sup></h3>
<p><?php echo $this->lang->line('Taux de commission client sur dépot') ?></p>
</div>
<div class="icon">
<i class="ion ion-android-arrow-down"></i>
</div>
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_client_d" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
</div>
</div>
<div class="col-lg-2 col-xs-6">
<div class="small-box bg-green-active">
<div class="inner">
<h3><?php echo $frais_d; ?><sup style="font-size: 20px">FCFA</sup></h3>
<p><?php echo $this->lang->line('Frais minimun de la banque sur le dépot') ?> </p>
</div>
<div class="icon">
<i class="ion ion-android-arrow-down"></i>
</div>
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="frais_d" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
</div>
</div>
<div class="col-lg-2 col-xs-6">
<div class="small-box bg-yellow-active">
<div class="inner">
<h3><?php echo $taux_ag_d; ?><sup style="font-size: 20px">%</sup></h3>
<p><?php echo $this->lang->line('Taux de commission agent géolocalisé sur dépot') ?> </p>
</div>
<div class="icon">
<i class="ion ion-android-arrow-down"></i>
</div>
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_ag_d" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
</div>
</div>
<div class="col-lg-2 col-xs-6">
<div class="small-box bg-yellow-active">
<div class="inner">
<h3><?php echo $taux_sup_d; ?><sup style="font-size: 20px">%</sup></h3>
<p><?php echo $this->lang->line('Taux de commission superviseur sur dépot') ?> </p>
</div>
<div class="icon">
<i class="ion ion-android-arrow-down"></i>
</div>
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_sup_d" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
</div>
</div>
<div class="col-lg-2 col-xs-6">
<div class="small-box bg-yellow-active">
<div class="inner">
<h3><?php echo $taux_bq_d; ?><sup style="font-size: 20px">%</sup></h3>
<p><?php echo $this->lang->line('Part de la banque sur le dépot') ?> </p>
</div>
<div class="icon">
<i class="ion ion-android-arrow-down"></i>
</div>
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_bq_d" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">
<?php echo $this->lang->line('Historique des 12 derniers mois'); ?></h3>
<div class="box-tools">
<a class="btn btn-primary" href="<?php echo current_url().($network_id ? '?id='.$network_id . '&history=transaction' : '')?>">
<?php echo $this->lang->line('transactions_historic'); ?>
</a>
<a class="btn btn-info" href="<?php echo current_url().($network_id ? '?id='.$network_id . '&history=recharge' : '')?>">
<?php echo $this->lang->line('recharge_historic'); ?>
</a>
</div>
</div>
<div class="box-body">
<div class="chart" id="chart">
<canvas id="barChart" style="height:230px"></canvas>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">
<?php echo $this->lang->line("Parts dépots & retraits"); ?></h3>
</div>
<div class="box-body" id="chart2">
<canvas id="pieChart" style="height:250px"></canvas>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Commission Hyperviseur') ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="example1" class="table table-bordered table-hover">
<thead>
<tr>
<?php
echo "<th>".$this->lang->line('Nom')."</th>
<th>".$this->lang->line('Solde Principal')."</th>
<th>".$this->lang->line('Solde Commission')."</th>
<th>".$this->lang->line('Commission banque')."</th>
<th>".$this->lang->line('DEPOT'). 's'."</th>
<th>".$this->lang->line('RETRAIT').'s'."</th>";
?>
</tr>
</thead>
<tbody>
<?php
if ($walletHyper) {
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
echo "<tr>
<td>" . $walletHyper->first_row()->lastname . "</td>
<td>" . $fmt->format($walletHyper->first_row()->balance_princ) . "</td>
<td>" . $fmt->format($walletHyper->first_row()->balance_com) . "</td>
<td>" . $fmt->format($totalCommissionBanque) . "</td>";
echo "<td>" . $depots->num_rows() . "</td>
<td>" . $retraits->num_rows() . "</td>
</tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
<script
src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
<scriptf
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></scriptf>
<!-- ChartJS -->
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
<script>
$(function () {
$('#example1').DataTable();
// $('#example1').DataTable({
// "aLengthMenu": [[5, 10, 15, -1], [5, 10, 5, "All"]],
// "iDisplayLength": 5
// });
// $('#example2').DataTable({
// 'paging' : true,
// 'lengthChange': false,
// 'searching' : false,
// 'ordering' : true,
// 'info' : true,
// 'autoWidth' : false
// })
})
</script>
<script>
var areaChartData = {
labels: <?php echo json_encode($label_months) ?>,
datasets: [
{
label: 'Electronics',
fillColor: 'rgba(255, 162, 0, 1)',
strokeColor: 'rgba(255, 162, 0, 1)',
pointColor: 'rgba(255, 162, 0, 1)',
pointStrokeColor: '#ffa200',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(220,220,220,1)',
data: <?php echo json_encode($depots_data) ?>
},
{
label: 'Digital Goods',
fillColor: 'rgba(0, 187, 255, 1)',
strokeColor: 'rgba(0, 187, 255, 1)',
pointColor: '#00bbff',
pointStrokeColor: 'rgba(0, 187, 255, 1)',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(0, 187, 255, 1)',
data: <?php echo json_encode($retraits_data) ?>
}
]
};
var Pie = '<?php echo json_encode($pieChart) ?>';
if (Pie === '[]') {
var select = document.getElementById('chart2');
$(select.children).hide();
$(select).append("<p>Aucune transaction</p>");
} else {
Pie = JSON.parse(Pie);
}
</script>
<!-- Page script -->
<script src="<?php echo base_url('dist/js/custom.js') ?>"></script>

View File

@ -0,0 +1,317 @@
<link rel="stylesheet" href="<?= base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>">
<link rel="stylesheet"
href="<?= base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
<link rel="stylesheet" href="<?= base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
<link rel="stylesheet"
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
<?php
use Brick\Money\Money;
$context = new \Brick\Money\Context\AutoContext();
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $this->lang->line('nano_health_management') . ' ' . $network . ' - ' . $country; ?>
</h1>
<?php
$site_url = base_url();
if ($alert == "ok") {
if (!$success == "ok") {
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?= $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?= $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row">
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-green-active">
<div class="inner">
<h3><?= Money::of(round($configWallet->limite_credit_min, 2), $currency_code, $context)->formatTo('fr_FR') ?></h3>
<p><?= $this->lang->line('minimum_credit_limit') ?></p>
</div>
<div class="icon">
<i class="ion ion-cash"></i>
</div>
</div>
</div>
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-red-active">
<div class="inner">
<h3><?= Money::of(round($configWallet->limite_credit_max, 2), $currency_code, $context)->formatTo('fr_FR'); ?></h3>
<p><?= $this->lang->line('maximum_credit_limit') ?></p>
</div>
<div class="icon">
<i class="ion ion-cash"></i>
</div>
</div>
</div>
</div>
<div class="row centered">
<div class="col-lg-3 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('nano_credit_interest_rates'); ?></h3>
</div>
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<thead>
<tr>
<th><?= $this->lang->line('interest_rates_period'); ?> </th>
<th><?= $this->lang->line('rate') . ' (%)'; ?> </th>
</tr>
</thead>
<tbody>
<?php
if ($rates_nano_credit != false) {
foreach ($rates_nano_credit->result() as $row) {
echo "<tr>
<td>" . $row->duree_mois . "</td>
<td>" . $row->taux . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-lg-3 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('transaction_nano_credit'); ?></h3>
</div>
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<thead>
<tr>
<th><?= $this->lang->line('Nom'); ?> </th>
<th>Type</th>
<th>Valeur</th>
</tr>
</thead>
<tbody>
<?php
if ($taxes_nano_credit != false) {
foreach ($taxes_nano_credit->result() as $row) {
echo "<tr>
<td>" . $row->nom . "</td>
<td>" . $row->type . "</td>
<td>" . $row->valeur . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-lg-3 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('savings_interest_rates'); ?></h3>
</div>
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<thead>
<tr>
<th><?= $this->lang->line('interest_rates_period'); ?> </th>
<th><?= $this->lang->line('rate') . ' (%)'; ?> </th>
</tr>
</thead>
<tbody>
<?php
if ($rates_epargne != false) {
foreach ($rates_epargne->result() as $row) {
echo "<tr>
<td>" . $row->duree_mois . "</td>
<td>" . $row->taux . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-lg-3 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('savings_tax'); ?></h3>
</div>
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<thead>
<tr>
<th><?= $this->lang->line('Nom'); ?> </th>
<th>Type</th>
<th>Valeur</th>
</tr>
</thead>
<tbody>
<?php
if ($taxes_epargne != false) {
foreach ($taxes_epargne->result() as $row) {
echo "<tr>
<td>" . $row->nom . "</td>
<td>" . $row->type . "</td>
<td>" . $row->valeur . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">
<?= $this->lang->line('insurances_list') ?></h3>
<div class="box-tools">
<a class="btn btn-primary"
href="<?= current_url() . ($network_id ? '?id=' . $network_id . '&history=nano_credit' : '') ?>">
<?= $this->lang->line('add_insurance'); ?>
</a>
</div>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<?php
echo "<th> # </th>
<th>" . $this->lang->line('Nom') . "</th>
<th>" . $this->lang->line('supervisor') . "</th>
<th> Status</th>
<th>" . $this->lang->line('created_date') . "</th>
<th> Action </th>";
?>
</tr>
</thead>
<tbody>
<?php
if ($insurances != false) {
foreach ($insurances->result() as $i => $row) {
echo "<tr>
<td>" . $i . "</td>
<td>" . $row->name . "</td>
<td>" . $row->supervisor_id . "</td>";
?>
<td>
<span class="label label-success"><?= $this->lang->line( $row->enabled ? 'Actif' : 'Inactif') ?></span>
</td>
<td> <?= $row->created_at ?> </td>
<td>
<a href="<?= current_url().('?id='.$network_id.'&insurance='.$row->id)?>" class="btn btn-primary btn-block" <?php if(!$row->id_network) echo "disabled"?> >
<b><?= $this->lang->line('Voir plus...'); ?></b>
</a>
</td>
</tr>
<?php
}
?>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?= base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?= base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
<script src="<?= base_url('bower_components/moment/min/moment.min.js') ?>"></script>
<script src="<?= base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
<script src="<?= base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
<!-- ChartJS -->
<script src="<?= base_url('bower_components/chart.js/Chart.js') ?>"></script>
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment-with-locales.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.19/sorting/datetime-moment.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.20/dataRender/datetime.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.colVis.min.js"></script>
<script>
$(function () {
const lang = "<?= $this->session->userdata('site_lang') ?>";
const format = lang === 'french' ? 'fr' : 'en';
moment.updateLocale(moment.locale(format), {invalidDate: ""});
$('#example1').DataTable({
"aaSorting": [[4, "desc"]],
"columnDefs": [{
targets: 4,
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
}]
});
})
</script>
<!-- Page script -->
<!--<script src="--><?php //echo base_url('dist/js/custom.js') ?><!--"></script>-->

View File

@ -1,14 +1,14 @@
<link rel="stylesheet"
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('nano_health_management'); ?>
<?= $this->lang->line('nano_health_management'); ?>
</h1>
<?php
@ -24,7 +24,7 @@
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?php echo $message; ?>
<?= $message; ?>
</div>
<?php
@ -33,7 +33,7 @@
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
<?= $message; ?>
</div>
<?php
@ -47,7 +47,7 @@
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('ilink_world_networks'); ?></h3>
<h3 class="box-title"><?= $this->lang->line('ilink_world_networks'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
@ -63,9 +63,9 @@
<thead>
<tr>
<th align='center'></th>
<th><?php echo $this->lang->line('Reseau'); ?></th>
<th><?php echo $this->lang->line('Pays'); ?></th>
<th align='center'><?php echo $this->lang->line('nano_health'); ?></th>
<th><?= $this->lang->line('Reseau'); ?></th>
<th><?= $this->lang->line('Pays'); ?></th>
<th align='center'><?= $this->lang->line('nano_health'); ?></th>
<th align='center'> Action</th>
</tr>
</thead>
@ -84,24 +84,24 @@
?>
<td>
<button type="button" data-toggle="modal" data-target="#disableWallet"
data-network-id="<?php echo $row->id ?>"
class="btn btn-danger openModal"><?php echo $this->lang->line('Désactiver'); ?></button>
data-network-id="<?= $row->id ?>"
class="btn btn-danger openModal"><?= $this->lang->line('Désactiver'); ?></button>
</td>
<?php
} else {
?>
<td>
<button type="button" data-network-id="<?php echo $row->id ?>"
class="btn btn-primary activateNanoCredit"><?php echo $this->lang->line('Activer'); ?></button>
<button type="button" data-network-id="<?= $row->id ?>"
class="btn btn-primary activateNanoCredit"><?= $this->lang->line('Activer'); ?></button>
</td>
<?php
}
?>
<td>
<a href="<?php echo current_url() ?>"
class="btn btn-primary btn-block" <?php /*if (!$row->has_nano_health)*/ echo "disabled" ?> >
<b><?php echo $this->lang->line('Voir plus...'); ?></b>
<a href="<?= current_url(). ($row->has_nano_health? '?id=' . $row->id_network : '')?>"
class="btn btn-primary btn-block" <?php if (!$row->has_nano_health) echo "disabled" ?> >
<b><?= $this->lang->line('Voir plus...'); ?></b>
</a>
</td>
@ -128,16 +128,16 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"><?php echo $this->lang->line('nano_health_removal'); ?></h3>
<h3 class="modal-title"><?= $this->lang->line('nano_health_removal'); ?></h3>
</div>
<div class="modal-body">
<h4> Etes vous certain de vouloir ?</h4>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
<button type="button" class="btn btn-primary"
id="deleteWallet"> <?php echo $this->lang->line('Valider'); ?></button>
id="deleteWallet"> <?= $this->lang->line('Valider'); ?></button>
</div>
</div>
</div>
@ -151,23 +151,23 @@
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<script src="<?= base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?= base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
<script>
$(function () {
@ -191,7 +191,7 @@
$('.activateNanoCredit').click(function () {
const id_network = $(this).data('network-id');
$.ajax({
url: '<?php echo base_url('index.php/Gestion/activate_nano_health')?>',
url: '<?= base_url('index.php/Gestion/activate_nano_health')?>',
type: 'POST',
dataType: 'json',
data: {"id_network": id_network},
@ -199,28 +199,28 @@
if (data == '200') {
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('activate_nano_health')?>",
text: "<?php echo $this->lang->line('informations_updated')?>",
title: "<?= $this->lang->line('activate_nano_health')?>",
text: "<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(() => {
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
} else {
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, erreur) {
console.log(resultat + " " + erreur);
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
}
});
});
$('#deleteWallet').click(function () {
$.ajax({
url: '<?php echo base_url('index.php/Gestion/deactivate_nano_health')?>',
url: '<?= base_url('index.php/Gestion/deactivate_nano_health')?>',
type: 'POST',
dataType: 'json',
data: {"id_network": network_id},
@ -228,21 +228,21 @@
if (data == '200') {
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('nano_health_deleted')?>",
text: "<?php echo $this->lang->line('informations_updated')?>",
title: "<?= $this->lang->line('nano_health_deleted')?>",
text: "<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(() => {
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
} else {
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, erreur) {
console.log(resultat + " " + erreur);
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
}
});
});