assign network to operator
This commit is contained in:
parent
46d3c160fc
commit
19c1eb2437
|
|
@ -223,7 +223,7 @@ $config['allow_get_array'] = TRUE;
|
|||
| your log files will fill up very fast.
|
||||
|
|
||||
*/
|
||||
$config['log_threshold'] = 0;
|
||||
$config['log_threshold'] = 1;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -79,8 +79,6 @@ $db['default'] = array(
|
|||
'username' => 'root',
|
||||
'password' => '@iLink@2025',
|
||||
'database' => 'iLink_preprod',
|
||||
// 'password' => 'songuinho',
|
||||
// 'database' => 'iLink_world',
|
||||
'dbdriver' => 'mysqli',
|
||||
'dbprefix' => '',
|
||||
'pconnect' => FALSE,
|
||||
|
|
|
|||
|
|
@ -2337,35 +2337,84 @@ class Gestion extends CI_Controller
|
|||
|
||||
public function assign_operator()
|
||||
{
|
||||
if ($this->isLogged()) {
|
||||
if (isset($_POST)) {
|
||||
$id_operator = $this->input->post('id_operator');
|
||||
$existe = 0;
|
||||
$this->db->trans_begin();
|
||||
foreach ($_POST['id_country'] as $country) {
|
||||
$res = $this->wallet_model->checkIfOperatorAssignationExist($country, $id_operator);
|
||||
if ($res == false) {
|
||||
$data = array('id_country' => $country, 'id_operator' => $id_operator);
|
||||
$this->db->insert('operators_countries', $data);
|
||||
} else {
|
||||
$existe = $existe + 1;
|
||||
}
|
||||
}
|
||||
if ($this->db->trans_status() === FALSE) {
|
||||
$this->db->trans_rollback();
|
||||
echo json_encode("error");
|
||||
} elseif ($existe > 0) {
|
||||
$this->db->trans_commit();
|
||||
echo json_encode("existe");
|
||||
} else {
|
||||
$this->db->trans_commit();
|
||||
echo json_encode("completed");
|
||||
}
|
||||
if (!$this->isLogged()) {
|
||||
echo json_encode("unauthorized");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isset($_POST['id_operator']) || empty($_POST['id_country'])) {
|
||||
echo json_encode("invalid_data");
|
||||
return;
|
||||
}
|
||||
|
||||
$id_operator = $this->input->post('id_operator');
|
||||
$countries = $this->input->post('id_country');
|
||||
|
||||
$this->db->trans_begin();
|
||||
$existe = 0;
|
||||
$noNetwork = 0;
|
||||
|
||||
foreach ($countries as $id_country) {
|
||||
|
||||
// Vérifier si une assignation opérateur-pays existe déjà
|
||||
$res = $this->wallet_model->checkIfOperatorAssignationExist($id_country, $id_operator);
|
||||
|
||||
if ($res === false) {
|
||||
// Créer l’assignation opérateur-pays
|
||||
$data = [
|
||||
'id_country' => $id_country,
|
||||
'id_operator' => $id_operator
|
||||
];
|
||||
$this->db->insert('operators_countries', $data);
|
||||
$id_operator_country = $this->db->insert_id();
|
||||
} else {
|
||||
$id_operator_country = $res->row()->id;
|
||||
$existe++;
|
||||
}
|
||||
|
||||
// Récupérer les réseaux actifs de ce pays
|
||||
$activeNetworks = $this->db->query("
|
||||
SELECT id FROM networks
|
||||
WHERE country_id = ? AND status = 1 AND name LIKE 'iLink%'
|
||||
", [$id_country])->result();
|
||||
|
||||
if (empty($activeNetworks)) {
|
||||
$noNetwork++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Créer la liaison networks_operators pour chaque réseau actif
|
||||
foreach ($activeNetworks as $network) {
|
||||
$existsLink = $this->db->query("
|
||||
SELECT 1 FROM networks_operators
|
||||
WHERE id_operator_country = ? AND id_network = ?
|
||||
", [$id_operator_country, $network->id])->num_rows();
|
||||
|
||||
if ($existsLink == 0) {
|
||||
$this->db->insert('networks_operators', [
|
||||
'id_operator_country' => $id_operator_country,
|
||||
'id_network' => $network->id
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gestion des statuts de transaction
|
||||
if ($this->db->trans_status() === FALSE) {
|
||||
$this->db->trans_rollback();
|
||||
echo json_encode("error");
|
||||
} else {
|
||||
$this->db->trans_commit();
|
||||
if ($noNetwork > 0 && $existe == 0)
|
||||
echo json_encode("Aucun réseau actif"); // certains pays n’ont pas de réseaux actifs
|
||||
elseif ($existe > 0)
|
||||
echo json_encode("existe");
|
||||
else
|
||||
echo json_encode("completed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function update_operator()
|
||||
{
|
||||
if ($this->isLogged()) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@
|
|||
<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') ?>">
|
||||
<!--<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">-->
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
<?php
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
|
@ -270,7 +270,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|||
var index = $("#transactions_taxes tbody tr:last-child").index();
|
||||
var row = "<tr> <td><input type='text' required class='form-control' name='nom' id='nom'></td> " +
|
||||
"<td> <select class='form-control' id='type' required> <option value='%'> % </option> <option value='fixe'> fixe </option> </select> </td> "+
|
||||
"<td><input type='number' required class='form-control' min='0' name='valeur' id='valeur'></td>" +
|
||||
"<td><input type='number' required class='form-control' min='0' step='0.01' name='valeur' id='valeur'></td>" +
|
||||
"<td> <select class='form-control' id='destination' required> <option value='national'> national </option> <option value='international'> international </option> </select> </td>" +
|
||||
"<td>" + actions5 + "</td>" +
|
||||
"</tr>";
|
||||
|
|
@ -313,7 +313,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|||
if(index == 1)
|
||||
$(this).html("<select class='form-control' id='type' required> <option value='%' > % </option> <option value='fixe'> fixe </option> </select>");
|
||||
if(index == 2)
|
||||
$(this).html('<input type="number" required class="form-control" min="0" value="' + $(this).text() + '">');
|
||||
$(this).html('<input type="number" required class="form-control" min="0" step="0.01" value="' + $(this).text() + '">');
|
||||
if(index == 3)
|
||||
$(this).html("<select class='form-control' id='destination' required> <option value='national'> national </option> <option value='international'> international </option> </select>");
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
<?php
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
<?php
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
|
|
|
|||
|
|
@ -493,10 +493,10 @@
|
|||
<label for="montant" class="col-form-label"><?= $this->lang->line('Montant') ?></label>
|
||||
<input type="text" required class="form-control" id="montant" name="montant" >
|
||||
</div>
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label for="password" class="col-form-label">--><?php //echo $this->lang->line('mot de passe') ?><!--</label>-->
|
||||
<!-- <input type="password" required class="form-control" name="password" id="password">-->
|
||||
<!-- </div>-->
|
||||
<!--<div class="form-group">-->
|
||||
<!--<label for="password" class="col-form-label">--><?php //echo $this->lang->line('mot de passe') ?><!--</label>-->
|
||||
<!--<input type="password" required class="form-control" name="password" id="password">-->
|
||||
<!--</div>-->
|
||||
<div class="form-group">
|
||||
<label><?= $this->lang->line('mot de passe') ?></label>
|
||||
<div class="input-group" id="show_hide_password">
|
||||
|
|
|
|||
|
|
@ -390,6 +390,8 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row centered">
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<div class="box">
|
||||
|
|
@ -421,6 +423,8 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
|
|||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?= $this->lang->line('rate_com_user_wallet_wallet_national'); ?></h3>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
|
||||
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
|
||||
|
||||
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
||||
|
||||
<?php
|
||||
|
|
|
|||
Loading…
Reference in New Issue