diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index d0a60954..c00bf478 100755 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -1030,6 +1030,7 @@ class Hyperviseur_dash extends CI_Controller $result = $res->result(); foreach ($result as $network){ $res = $this->wallet_model->getSharingRate($network->id , $data['idConfig']); + $res2 = $this->wallet_model->getTransmittingNetwork($network->id , $data['idConfig']); if($res){ $network->rate = $res->first_row()->taux_partage; $network->url = $res->first_row()->url; @@ -1037,6 +1038,7 @@ class Hyperviseur_dash extends CI_Controller $network->rate = null; $network->url = null; } + $network->is_transmitting_network = $res2 ? true : false; $data['networks'][] = $network; } } @@ -1051,11 +1053,11 @@ class Hyperviseur_dash extends CI_Controller $result = $res->result(); foreach ($result as $country){ $res = $this->wallet_model->countPayingNetworks($country->id, $data['idConfig']); - if($res){ - $country->total = $res->first_row()->total; - }else{ - $country->total = null; - } + $res2 = $this->wallet_model->countTransmittiongNetworks($country->id, $data['idConfig']); + + $country->total_paying = $res ? $res->first_row()->total : null ; + $country->total_transmitting = $res ? $res2->first_row()->total : null ; + $data['countries'][] = $country; } } @@ -1605,6 +1607,46 @@ class Hyperviseur_dash extends CI_Controller } } } + + public function active_transmitting_network() + { + if ($this->isLogged()) { + if (isset($_POST)) { + $data = array( + 'id_configWallet' => $this->input->post('config_id'), + 'id_network' => $this->input->post('network_id') + ); + + $query = $this->db->insert('transmitting_networks', $data); + + if ($query) { + echo json_encode("200"); + } else { + echo json_encode("500"); + } + } + } + } + + public function deactive_transmitting_network() + { + if ($this->isLogged()) { + if (isset($_POST)) { + $data = array( + 'id_configWallet' => $this->input->post('config_id'), + 'id_network' => $this->input->post('network_id') + ); + + $query = $this->db->delete('transmitting_networks', $data); + + if ($query) { + 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 d19b1028..6b088b58 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -391,7 +391,7 @@ $lang['ilink_third_rule'] = 'The sum of the distribution of commission on cash d $lang['ilink_fourth_rule'] = 'The sum of the distribution of commission on withdrawal operation in the card must be equal to 100%'; $lang['ilink_fifth_rule'] = 'The sum of the distribution of commission on withdrawal operation in the card for iLink user must be equal to 100%'; $lang['ilink_sixth_rule'] = 'The sum of the commission distributions on the operation of sending a wallet to the iLink user card must be equal to 100%'; -$lang['edit_paying_networks'] = 'Configuration of paying networks'; +$lang['edit_paying_and_transmitting_networks'] = 'Configuration of paying and issuing networks'; $lang['configure'] = 'Configure'; $lang['configure_share_rate'] = 'Configure the sharing rate'; $lang['share_rate'] = 'Sharing rate'; @@ -530,4 +530,8 @@ $lang['bank_deactivated'] = "The bank has been deactivated"; $lang['bank_deactivation'] = "Deactivation of the bank"; $lang['modify_bank'] = "Modify the bank"; $lang['assign_bank_to_country'] = "Assign a bank to a country"; +$lang['transmitting_networks'] = "Transmitting networks"; +$lang['transmitter_network_activated'] = "Transmitter network activated"; +$lang['transmitter_network_deactivated'] = "Transmitter network deactivated"; +$lang['paying_networks'] = 'Paying networks'; ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index 9487e363..c7d9349e 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -403,7 +403,7 @@ $lang['ilink_third_rule'] = 'La somme des répartitions de commission sur opéra $lang['ilink_fourth_rule'] = 'La somme des répartitions de commission sur opération de retrait dans la carte doit etre égale à 100 %'; $lang['ilink_fifth_rule'] = 'La somme des répartitions de commission sur opération de retrait dans la carte pour utilisateur iLink doit etre égale à 100 %'; $lang['ilink_sixth_rule'] = 'La somme des répartitions de commission sur opération d\'envoi de wallet vers la carte pour utilisateur iLink doit etre égale à 100 %'; -$lang['edit_paying_networks'] = 'Configuration des réseaux payeurs'; +$lang['edit_paying_and_transmitting_networks'] = 'Configuration des réseaux payeurs et emetteurs'; $lang['configure'] = 'Configurer'; $lang['configure_share_rate'] = 'Configurer le taux de partage'; $lang['share_rate'] = 'Taux de partage'; @@ -542,5 +542,9 @@ $lang['bank_deactivated'] = "La banque a été désactivée"; $lang['bank_deactivation'] = "Désactivation de la banque"; $lang['modify_bank'] = "Modifier la banque"; $lang['assign_bank_to_country'] = "Assigner une banque à un pays"; +$lang['transmitting_networks'] = "Réseaux émetteurs"; +$lang['transmitter_network_activated'] = "Réseau emetteur activé"; +$lang['transmitter_network_deactivated'] = "Réseau emetteur desactivé"; +$lang['paying_networks'] = 'Réseaux payeurs'; ?> diff --git a/application/models/Wallet_model.php b/application/models/Wallet_model.php index e5a5f046..985fc669 100644 --- a/application/models/Wallet_model.php +++ b/application/models/Wallet_model.php @@ -904,4 +904,23 @@ LEFT JOIn networks_banks nb ON nb.id_bank_country = bc.id AND nb.id_network = n. $query = $this->db->query($sql , array($id_network)); return $query->num_rows() > 0 ? $query : false ; } + + // Reseaux emetteurs + public function getTransmittingNetwork($id_network ,$idConfig){ + $sql = "SELECT * FROM `transmitting_networks` WHERE `id_network` = ? AND id_configWallet = ? ;"; + $query = $this->db->query($sql , array($id_network,$idConfig)); + return $query->num_rows() > 0 ? $query : false ; + } + + public function countTransmittiongNetworks($id_country ,$idConfig){ + $sql = "SELECT count(id) as total FROM `transmitting_networks` WHERE `id_network` IN (SELECT distinct n.id FROM countries c INNER JOIN + networks n ON n.country_id = c.id WHERE n.status = 1 AND c.id = ? + ) AND id_configWallet = ? ;"; + $query = $this->db->query($sql , array($id_country, $idConfig)); + if($query->num_rows()>0){ + return $query; + }else{ + return false; + } + } } diff --git a/application/views/gestion_wallet_ilink_config_paying_network.php b/application/views/gestion_wallet_ilink_config_paying_network.php index 76296c40..f250ca39 100755 --- a/application/views/gestion_wallet_ilink_config_paying_network.php +++ b/application/views/gestion_wallet_ilink_config_paying_network.php @@ -8,7 +8,7 @@

- lang->line('edit_paying_networks') . ' - ' . $country->name; ?> + lang->line('edit_paying_and_transmitting_networks') . ' - ' . $country->name; ?>

-

lang->line('Réseaux activés'); ?>

+

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

@@ -152,6 +152,77 @@
+ +
+
+
+
+

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

+
+
+ + 0) { + ?> + + + + + + + + + + + + + + + "; + ?> + is_transmitting_network){ + ?> + + + + + + + + +
lang->line('Nom'); ?>Walletlang->line('Statut'); ?> Action
$num$row->name" . strtoupper($row->type) . "lang->line('Actif'); ?>lang->line('Inactif'); ?>
+ + lang->line('Aucun réseau'); + } + } else { + echo $this->lang->line('Aucun réseau'); + } + ?> +
+
+
+
@@ -171,7 +242,6 @@ - diff --git a/application/views/gestion_wallet_ilink_config_paying_networks.php b/application/views/gestion_wallet_ilink_config_paying_networks.php index e2b411ed..1626edb6 100755 --- a/application/views/gestion_wallet_ilink_config_paying_networks.php +++ b/application/views/gestion_wallet_ilink_config_paying_networks.php @@ -6,7 +6,7 @@

- lang->line('edit_paying_networks'); ?> + lang->line('edit_paying_and_transmitting_networks'); ?>

N° - lang->line('Nom'); ?> - Status + lang->line('Nom'); ?> + lang->line('paying_networks'); ?> + lang->line('transmitting_networks'); ?> Action @@ -71,9 +72,20 @@ $row->name"; ?> total > 0){ + if($row->total_paying){ ?> - total.' réseaux' ?> + total_paying.' '.$this->lang->line($row->total_paying > 1 ? 'Reseaux' : 'Reseau') ?> + + lang->line('no_network'); ?> + + total_transmitting){ + ?> + total_transmitting.' '.$this->lang->line($row->total_paying > 1 ? 'Reseaux' : 'Reseau') ?> @@ -107,48 +119,6 @@ - - - - - - -
@@ -167,98 +137,9 @@ - - - - - diff --git a/application/views/gestion_wallet_ilink_hyp.php b/application/views/gestion_wallet_ilink_hyp.php index 379be3cf..d22c2079 100755 --- a/application/views/gestion_wallet_ilink_hyp.php +++ b/application/views/gestion_wallet_ilink_hyp.php @@ -93,8 +93,8 @@
lang->line('edit_paying_networks') ?> + style="width: 100%">lang->line('edit_paying_and_transmitting_networks') ?>
diff --git a/application/views/historique_transactions_ilink.php b/application/views/historique_transactions_ilink.php index b7242675..14ae7c71 100755 --- a/application/views/historique_transactions_ilink.php +++ b/application/views/historique_transactions_ilink.php @@ -275,9 +275,9 @@ function toLocateDate($date , $timezone){ const format = lang === 'french' ? 'fr' : 'en'; moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date var table = $('#transactions').DataTable({ - "aaSorting": [[18, "desc"]], + "aaSorting": [[19, "desc"]], "columnDefs": [{ - targets: 18, + targets: 19, render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format) }], dom: 'Bfrtip', @@ -286,14 +286,14 @@ function toLocateDate($date , $timezone){ { extend: 'excelHtml5', title: "lang->line('Historique des transactions') ?>", - exportOptions: { - columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] - }, + // exportOptions: { + // columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] + // }, customizeData: function (data) { for (var i = 0; i < data.body.length; i++) { for (var j = 0; j < data.body[i].length; j++) { // data.body[i][j] = '\u200C' + data.body[i][j]; - if ([3, 4, 5, 9, 10, 11, 12, 13, 14].includes(j)) { + if ([3, 4, 5, 10, 11, 12, 13, 14,15].includes(j)) { // Get the value and strip the non numeric characters // var value = $(this).text(); value = data.body[i][j].replace(',', ".")