diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php index 071f438a..edea78a3 100755 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -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"); diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index b6684ec2..66402ceb 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -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" ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index 287fdbbc..42524349 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -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" ?> diff --git a/application/models/User_model.php b/application/models/User_model.php index 1e3ed3f6..bd0f87ff 100755 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -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(){ @@ -1619,7 +1621,7 @@ class User_model extends CI_Model return $query->row()->valeur; }else{ return false; - } + } } public function getNameCountry($id){ $query = $this->db->query("SELECT name FROM countries WHERE id=".$id); @@ -1643,16 +1645,16 @@ class User_model extends CI_Model return true; }else{ return false; - } + } } public function create_town($country_id,$name){ $query = $this->db->query("INSERT INTO towns (`country_id`, `name`, `status`) VALUES (".$country_id.", '".$name."', 1)"); - return $query; + return $query; } public function update_town_agent($lat,$lng,$town_id){ $query = $this->db->query("UPDATE agents SET `town_id` = ".$town_id." WHERE `latitude`= ".$lat." AND `longitude`=".$lng); return $query; - + } //wallet @@ -1692,7 +1694,7 @@ class User_model extends CI_Model $query = $this->db->query("SELECT * FROM infos_transaction WHERE `network_id`=".$id_network.$chain); - return $query->num_rows() > 0 ? $query : false; + return $query->num_rows() > 0 ? $query : false; } public function getDeletedTransactions($debut , $fin , $id_network){ @@ -1715,7 +1717,7 @@ class User_model extends CI_Model $query = $this->db->query("SELECT * FROM wallet_agent WHERE `network_id`=".$id_network); - return $query->num_rows() > 0 ? $query : false; + return $query->num_rows() > 0 ? $query : false; } /** diff --git a/application/views/gestion_networks.php b/application/views/gestion_networks.php index 75cf29fc..2ea6de85 100755 --- a/application/views/gestion_networks.php +++ b/application/views/gestion_networks.php @@ -95,7 +95,8 @@ "; } echo "