From 9d8cf04e4adc6be41d3308ac8c9d9db327803fc4 Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Thu, 25 Feb 2021 09:41:02 +0100 Subject: [PATCH] Enable nano health in admin panel --- application/controllers/Gestion.php | 77 ++++++ application/language/english/message_lang.php | 8 +- application/language/french/message_lang.php | 8 +- application/models/Nano_health_model.php | 27 ++ application/views/header_gestion.php | 6 + .../views/nano_health/gestion_nano_health.php | 249 ++++++++++++++++++ 6 files changed, 373 insertions(+), 2 deletions(-) create mode 100644 application/models/Nano_health_model.php create mode 100755 application/views/nano_health/gestion_nano_health.php diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php index a421595a..13126ce2 100755 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -11,6 +11,8 @@ class Gestion extends CI_Controller parent::__construct(); $this->load->model('wallet_model'); $this->load->model('nano_credit_model'); + $this->load->model('nano_health_model'); + } public function index() @@ -2210,6 +2212,81 @@ class Gestion extends CI_Controller } } + + public function nano_health(){ + if ($this->isLogged()) { + $data['active'] = "nano_health"; + $data['alert'] = ""; + $data['game_pays'] = $this->user_model->getGameCountry(); + + if ($this->input->get('id')) { + $data['network_id'] = $this->input->get('id'); + + if ($this->input->get('history')) { + $this->historique_nano_credit($data['network_id'], $this->input->get('d'), $this->input->get('f'), $this->input->get('history')); + } 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['configWallet'] = $this->wallet_model->getConfigWallet($data['network_id'])->first_row(); + $networkDetails = $this->user_model->getNetworkDetails($data['network_id']); + if ($networkDetails) { + $data['network'] = $networkDetails->first_row()->network; + $data['country'] = $networkDetails->first_row()->country; + $data['currency_code'] = $networkDetails->first_row()->currency_code; + } + + $data['rates_nano_credit'] = $this->nano_credit_model->getNanoCreditRates($data['configWallet']->id); + $data['taxes_nano_credit'] = $this->wallet_model->getTaxes($data['configWallet']->id, 'nano_credit'); + + $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('footer'); + } + } else { + $data['networks'] = $this->nano_health_model->getAllIlinkWorldNetworks(); + $this->load->view('header_gestion', $data); + $this->load->view('nano_health/gestion_nano_health'); + $this->load->view('footer'); + + } + } + } + + public function activate_nano_health() + { + if ($this->isLogged()) { + if (isset($_POST)) { + $data = array('has_nano_health' => 1); + $this->db->where('id_network', $_POST['id_network']); + $res = $this->db->update('configWallet', $data); + if ($res) { + echo json_encode("200"); + } else { + echo json_encode("500"); + } + } + } + } + + public function deactivate_nano_health() + { + if ($this->isLogged()) { + if (isset($_POST)) { + $data = array('has_nano_health' => 0); + $this->db->where('id_network', $_POST['id_network']); + $res = $this->db->update('configWallet', $data); + if ($res) { + echo json_encode("200"); + } else { + echo json_encode("500"); + } + } + } + } + public function regulations() { diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index 5e337249..099c0ae2 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -604,5 +604,11 @@ $lang['delete_transaction'] = "Delete a transaction"; $lang['are_you_sure'] = "Are you sure what you are doing?"; $lang['deleted_transactions'] = "Deleted Transactions"; $lang['deletion_date'] = "Date of deletion"; -$lang['wallet_transaction_deleted_message'] = "Transaction number %s made by agent %s has been deleted" +$lang['wallet_transaction_deleted_message'] = "Transaction number %s made by agent %s has been deleted"; +//Nano Santé +$lang['nano_health'] = "Nano health"; +$lang['nano_health_management'] = 'Nano health management'; +$lang['nano_health_removal'] = 'Removal of nano health'; +$lang['activate_nano_health'] = 'Activate nano health'; +$lang['nano_health_deleted'] = 'Nano health deleted'; ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index a6d0a461..99d34e34 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -616,5 +616,11 @@ $lang['delete_transaction'] = "Supprimer une transaction"; $lang['are_you_sure'] = "Êtes vous sûr de ce que vous faites ?"; $lang['deleted_transactions'] = "Transactions supprimées"; $lang['deletion_date'] = "Date de suppression"; -$lang['wallet_transaction_deleted_message'] = "La transaction numéro %s faites par l'agent %s a été supprimée" +$lang['wallet_transaction_deleted_message'] = "La transaction numéro %s faites par l'agent %s a été supprimée"; +//Nano santé +$lang['nano_health'] = "Nano santé"; +$lang['nano_health_management'] = 'Gestion du nano santé'; +$lang['nano_health_removal'] = 'Suppression du nano santé'; +$lang['activate_nano_health'] = 'Activation du nano santé'; +$lang['nano_health_deleted'] = 'Nano santé supprimé'; ?> diff --git a/application/models/Nano_health_model.php b/application/models/Nano_health_model.php new file mode 100644 index 00000000..53cd223f --- /dev/null +++ b/application/models/Nano_health_model.php @@ -0,0 +1,27 @@ +db->query("SELECT networks.name AS network,networks.status AS status,networks.id,cc.name AS country,networks.country_id , configWallet.id_network , configWallet.type,cc.currency_code, + configWallet.has_nano_health FROM `networks` + INNER JOIN countries_currencies cc ON networks.country_id=cc.id LEFT JOIN configWallet ON configWallet.id_network = networks.id WHERE status = 1 AND configWallet.type = 'ilink'"); + if ($query->num_rows() > 0) { + return $query; + } else { + return false; + } + } + + +} diff --git a/application/views/header_gestion.php b/application/views/header_gestion.php index 360e168d..8212a12f 100755 --- a/application/views/header_gestion.php +++ b/application/views/header_gestion.php @@ -158,6 +158,12 @@ Nano credit + +
  • "> + + lang->line('nano_health'); ?> + +
  • diff --git a/application/views/nano_health/gestion_nano_health.php b/application/views/nano_health/gestion_nano_health.php new file mode 100755 index 00000000..cd75f23e --- /dev/null +++ b/application/views/nano_health/gestion_nano_health.php @@ -0,0 +1,249 @@ + + + +
    + +
    + +

    + lang->line('nano_health_management'); ?> +

    + +
    + +

    Erreur!

    + +
    + + +
    + +

    Success!

    + +
    + + +
    + +
    +
    +
    +
    +
    +

    lang->line('ilink_world_networks'); ?>

    +
    +
    + + num_rows(); + $num = 0; + if ($numrows > 0) { + ?> + + + + + + + + + + + + result() as $row) { + $num++; + //$member_code = randomString1(10); + echo " + + + "; + ?> + has_nano_health) { + ?> + + + + + + + + + +
    lang->line('Reseau'); ?>lang->line('Pays'); ?>lang->line('nano_health'); ?> Action
    $num$row->network$row->country + + + + + has_nano_health)*/ echo "disabled" ?> > + lang->line('Voir plus...'); ?> + +
    + + lang->line('Aucun réseau'); + } + } else { + echo $this->lang->line('Aucun réseau'); + } + ?> +
    +
    +
    +
    + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + +