adjust addWallet function
This commit is contained in:
parent
61e25b475a
commit
9de7bbf21a
|
|
@ -4,6 +4,8 @@ defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
use Brick\Money\Context\AutoContext;
|
use Brick\Money\Context\AutoContext;
|
||||||
use Brick\Money\Money;
|
use Brick\Money\Money;
|
||||||
|
|
||||||
|
use function PHPSTORM_META\type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by PhpStorm.
|
* Created by PhpStorm.
|
||||||
* User: Hanry Nzale
|
* User: Hanry Nzale
|
||||||
|
|
|
||||||
|
|
@ -1082,4 +1082,5 @@ $lang['fixed_fees_currency'] = "Fixed fee currency";
|
||||||
$lang['add_rate'] = "Add a rate";
|
$lang['add_rate'] = "Add a rate";
|
||||||
$lang['channel'] = "Channel/Réseau";
|
$lang['channel'] = "Channel/Réseau";
|
||||||
$lang["select_country"] = "Select a country";
|
$lang["select_country"] = "Select a country";
|
||||||
|
$lang["confirm_recharge_account"] = "Confirm account recharge";
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1090,4 +1090,5 @@ $lang['fixed_fees_currency'] = "Monnaie des frais fixes";
|
||||||
$lang['add_rate'] = "Ajouter un taux";
|
$lang['add_rate'] = "Ajouter un taux";
|
||||||
$lang['channel'] = "Cannal/Réseau";
|
$lang['channel'] = "Cannal/Réseau";
|
||||||
$lang["select_country"] = "Sélectionner un pays";
|
$lang["select_country"] = "Sélectionner un pays";
|
||||||
|
$lang["confirm_recharge_account"] = "Confirmer le rechargement du compte";
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -88,17 +88,35 @@ class Wallet_model extends CI_Model
|
||||||
return $query->num_rows() > 0 ? $query : false ;
|
return $query->num_rows() > 0 ? $query : false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addWallet($id_agent){
|
public function addWallet($id_agent)
|
||||||
$query = $this->db->get_where('networks_agents' , ['agent_id' => $id_agent]);
|
{
|
||||||
if($query->num_rows()>0){
|
$sql = "SELECT id FROM networks_agents WHERE agent_id = ?";
|
||||||
$id_networkAgent = $query->first_row()->id;
|
$query = $this->db->query($sql, [$id_agent]);
|
||||||
$query = $this->db->insert('wallets' , ['id_networkAgent' => $id_networkAgent]);
|
|
||||||
return $query;
|
if ($query->num_rows() === 0) {
|
||||||
}else{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
$id_networkAgent = $query->first_row()->id;
|
||||||
|
|
||||||
|
// Vérifier si un wallet existe déjà pour ce id_networkAgent
|
||||||
|
$check = $this->db->query(
|
||||||
|
"SELECT id FROM wallets WHERE id_networkAgent = ?",
|
||||||
|
[$id_networkAgent]
|
||||||
|
);
|
||||||
|
if ($check->num_rows() > 0) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Insérer un nouveau wallet sinon
|
||||||
|
$query = $this->db->query(
|
||||||
|
"INSERT INTO wallets (id_networkAgent) VALUES (?)",
|
||||||
|
[$id_networkAgent]
|
||||||
|
);
|
||||||
|
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getAgentTransactions($id_wallet){
|
public function getAgentTransactions($id_wallet){
|
||||||
$query = $this->db->get_where('wallet_transaction' , ['id_wallet' => $id_wallet]);
|
$query = $this->db->get_where('wallet_transaction' , ['id_wallet' => $id_wallet]);
|
||||||
return $query->num_rows() > 0 ? $query : false ;
|
return $query->num_rows() > 0 ? $query : false ;
|
||||||
|
|
|
||||||
|
|
@ -550,67 +550,58 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function myMap() {
|
function myMap() {
|
||||||
|
var mapProp = {
|
||||||
var mapProp= {
|
center: new google.maps.LatLng(<?= $latitude; ?>, <?= $longitude; ?>),
|
||||||
center:new google.maps.LatLng(<?= $latitude; ?>,<?= $longitude; ?>),
|
zoom: <?= $this->session->userdata('category') != 'admin' ? 10 : 1; ?>,
|
||||||
<?php
|
mapId: "DEMO_MAP_ID" // Remplacez par votre propre Map ID si nécessaire
|
||||||
if($this->session->userdata('category')!='admin'){
|
|
||||||
echo "zoom:10";
|
|
||||||
}else{
|
|
||||||
echo "zoom:1";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var myLatLng = {lat: <?= $latitude; ?>, lng: <?= $longitude; ?>};
|
var myLatLng = {lat: <?= $latitude; ?>, lng: <?= $longitude; ?>};
|
||||||
var map=new google.maps.Map(document.getElementById("map"),mapProp);
|
var map = new google.maps.Map(document.getElementById("map"), mapProp);
|
||||||
|
|
||||||
<?php
|
<?php if($this->session->userdata('category') != 'admin'): ?>
|
||||||
if($this->session->userdata('category')!='admin'){
|
var myPosition = new google.maps.marker.AdvancedMarkerElement({
|
||||||
echo "var myPosition = new google.maps.Marker({
|
|
||||||
position: myLatLng,
|
|
||||||
map: map,
|
map: map,
|
||||||
title: '".$this->lang->line('Vous')."'
|
position: myLatLng,
|
||||||
});";
|
title: '<?= $this->lang->line('Vous'); ?>'
|
||||||
}
|
});
|
||||||
?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
$result = $positions;
|
||||||
$result=$positions;
|
if ($result != false) {
|
||||||
|
$numrows = $result->num_rows();
|
||||||
if($result!=false){
|
|
||||||
$numrows=$result->num_rows();
|
|
||||||
$num = 0;
|
$num = 0;
|
||||||
if ($numrows > 0) {
|
if ($numrows > 0) {
|
||||||
|
|
||||||
$site_url = base_url();
|
$site_url = base_url();
|
||||||
// output data of each row
|
|
||||||
foreach ($result->result() as $row) {
|
foreach ($result->result() as $row) {
|
||||||
$num++;
|
$num++;
|
||||||
$mlat = (float)$row->latitude;
|
$mlat = (float)$row->latitude;
|
||||||
//echo $mlat.' '.gettype($mlat).' ';
|
|
||||||
$mlng = (float)$row->longitude;
|
$mlng = (float)$row->longitude;
|
||||||
echo "var marker = new google.maps.Marker({
|
echo "var marker = new google.maps.marker.AdvancedMarkerElement({
|
||||||
position: {lat:" .$mlat.", lng: ".$mlng."},
|
|
||||||
map: map,
|
map: map,
|
||||||
title: '".addslashes($row->lastname)."'
|
position: {lat: " . $mlat . ", lng: " . $mlng . "},
|
||||||
|
title: '" . addslashes($row->lastname) . "'
|
||||||
});";
|
});";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
|
||||||
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js">
|
function loadScript() {
|
||||||
|
var script = document.createElement("script");
|
||||||
|
script.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyDwljY6bNBeL6ZsY-1Lz9imVCAshEXVkNc&callback=myMap&libraries=marker";
|
||||||
|
script.async = true;
|
||||||
|
script.defer = true;
|
||||||
|
document.body.appendChild(script);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onload = loadScript;
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDwljY6bNBeL6ZsY-1Lz9imVCAshEXVkNc&callback=myMap">
|
|
||||||
|
|
||||||
|
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
|
|
|
||||||
|
|
@ -446,59 +446,55 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function myMap() {
|
function myMap() {
|
||||||
|
var mapProp = {
|
||||||
var mapProp= {
|
center: new google.maps.LatLng(<?= $latitude; ?>, <?= $longitude; ?>),
|
||||||
center:new google.maps.LatLng(<?= $latitude; ?>,<?= $longitude; ?>),
|
zoom: <?= $this->session->userdata('category') != 'admin' ? 10 : 1; ?>,
|
||||||
<?php
|
mapId: "DEMO_MAP_ID" // Remplacez par votre propre Map ID si nécessaire
|
||||||
if($this->session->userdata('category')!='admin'){
|
|
||||||
echo "zoom:10";
|
|
||||||
}else{
|
|
||||||
echo "zoom:1";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var myLatLng = {lat: <?= $latitude; ?>, lng: <?= $longitude; ?>};
|
var myLatLng = {lat: <?= $latitude; ?>, lng: <?= $longitude; ?>};
|
||||||
var map=new google.maps.Map(document.getElementById("map"),mapProp);
|
var map = new google.maps.Map(document.getElementById("map"), mapProp);
|
||||||
|
|
||||||
<?php
|
<?php if($this->session->userdata('category') != 'admin'): ?>
|
||||||
if($this->session->userdata('category')!='admin'){
|
var myPosition = new google.maps.marker.AdvancedMarkerElement({
|
||||||
echo "var myPosition = new google.maps.Marker({
|
|
||||||
position: myLatLng,
|
|
||||||
map: map,
|
map: map,
|
||||||
title: '".$this->lang->line('Vous')."'
|
position: myLatLng,
|
||||||
});";
|
title: '<?= $this->lang->line('Vous'); ?>'
|
||||||
}
|
});
|
||||||
?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
$result = $positions;
|
||||||
$result=$positions;
|
if ($result != false) {
|
||||||
|
$numrows = $result->num_rows();
|
||||||
if($result!=false){
|
|
||||||
$numrows=$result->num_rows();
|
|
||||||
$num = 0;
|
$num = 0;
|
||||||
if ($numrows > 0) {
|
if ($numrows > 0) {
|
||||||
|
|
||||||
$site_url = base_url();
|
$site_url = base_url();
|
||||||
// output data of each row
|
|
||||||
foreach ($result->result() as $row) {
|
foreach ($result->result() as $row) {
|
||||||
$num++;
|
$num++;
|
||||||
$mlat = (float)$row->latitude;
|
$mlat = (float)$row->latitude;
|
||||||
//echo $mlat.' '.gettype($mlat).' ';
|
|
||||||
$mlng = (float)$row->longitude;
|
$mlng = (float)$row->longitude;
|
||||||
echo "var marker = new google.maps.Marker({
|
echo "var marker = new google.maps.marker.AdvancedMarkerElement({
|
||||||
position: {lat:" .$mlat.", lng: ".$mlng."},
|
|
||||||
map: map,
|
map: map,
|
||||||
title: '".addslashes($row->lastname)."'
|
position: {lat: " . $mlat . ", lng: " . $mlng . "},
|
||||||
|
title: '" . addslashes($row->lastname) . "'
|
||||||
});";
|
});";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadScript() {
|
||||||
|
var script = document.createElement("script");
|
||||||
|
script.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyDwljY6bNBeL6ZsY-1Lz9imVCAshEXVkNc&callback=myMap&libraries=marker";
|
||||||
|
script.async = true;
|
||||||
|
script.defer = true;
|
||||||
|
document.body.appendChild(script);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onload = loadScript;
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
|
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
|
||||||
<script async defer
|
|
||||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDwljY6bNBeL6ZsY-1Lz9imVCAshEXVkNc&callback=myMap"></script>
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue