diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php index 4989bee8..9d1e71e3 100755 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -2058,6 +2058,55 @@ class Gestion extends CI_Controller } } + public function nano_credit() + { + if ($this->isLogged()) { + $data['active'] = "nano_credit"; + $data['alert'] = ""; + $data['game_pays'] = $this->user_model->getGameCountry(); + $data['networks'] = $this->user_model->getAllIlinkWorldNetworks(); + $this->load->view('header_gestion', $data); + $this->load->view('nano_credit/gestion_nano_credits'); + $this->load->view('footer'); + + } + } + + public function activate_nano_credit() + { + if ($this->isLogged()) { + if (isset($_POST)) { + + $id_network = $_POST['id_network']; + $this->user_model->insertCreditLimit(0, 0, '1', $id_network); + $res = true; + + if ($res) { + echo json_encode("200"); + } else { + echo json_encode("500"); + } + } + } + } + + public function delete_nano_credit() + { + if ($this->isLogged()) { + if (isset($_POST)) { + $id_network = $_POST['id_network']; + + $this->user_model->insertCreditLimit(0, 0, '0', $id_network); + $res = true; + + if ($res) { + echo json_encode("200"); + } else { + echo json_encode("500"); + } + } + } + } } diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index 61236e35..0ab482c0 100755 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -1175,7 +1175,7 @@ class Hyperviseur_dash extends CI_Controller $config_id = $_POST['config_id']; $rate = $_POST['rate']; $url = $_POST['url']; - $res = $this->user_model->setSharingRate($network_id,$config_id,$rate,$url); + $res = $this->user_model->setSharingRate($network_id, $config_id, $rate, $url); if ($res) { echo json_encode("200"); @@ -1186,6 +1186,50 @@ class Hyperviseur_dash extends CI_Controller } } } + + public function nano_credit() + { + if ($this->isLogged()) { + $data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id')); + $data['active'] = "nano_credit"; + $data['alert'] = ""; + $data['game_pays'] = $this->user_model->getGameCountry(); + $data['network'] = $this->session->userdata('network'); + $data['country'] = $this->session->userdata('current_pays'); + $data['network_id'] = $this->session->userdata('network_id'); + $data['firstname'] = $this->session->userdata('firstname'); + $data['lastname'] = $this->session->userdata('lastname'); + $data['currency_code'] = $this->session->userdata('currency_code'); + $data['token'] = $this->session->userdata('token'); + $data['email'] = $this->session->userdata('email'); + $data['configWallet'] = $data['hasWallet']->first_row(); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); + $this->load->view('header_hyp', $data); + $this->load->view('nano_credit/gestion_nano_credit_hyp'); + $this->load->view('footer'); + + } + } + + public function saveCreditLimit() + { + if ($this->isLogged()) { + if (isset($_POST)) { + $limit_min = $_POST['limit_min']; + $limit_max = $_POST['limit_max']; + $id_network = $_POST['id_network']; + + $this->user_model->insertCreditLimit($limit_min, $limit_max, '1', $id_network); + $res = true; + + if ($res) { + echo json_encode("200"); + } else { + echo json_encode("500"); + } + } + } + } } class Operation diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index 47e55a9c..a1d89bb5 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -444,4 +444,16 @@ $lang['incoming_requests'] = 'Incoming requests'; $lang['outgoing_requests'] = 'Outgoing requests'; $lang['incoming_credits_requests'] = 'Incoming credit requests'; $lang['outgoing_credits_requests'] = 'Outgoing credit requests'; +$lang['nanocredit_management'] = 'Nanocredit management'; +$lang['change_the_credit_limit'] = 'Change the credit limit'; +$lang['minimum_credit_limit'] = 'Minimum credit limit'; +$lang['maximum_credit_limit'] = 'Maximum credit limit'; +$lang['credit_limit_rule'] = 'The maximum credit limit must be greater than the minimum limit'; +$lang['update_credit_limit'] = 'Update credit limits'; +$lang['activate_nano_credit'] = 'Activation of Nano credit'; +$lang['ilink_world_networks'] = 'iLink World type networks'; +$lang['credit_limit'] = 'Credit limit'; +$lang['nano_credit_removal'] = 'Removal of nano credit'; +$lang['set_credit_limit'] = 'Set the credit limit'; +$lang['nano_credit_deleted'] = 'Nano credit deleted'; ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index 15a5c44e..8aa0e2e5 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -456,5 +456,16 @@ $lang['incoming_requests'] = 'Demandes entrantes'; $lang['outgoing_requests'] = 'Demandes sortantes'; $lang['incoming_credits_requests'] = 'Demandes de crédits entrantes'; $lang['outgoing_credits_requests'] = 'Demandes de crédits sortantes'; - +$lang['nanocredit_management'] = 'Gestion du nano crédit'; +$lang['change_the_credit_limit'] = 'Modifier la limite du crédit'; +$lang['minimum_credit_limit'] = 'Limite de crédit minimale'; +$lang['maximum_credit_limit'] = 'Limite de crédit maximale'; +$lang['credit_limit_rule'] = 'La limite de crédit maximale doit être supérieure à la limite minimale'; +$lang['update_credit_limit'] = 'Mise à jour des limites de crédits'; +$lang['activate_nano_credit'] = 'Activation du Nano credit'; +$lang['ilink_world_networks'] = 'Réseaux de type iLink World'; +$lang['credit_limit'] = 'Limite de crédit'; +$lang['nano_credit_removal'] = 'Suppression du nano crédit'; +$lang['set_credit_limit'] = 'Définir la limite de crédit'; +$lang['nano_credit_deleted'] = 'Nano crédit supprimé'; ?> diff --git a/application/models/User_model.php b/application/models/User_model.php index 57443f9e..1b961121 100755 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -2664,4 +2664,23 @@ class User_model extends CI_Model return false; } } + + // Nano credit + public function insertCreditLimit($limit_min, $limit_max, $has_nano_credit, $id_network) + { + $sql = "UPDATE `configWallet` SET `has_nano_credit` = ?, `limite_credit_min` = ? , `limite_credit_max` = ? WHERE (`id_network` = ? );"; + return $this->db->query($sql, array($has_nano_credit, $limit_min, $limit_max, $id_network)); + } + + public function getAllIlinkWorldNetworks() + { + $query = $this->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.limite_credit_min , configWallet.limite_credit_max , configWallet.has_nano_credit 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 8a73af02..e14a1787 100755 --- a/application/views/header_gestion.php +++ b/application/views/header_gestion.php @@ -137,22 +137,35 @@ lang->line('Publicité'); ?> -
  • "> - - lang->line('Game'); ?> - -
  • -
  • "> +
  • "> + + lang->line('Game'); ?> + +
  • +
  • "> - Wallet - -
  • - - - - - -
  • "> + Wallet + +
  • +
  • "> + + Nano credit + +
  • + + + + + +
  • "> lang->line('currency'); ?> diff --git a/application/views/header_hyp.php b/application/views/header_hyp.php index f7505c89..186a60c7 100755 --- a/application/views/header_hyp.php +++ b/application/views/header_hyp.php @@ -164,9 +164,19 @@
  • first_row()->type == 'ilink'){ ?> -
  • "> +
  • "> + + Nano credit + +
  • +
  • "> - lang->line('calculator'); ?> + + lang->line('calculator'); ?>
  • diff --git a/application/views/nano_credit/gestion_nano_credit_hyp.php b/application/views/nano_credit/gestion_nano_credit_hyp.php new file mode 100755 index 00000000..f78739ef --- /dev/null +++ b/application/views/nano_credit/gestion_nano_credit_hyp.php @@ -0,0 +1,385 @@ + + + + + + + + + + + + + +
    + +
    + +

    + Nano crédit +

    + +
    + +

    Erreur!

    + +
    + + +
    + +

    Success!

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

    limite_credit_min, 2), $currency_code, $context)->formatTo('fr_FR') ?>

    +

    lang->line('minimum_credit_limit') ?>

    +
    +
    + +
    +
    +
    + +
    +
    +
    +

    limite_credit_max, 2), $currency_code, $context)->formatTo('fr_FR'); ?>

    +

    lang->line('maximum_credit_limit') ?>

    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + + + + + + + lang->line('Commissions Superviseurs') ?> + + + + lang->line('commission_transfer_historic'); ?> + + + + lang->line('balance_statement'); ?> + + + + + + + + ".$this->lang->line('Nom')." + // ".$this->lang->line('Solde Principal')." + // ".$this->lang->line('Solde Commission')." + // ".$this->lang->line('Commission banque')." + // ".$this->lang->line('DEPOT'). 's'." + // ".$this->lang->line('RETRAIT').'s'.""; + // ?> + + + + result() as $row) { + // $wallet = null; + // foreach ($agentWalletInfos->result() as $value) { + // if ($value->agent_id == $row->agent_id) { + // $wallet = $value; + // break; + // } + // } + // $com = 0; + // $princ = 0; + // if($wallet) { + // $com = $wallet->balance_com; + // $princ = $wallet->balance_princ; + // } + // echo " + // ".$row->lastname." + // ".Money::of(round($princ,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR')." + // ".Money::of(round($com,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR').""; + // $nb_depots = 0; + // $nb_retraits = 0; + // $commission_banque = 0; + // foreach($depots as $depot){ + // if($depot->code_parrain == $row->member_code) { + // $nb_depots ++; + // $commission_banque+= $depot->commission_banque; + // } + // } + // foreach($retraits as $retrait){ + // if($retrait->code_parrain == $row->member_code) { + // $nb_retraits ++; + // $commission_banque+= $retrait->commission_banque; + // } + // } + // echo "".Money::of(round($commission_banque,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR')." + // ".$nb_depots." + // ".$nb_retraits." + // "; + // } + // + // } + // ?> + + + + + + + + --> +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/views/nano_credit/gestion_nano_credits.php b/application/views/nano_credit/gestion_nano_credits.php new file mode 100755 index 00000000..5d455f53 --- /dev/null +++ b/application/views/nano_credit/gestion_nano_credits.php @@ -0,0 +1,257 @@ + + + +
    + +
    + +

    + lang->line('nanocredit_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_credit) { + ?> + + + + + + + + + +
    lang->line('Reseau'); ?>lang->line('Pays'); ?>lang->line('credit_limit'); ?>Nano credit Action
    $num$row->network$row->country + [ limite_credit_min, 2), $row->currency_code, $context)->formatTo('fr_FR') ?> + -- + limite_credit_max, 2), $row->currency_code, $context)->formatTo('fr_FR') ?> + ] + + + + lang->line('Inactif'); ?> + + + + has_nano_credit) echo "disabled" ?> > + lang->line('Voir plus...'); ?> + +
    + + lang->line('Aucun réseau'); + } + } else { + echo $this->lang->line('Aucun réseau'); + } + ?> +
    +
    +
    +
    + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + +