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\Money;
|
||||
|
||||
use function PHPSTORM_META\type;
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Hanry Nzale
|
||||
|
|
|
|||
|
|
@ -1082,4 +1082,5 @@ $lang['fixed_fees_currency'] = "Fixed fee currency";
|
|||
$lang['add_rate'] = "Add a rate";
|
||||
$lang['channel'] = "Channel/Réseau";
|
||||
$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['channel'] = "Cannal/Réseau";
|
||||
$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 ;
|
||||
}
|
||||
|
||||
public function addWallet($id_agent){
|
||||
$query = $this->db->get_where('networks_agents' , ['agent_id' => $id_agent]);
|
||||
if($query->num_rows()>0){
|
||||
$id_networkAgent = $query->first_row()->id;
|
||||
$query = $this->db->insert('wallets' , ['id_networkAgent' => $id_networkAgent]);
|
||||
return $query;
|
||||
}else{
|
||||
public function addWallet($id_agent)
|
||||
{
|
||||
$sql = "SELECT id FROM networks_agents WHERE agent_id = ?";
|
||||
$query = $this->db->query($sql, [$id_agent]);
|
||||
|
||||
if ($query->num_rows() === 0) {
|
||||
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){
|
||||
$query = $this->db->get_where('wallet_transaction' , ['id_wallet' => $id_wallet]);
|
||||
return $query->num_rows() > 0 ? $query : false ;
|
||||
|
|
|
|||
|
|
@ -550,67 +550,58 @@
|
|||
|
||||
<script>
|
||||
function myMap() {
|
||||
|
||||
var mapProp= {
|
||||
center:new google.maps.LatLng(<?= $latitude; ?>,<?= $longitude; ?>),
|
||||
<?php
|
||||
if($this->session->userdata('category')!='admin'){
|
||||
echo "zoom:10";
|
||||
}else{
|
||||
echo "zoom:1";
|
||||
}
|
||||
?>
|
||||
var mapProp = {
|
||||
center: new google.maps.LatLng(<?= $latitude; ?>, <?= $longitude; ?>),
|
||||
zoom: <?= $this->session->userdata('category') != 'admin' ? 10 : 1; ?>,
|
||||
mapId: "DEMO_MAP_ID" // Remplacez par votre propre Map ID si nécessaire
|
||||
};
|
||||
|
||||
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 if($this->session->userdata('category') != 'admin'): ?>
|
||||
var myPosition = new google.maps.marker.AdvancedMarkerElement({
|
||||
map: map,
|
||||
position: myLatLng,
|
||||
title: '<?= $this->lang->line('Vous'); ?>'
|
||||
});
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if($this->session->userdata('category')!='admin'){
|
||||
echo "var myPosition = new google.maps.Marker({
|
||||
position: myLatLng,
|
||||
$result = $positions;
|
||||
if ($result != false) {
|
||||
$numrows = $result->num_rows();
|
||||
$num = 0;
|
||||
if ($numrows > 0) {
|
||||
$site_url = base_url();
|
||||
foreach ($result->result() as $row) {
|
||||
$num++;
|
||||
$mlat = (float)$row->latitude;
|
||||
$mlng = (float)$row->longitude;
|
||||
echo "var marker = new google.maps.marker.AdvancedMarkerElement({
|
||||
map: map,
|
||||
title: '".$this->lang->line('Vous')."'
|
||||
position: {lat: " . $mlat . ", lng: " . $mlng . "},
|
||||
title: '" . addslashes($row->lastname) . "'
|
||||
});";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
$result=$positions;
|
||||
|
||||
if($result!=false){
|
||||
$numrows=$result->num_rows();
|
||||
$num = 0;
|
||||
if ($numrows > 0) {
|
||||
|
||||
$site_url = base_url();
|
||||
// output data of each row
|
||||
foreach ($result->result() as $row) {
|
||||
$num++;
|
||||
$mlat = (float)$row->latitude;
|
||||
//echo $mlat.' '.gettype($mlat).' ';
|
||||
$mlng = (float)$row->longitude;
|
||||
echo "var marker = new google.maps.Marker({
|
||||
position: {lat:" .$mlat.", lng: ".$mlng."},
|
||||
map: map,
|
||||
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 async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDwljY6bNBeL6ZsY-1Lz9imVCAshEXVkNc&callback=myMap">
|
||||
|
||||
|
||||
</script>
|
||||
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
$( document ).ready(function() {
|
||||
|
|
|
|||
|
|
@ -446,59 +446,55 @@
|
|||
|
||||
<script>
|
||||
function myMap() {
|
||||
|
||||
var mapProp= {
|
||||
center:new google.maps.LatLng(<?= $latitude; ?>,<?= $longitude; ?>),
|
||||
<?php
|
||||
if($this->session->userdata('category')!='admin'){
|
||||
echo "zoom:10";
|
||||
}else{
|
||||
echo "zoom:1";
|
||||
}
|
||||
?>
|
||||
var mapProp = {
|
||||
center: new google.maps.LatLng(<?= $latitude; ?>, <?= $longitude; ?>),
|
||||
zoom: <?= $this->session->userdata('category') != 'admin' ? 10 : 1; ?>,
|
||||
mapId: "DEMO_MAP_ID" // Remplacez par votre propre Map ID si nécessaire
|
||||
};
|
||||
|
||||
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 if($this->session->userdata('category') != 'admin'): ?>
|
||||
var myPosition = new google.maps.marker.AdvancedMarkerElement({
|
||||
map: map,
|
||||
position: myLatLng,
|
||||
title: '<?= $this->lang->line('Vous'); ?>'
|
||||
});
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if($this->session->userdata('category')!='admin'){
|
||||
echo "var myPosition = new google.maps.Marker({
|
||||
position: myLatLng,
|
||||
$result = $positions;
|
||||
if ($result != false) {
|
||||
$numrows = $result->num_rows();
|
||||
$num = 0;
|
||||
if ($numrows > 0) {
|
||||
$site_url = base_url();
|
||||
foreach ($result->result() as $row) {
|
||||
$num++;
|
||||
$mlat = (float)$row->latitude;
|
||||
$mlng = (float)$row->longitude;
|
||||
echo "var marker = new google.maps.marker.AdvancedMarkerElement({
|
||||
map: map,
|
||||
title: '".$this->lang->line('Vous')."'
|
||||
position: {lat: " . $mlat . ", lng: " . $mlng . "},
|
||||
title: '" . addslashes($row->lastname) . "'
|
||||
});";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
$result=$positions;
|
||||
|
||||
if($result!=false){
|
||||
$numrows=$result->num_rows();
|
||||
$num = 0;
|
||||
if ($numrows > 0) {
|
||||
|
||||
$site_url = base_url();
|
||||
// output data of each row
|
||||
foreach ($result->result() as $row) {
|
||||
$num++;
|
||||
$mlat = (float)$row->latitude;
|
||||
//echo $mlat.' '.gettype($mlat).' ';
|
||||
$mlng = (float)$row->longitude;
|
||||
echo "var marker = new google.maps.Marker({
|
||||
position: {lat:" .$mlat.", lng: ".$mlng."},
|
||||
map: map,
|
||||
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 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