+ Fix some bug

This commit is contained in:
Djery-Tom 2021-01-25 10:51:05 +01:00
parent 6c37804153
commit 0df17bafc2
3 changed files with 16 additions and 98 deletions

View File

@ -625,19 +625,11 @@ class Gestion extends CI_Controller
}
$data['alert'] = "ok";
$data['success'] = "ok";
$data['active'] = "members";
$data['message'] = "$number codes have been added!";
$ville = $this->session->userdata('current_ville');
$hyper = $this->session->userdata('current_hyper');
$pays = $this->session->userdata('current_pays');
$data['pays'] = $this->user_model->getAllCountries();
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
$data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
$data['list'] = $this->user_model->getGeneratedHyperCodes();
$data['active'] = "codes";
$data['active'] = "codes-hyper";
$data['pays'] = $this->user_model->getAllCountries();
$data['game_pays'] = $this->user_model->getGameCountry();
$data['firstname'] = $this->session->userdata('firstname');
@ -701,11 +693,6 @@ class Gestion extends CI_Controller
$this->load->view('login', $data);
} else {
$ville = $this->session->userdata('current_ville');
$hyper = $this->session->userdata('current_hyper');
$pays = $this->session->userdata('current_pays');
$data['pays'] = $this->user_model->getAllCountries();
$data['game_pays'] = $this->user_model->getGameCountry();
$data['villes'] = $this->user_model->getVillesByPays($data['pays']->first_row()->id);
@ -713,18 +700,20 @@ class Gestion extends CI_Controller
$data['active_ville_id'] = $data['villes']->first_row()->id;
$data['agent'] = $this->user_model->getAgentsFromCountry($data['pays']->first_row()->id);
$data['networks'] = $this->user_model->getNetworks($data['pays']->first_row()->id);
$data['current_agent'] = $data['agent'] ? $data['agent']->first_row()->lastname : null;
$data['alert'] = "";
$data['active'] = "geoloc";
$number_geolocalisation = array();
$network_geolocalisation = array();
$count = 0;
foreach ($data['networks']->result() AS $row) {
$number_geolocalisation[$count] = $this->user_model->getPointGeolocalised($row->id, $data['agent']->first_row()->lastname);
$network_geolocalisation[$count] = $row->name;
$count++;
if($data['networks']) {
foreach ($data['networks']->result() as $row) {
$number_geolocalisation[$count] = $this->user_model->getPointGeolocalised($row->id, $data['current_agent']);
$network_geolocalisation[$count] = $row->name;
$count++;
}
}
$data['current_agent'] = $data['agent']->first_row()->lastname;
$data["number_geolocalisation"] = $number_geolocalisation;
$data["network_geolocalisation"] = $network_geolocalisation;
$data["total"] = $count;
@ -768,10 +757,12 @@ class Gestion extends CI_Controller
$network_geolocalisation = array();
$count = 0;
foreach ($data['networks']->result() AS $row) {
$number_geolocalisation[$count] = $this->user_model->getPointGeolocalised($row->id, $lastname);
$network_geolocalisation[$count] = $row->name;
$count++;
if($data['networks']) {
foreach ($data['networks']->result() as $row) {
$number_geolocalisation[$count] = $this->user_model->getPointGeolocalised($row->id, $lastname);
$network_geolocalisation[$count] = $row->name;
$count++;
}
}
$data['current_agent'] = $lastname;
$data["number_geolocalisation"] = $number_geolocalisation;
@ -920,7 +911,7 @@ class Gestion extends CI_Controller
$data["agents"] = $agent;
$data["total_points"] = $total;
$data["countA"] = $countA;
$data['current_agent'] = $data['agent']->first_row()->lastname;
$data['current_agent'] = $data['agent'] ? $data['agent']->first_row()->lastname : null;
$data["number_geolocalisation"] = $number_geolocalisation;
$data["network_geolocalisation"] = $network_geolocalisation;
$data["total"] = $count;

View File

@ -779,8 +779,7 @@ class User_model extends CI_Model
$query=$this->db->query("SELECT countries.id,countries.name,countries.code_country,countries.code_dial
FROM countries
INNER JOIN towns t on countries.id = t.country_id and t.status=1
WHERE countries.id IN (SELECT country_id FROM networks INNER JOIN networks_agents ON networks.id=networks_agents.network_id GROUP BY networks.country_id)
INNER JOIN towns t on countries.id = t.country_id and t.status=1
GROUP BY countries.id");
return $query;
}

View File

@ -237,75 +237,3 @@
});
</script>
<script>
toastr.options.closeButton = true;
toastr.options.closeMethod = 'fadeOut';
toastr.options.closeDuration = 5000;
toastr.options.closeEasing = 'swing';
var id_transaction = null;
$(document).on("click", ".openModal", function () {
id_transaction = $(this).data('id-transaction');
})
$(document).on("click", "#cancel", function () {
const id_transaction = $(this).data('id-transaction');
$.ajax({
url : '<?php echo base_url('index.php/Gestion/cancelTransation')?>',
type : 'POST',
dataType : 'json',
data: {"id_transaction": id_transaction},
async:true,
success : function(data){
if(data){
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('canceled_transaction')?>",
text: "<?php echo $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
}else{
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
},
error : function(resultat, statut, erreur){
console.log(resultat+" "+erreur);
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
});
});
$('#delete').click(function(){
$.ajax({
url : '<?php echo base_url('index.php/Hyperviseur_dash/delete_wallet_transaction')?>',
type : 'POST',
dataType : 'json',
data: {"id_transaction": id_transaction},
success : function(data, statut){
if(data=='200'){
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('transaction_deleted')?>",
text: "<?php echo $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
}else{
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
},
error : function(resultat, statut, erreur){
console.log(resultat+" "+erreur);
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
});
});
</script>