Add open wallet at mobile login param in networks edit

This commit is contained in:
Djery-Tom 2022-05-16 13:21:44 +01:00
parent c2e8a5d957
commit 2090ba607c
6 changed files with 225 additions and 176 deletions

View File

@ -306,10 +306,12 @@ class Gestion extends CI_Controller
if (isset($_POST)) {
$old_network = $this->input->post('old_name');
$new_network = $this->input->post('new_network');
$open_wallet_at_mobile_login = $this->input->post('open_wallet_at_mobile_login');
$id_network = $this->input->post('id_network');
$res = $this->user_model->updateNetwork($old_network, $new_network);
$res = $this->user_model->updateNetwork($id_network ,$old_network, $new_network , $open_wallet_at_mobile_login);
if ($res == true) {
if ($res) {
echo json_encode("completed");
} else {
echo json_encode("error");

View File

@ -945,4 +945,5 @@ $lang['UNPAID'] = "Unpaid";
$lang['UNDER_RENEW'] = "Under renew";
$lang['STOPPED'] = "Stopped";
$lang['profile_image'] = "Profile image";
$lang['open_wallet_at_mobile_login'] = "Open wallet at mobile login"
?>

View File

@ -954,4 +954,5 @@ $lang['UNPAID'] = "Non Payée";
$lang['UNDER_RENEW'] = "En cours de renouvellement";
$lang['STOPPED'] = "Arretée";
$lang['profile_image'] = "Photo de profil";
$lang['open_wallet_at_mobile_login'] = "Ouverture du wallet à la connexion mobile"
?>

View File

@ -1079,7 +1079,7 @@ class User_model extends CI_Model
}
public function getAllAssignedNetworks(){
$query = $this->db->query("SELECT networks.name AS network,networks.status AS status,networks.id,countries.name AS country,networks.country_id FROM `networks` INNER JOIN countries ON networks.country_id=countries.id");
$query = $this->db->query("SELECT networks.name AS network,networks.status AS status,networks.id,countries.name AS country,networks.country_id , networks.open_wallet_at_mobile_login FROM `networks` INNER JOIN countries ON networks.country_id=countries.id");
return $query->num_rows() > 0 ? $query : false;
}
@ -1097,9 +1097,11 @@ class User_model extends CI_Model
}
}
public function updateNetwork($old_network,$new_network){
$query = $this->db->query("UPDATE networks SET networks.name='".$new_network."' WHERE networks.name ='".$old_network."'");
return $query;
public function updateNetwork($id_network,$old_network,$new_network, $open_wallet_at_mobile_login){
$this->db->query("UPDATE networks SET networks.name='".$new_network."' WHERE networks.name ='".$old_network."'");
// var_dump([$id_network,(int)$open_wallet_at_mobile_login]);
$this->db->where('id', $id_network);
return $this->db->update('networks',['open_wallet_at_mobile_login' => $open_wallet_at_mobile_login]);
}
public function getAllAdmin(){

View File

@ -95,7 +95,8 @@
</label></td>";
}
echo "<td id='edition' align='center'>
<button data-toggle='modal' data-id-network='$row->id' data-name-network='$row->network' data-country='$row->country' data-id-country='$row->country_id' class='open-modal modif btn btn-success' data-target='#editModal'><i class='fa fa-edit'></i></button>
<button data-toggle='modal' data-id-network='$row->id' data-name-network='$row->network' data-country='$row->country' data-id-country='$row->country_id'
data-open_wallet_at_mobile_login='$row->open_wallet_at_mobile_login' class='open-modal modif btn btn-success' data-target='#editModal'><i class='fa fa-edit'></i></button>
</td>
<td id='suppression' align='center'>
<button data-toggle='modal' data-id-network='$row->id' data-id-country='$row->country_id' class=' btn btn-danger' data-target='#'><i class='fa fa-trash'></i></button>
@ -208,6 +209,10 @@
<label for="modal-reseau"><?= $this->lang->line('Reseau'); ?></label>
<input type="text" class="form-control input-lg" name="reseau" required id="modal-reseau">
</div>
<div class="form-group">
<input type="checkbox" name="open_wallet_at_mobile_login" id="modal-open_wallet_at_mobile_login">
<label for="modal-open_wallet_at_mobile_login"><?php echo $this->lang->line('open_wallet_at_mobile_login'); ?></label>
</div>
<div class="form-group">
<input id="btn-add" type="submit" value="Confirmer" class="btn btn-primary">
<button type="button" class="btn btn-default pull-right" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
@ -315,9 +320,11 @@
name_network = $(this).data('name-network');
id_country = $(this).data('id-country');
country = $(this).data('country');
const open_wallet_at_mobile_login = $(this).data('open_wallet_at_mobile_login');
$(".modal-body #modal-pays").val(country);
$(".modal-body #modal-reseau").val( name_network );
$(".modal-body #modal-open_wallet_at_mobile_login").prop('checked', open_wallet_at_mobile_login);
});
@ -371,12 +378,12 @@
});
$("#update-form").submit(function(){
var up_network = $("#update-form #modal-reseau").val();
let up_network = $("#update-form #modal-reseau").val();
let open_wallet_at_mobile_login = $("#update-form #modal-open_wallet_at_mobile_login").is(':checked') ? 1 : 0 ;
$.ajax({
url:'<?= base_url('Gestion/update_network')?>',
type: 'post',
data: {new_network: up_network,old_name:name_network},
data: {new_network: up_network,old_name:name_network , open_wallet_at_mobile_login : open_wallet_at_mobile_login, id_network : id_network},
dataType: 'json',
success: function(data){
if(data==='completed'){

View File

@ -1,4 +1,4 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html>
<head>
@ -22,7 +22,6 @@
<link rel="icon" href="<?= base_url('favicon.ico') ?>" type="image/x-icon">
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
@ -47,20 +46,27 @@
<header class="main-header">
<!-- Logo -->
<a href="#" class="logo">
<?php
if ($this->session->userdata('network_id') == '271') {
?>
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>iLink</b></span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg">
<?php
if($this->session->userdata('network_id') == '271') {
?>
<img class="img img-responsive img-dash" src="<?= base_url('images/miang-logo.png') ?>">
<b>MIANG</b>
</span>
<?php } else { ?>
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>iLink</b></span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg">
<img class="img img-responsive img-dash" src="<?= base_url('images/logo.png') ?>">
<b>iLink</b> World
<?php } ?>
</span>
<?php } ?>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top">
@ -74,25 +80,26 @@
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<?= $this->lang->line('Bienvenue'); ?> <span class="hidden-xs"><b><?= $this->session->userdata('firstname').' '.$this->session->userdata('lastname');?></b></span>
<?= $this->lang->line('Bienvenue'); ?> <span
class="hidden-xs"><b><?= $this->session->userdata('firstname') . ' ' . $this->session->userdata('lastname'); ?></b></span>
</a>
<ul class="dropdown-menu">
<!-- User image -->
<li class="user-header">
<p>
<?= $this->session->userdata('network').' - '.$this->session->userdata('member_code');?>
<small><?= $this->session->userdata('email');?></small>
<?= $this->session->userdata('network') . ' - ' . $this->session->userdata('member_code'); ?>
<small><?= $this->session->userdata('email'); ?></small>
</p>
</li>
<li class="user-body">
<div class="row">
<div class="col-xs-6 text-center">
<?= $this->session->userdata('current_pays');?>
<?= $this->session->userdata('current_pays'); ?>
</div>
<div class="col-xs-6 text-center">
<?= $this->session->userdata('phone');?>
<?= $this->session->userdata('phone'); ?>
</div>
</div>
<!-- /.row -->
@ -100,7 +107,8 @@
<li class="user-footer">
<div class="pull-right">
<a href="<?= base_url('Users/logout') ?>" class="btn btn-default btn-flat"><?= $this->lang->line('Déconnexion'); ?></a>
<a href="<?= base_url('Users/logout') ?>"
class="btn btn-default btn-flat"><?= $this->lang->line('Déconnexion'); ?></a>
</div>
</li>
</ul>
@ -117,7 +125,9 @@
<!-- sidebar menu: : style can be found in sidebar.less -->
<ul class="sidebar-menu" data-widget="tree">
<li class="<?php if($active=="dash"){echo "active ";} ?>">
<li class="<?php if ($active == "dash") {
echo "active ";
} ?>">
<a href="<?= base_url('Hyperviseur_dash') ?>">
@ -125,10 +135,12 @@
</a>
</li>
<li class="<?php if($active=="geolocated"){echo "active ";} ?>">
<li class="<?php if ($active == "geolocated") {
echo "active ";
} ?>">
<a href="#" data-toggle="modal" data-target="#modal-default">
<i class="fa fa-users"></i>
<span><?= $this->lang->line($hasWallet->first_row()->type == 'ilink_sante' ? 'service_providers' : 'Utilisateurs géolocalisés' ); ?></span>
<span><?= $this->lang->line($hasWallet->first_row()->type == 'ilink_sante' ? 'service_providers' : 'Utilisateurs géolocalisés'); ?></span>
</a>
</li>
@ -140,7 +152,7 @@
</a>
</li>
<?php if($hasWallet->first_row()->type != 'ilink_sante') { ?>
<?php if ($hasWallet->first_row()->type != 'ilink_sante') { ?>
<li class="<?= "treeview " . ((strpos($active, "demandes_credits") !== false) ? "active menu-open" : "") ?>"
style="height: auto;">
<a href="#">
@ -156,7 +168,8 @@
echo "active ";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/getDemandes') ?>">
<i class="fa fa-users"></i> <span><?= $this->lang->line('Demandes de crédits'); ?></span>
<i class="fa fa-users"></i>
<span><?= $this->lang->line('Demandes de crédits'); ?></span>
</a>
</li>
@ -178,7 +191,7 @@
</a>
</li>
<?php } ?>
<?php if ($hasWallet) {?>
<?php if ($hasWallet) { ?>
<li class="<?= "treeview " . ((strpos($active, "wallet_") !== false) ? "active menu-open" : "") ?>"
style="height: auto;">
<a href="#">
@ -199,49 +212,65 @@
</a>
</li>
<?php if ($hasWallet->first_row()->type == 'ilink_sante') { ?>
<li class="<?php if ($active == "wallet_drugs_and_devices") {echo "active";} ?>">
<li class="<?php if ($active == "wallet_drugs_and_devices") {
echo "active";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/drugs_and_devices') ?>">
<i class="fa fa-ambulance"></i>
<span><?= $this->lang->line('drugs_and_devices'); ?></span>
</a>
</li>
<li class="<?php if ($active == "wallet_validating_doctors") {echo "active";} ?>">
<li class="<?php if ($active == "wallet_validating_doctors") {
echo "active";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/validating_agents/doctors') ?>">
<i class="fa fa-stethoscope"></i>
<span><?= $this->lang->line('validating_doctors'); ?></span>
</a>
</li>
<li class="<?php if ($active == "wallet_validating_controllers") {echo "active";} ?>">
<li class="<?php if ($active == "wallet_validating_controllers") {
echo "active";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/validating_agents/controllers') ?>">
<i class="fa fa-stethoscope"></i>
<span><?= $this->lang->line('controllers_doctors'); ?></span>
</a>
</li>
<li class="<?php if ($active == "wallet_validating_agents") {echo "active";} ?>">
<li class="<?php if ($active == "wallet_validating_agents") {
echo "active";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/validating_agents') ?>">
<i class="fa fa-user"></i>
<span><?= $this->lang->line('validating_agents'); ?></span>
</a>
</li>
<li class="<?php if ($active == "wallet_insured") {echo "active";} ?>">
<li class="<?php if ($active == "wallet_insured") {
echo "active";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/wallet?history=insurance-insured') ?>">
<i class="fa fa-medkit"></i>
<span><?= $this->lang->line('insured'); ?></span>
</a>
</li>
<li class="<?php if ($active == "wallet_health_care_sheets") {echo "active";} ?>">
<li class="<?php if ($active == "wallet_health_care_sheets") {
echo "active";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/wallet?history=insurance-health_care_sheets') ?>">
<i class="fa fa-file-text"></i>
<span><?= $this->lang->line('health_care_sheets'); ?></span>
</a>
</li>
<li class="<?php if ($active == "wallet_invoices") {echo "active";} ?>">
<li class="<?php if ($active == "wallet_invoices") {
echo "active";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/wallet?history=insurance-invoices') ?>">
<i class="fa fa-file-text"></i>
<span><?= $this->lang->line('invoices'); ?></span>
</a>
</li>
<li class="<?php if ($active == "wallet_exclusions") {echo "active";} ?>">
<li class="<?php if ($active == "wallet_exclusions") {
echo "active";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/exclusions') ?>">
<i class="fa fa-times"></i>
<span>Exclusions</span>
@ -269,22 +298,28 @@
</a>
</li>
<li class="<?php if($active=="operators"){echo "active";} ?>">
<li class="<?php if ($active == "operators") {
echo "active";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/operators') ?>">
<i class="fa fa-building"></i> <span><?= $this->lang->line('operators'); ?></span>
</a>
</li>
<?php }?>
<?php } ?>
<?php } ?>
<li class="<?php if($active=="recherche"){echo "active";} ?>">
<li class="<?php if ($active == "recherche") {
echo "active";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/recherche') ?>">
<i class="glyphicon glyphicon-search"></i> <span><?= $this->lang->line('Rechercher'); ?></span>
</a>
</li>
<?php if (($hasWallet) && ($hasWallet->first_row()->type == 'ilink')){?>
<li class="<?php if($active=="documentation"){echo "active";} ?>">
<?php if (($hasWallet) && ($hasWallet->first_row()->type == 'ilink')) { ?>
<li class="<?php if ($active == "documentation") {
echo "active";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/documentation') ?>">
<i class="fa fa-book"></i> <span>Documentation</span>
</a>
@ -299,7 +334,7 @@
<div class="modal fade" id="modal-default">
<div class="modal-dialog">
<div class="modal-content">
<form action="<?= base_url('Hyperviseur_dash/getAllUser_g')?>" method="post">
<form action="<?= base_url('Hyperviseur_dash/getAllUser_g') ?>" method="post">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
@ -311,17 +346,17 @@
<div class="form-group">
<?php
$result=$villes;
$numrows=$result->num_rows();
$result = $villes;
$numrows = $result->num_rows();
if ($numrows > 0) { ?>
<select class="form-control input-lg" name="ville" required>
<?php foreach($result->result() as $row) {
<?php foreach ($result->result() as $row) {
echo "<option value='$row->id'>".$row->ville."</option>";
echo "<option value='$row->id'>" . $row->ville . "</option>";
} ?>
</select>
<?php }else{
<?php } else {
echo "Aucun utilisateur géolocalisé";
}
?>
@ -330,7 +365,8 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
<button type="button" class="btn btn-default pull-left"
data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
<button type="submit" class="btn btn-primary"><?= $this->lang->line('Continuer'); ?></button>
</div>
</form>