+ Fix bugs due on responsive and add calculator

This commit is contained in:
Djery-Tom 2020-06-05 17:53:04 +01:00
parent 244982009f
commit 60a1f1149d
42 changed files with 3318 additions and 2788 deletions

View File

@ -1838,7 +1838,7 @@ class Gestion extends CI_Controller
$data['currency_name_fr'] = $networkDetails->first_row()->currency_name_fr;
$data['currency_name_en'] = $networkDetails->first_row()->currency_name_en;
$data['currencies'] = $this->user_model->getCurrencies($data['currency_code']);
$data['currencies'] = $this->user_model->getWalletsCountriesCurrencies($data['currency_code']);
$this->load->view('header_gestion', $data);
$this->load->view('gestion_monnaie');
$this->load->view('footer');
@ -1853,5 +1853,31 @@ class Gestion extends CI_Controller
}
}
public function fetchExchangeRates(){
if ($this->isLogged()) {
$api="c4e31fe540cd49c98abffc06cc5948c8"; ///// Provide your openexchangerates.org api key here
$string = file_get_contents("https://openexchangerates.org/api/latest.json?app_id=$api");
$json = json_decode($string, true);
$res= false;
foreach ($json['rates'] as $key => $value) {
if($this->user_model->getExchangeRate($key))
$this->user_model->updateExchangeRate($key , $value);
else
$this->user_model->insertExchangeRate($key , $value);
}
$res = true;
if ($res) {
echo json_encode("200");
} else {
echo json_encode("500");
}
}
}
}

View File

@ -321,7 +321,7 @@ class Hyperviseur_dash extends CI_Controller
$taux = $data['hasWallet']->first_row();
$data['idConfig'] = $taux->id;
if ($data['hasWallet']->first_row()->type == 'uba'){
if ($data['hasWallet']->first_row()->type == 'visa'){
$data['taux_client_r'] = $taux->taux_com_client_retrait;
$data['taux_client_d'] = $taux->taux_com_client_depot;
$data['taux_ag_r'] = $taux->taux_com_ag_retrait;
@ -424,7 +424,7 @@ class Hyperviseur_dash extends CI_Controller
$data['networks'] = $this->user_model->getActiveNetwork();
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
$this->load->view('header_hyp', $data);
if ($data['hasWallet']->first_row()->type == 'uba')
if ($data['hasWallet']->first_row()->type == 'visa')
$this->load->view('gestion_wallet_hyp');
elseif ($data['hasWallet']->first_row()->type == 'ilink')
$this->load->view('gestion_wallet_ilink_hyp');
@ -627,4 +627,49 @@ class Hyperviseur_dash extends CI_Controller
}
}
public function calculator(){
if($this->isLogged()){
$data['active'] = "calculator";
$data['alert'] = "";
$data['firstname'] = $this->session->userdata('firstname');
$data['lastname'] = $this->session->userdata('lastname');
$data['email'] = $this->session->userdata('email');
$data['network'] = $this->session->userdata('network');
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays'));
$data['networks'] = $this->user_model->getActiveNetwork();
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code'));
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['country'] = $this->session->userdata('current_pays');
$data['network_id'] = $this->session->userdata('network_id');
$data['countries'] = $this->user_model->getWalletsCountries();
$data['plr_user_wallet_wallet'] = $this->user_model->getPalierConfigWallet("user_wallet_wallet" , $data['idConfig'])->result();
$data['plr_user_wallet_cash'] = $this->user_model->getPalierConfigWallet("user_wallet_cash" , $data['idConfig']);
$data['plr_agent_depot_wallet'] = $this->user_model->getPalierConfigWallet("agent_depot_wallet" , $data['idConfig']);
$data['plr_agent_cash_cash'] = $this->user_model->getPalierConfigWallet("agent_cash_cash" , $data['idConfig']);
$operations = [
new Operation(1,$this->lang->line('op1')),
new Operation(2,"Retrait d'argent")
];
$data['operations'] = $operations;
// if (isset($_POST)) {
// $data['montant'] = isset($_POST['montant']) ? $_POST['montant'] : 0 ;
// }
$data['montant'] = $this->input->post('montant');
$this->load->view('header_hyp', $data);
$this->load->view('calculator');
$this->load->view('footer');
}
}
}
class Operation {
public $name ;
public $id;
public function __construct($id , $name)
{
$this->name = $name;
$this->id = $id;
}
}

View File

@ -343,5 +343,6 @@ $lang ['show_currency_rate_conversion'] = 'Show conversion rates';
$lang ['conversion_rate'] = 'Conversion rate';
$lang ['new_rate'] = 'New rate';
$lang ['save'] = 'Save';
$lang['agent_name'] = 'Agent name';
?>

View File

@ -355,4 +355,16 @@ $lang['show_currency_rate_conversion'] = 'Afficher les taux de conversions';
$lang['conversion_rate'] = 'Taux de conversion';
$lang['new_rate'] = 'Nouveau taux';
$lang['save'] = 'Enregistrer';
$lang['update_rate'] = 'Mettre à jour les taux';
$lang['rates_update'] = 'Taux de conversion mis à jour';
$lang['calculator'] = 'Calculatrice';
$lang['calculate'] = 'Calculer';
$lang['no_country'] = 'Aucun pays';
$lang['departure_country'] = 'Pays de départ';
$lang['country_of_destination'] = 'Pays de destination';
$lang['amount_departure_country'] = 'Montant du pays de départ';
$lang['amount_country_of_destination'] = 'Montant du pays de destination';
$lang['no_operation'] = 'Aucune opération';
$lang['agent_name'] = 'Nom de l\'agent';
$lang['op1'] = 'Envoi de wallet à wallet';
?>

View File

@ -2159,7 +2159,7 @@ class User_model extends CI_Model
// Mot de passe du wallet
public function getAllActivatedWalletNetworks(){
$query = $this->db->query("SELECT n.id AS id_network , n.name AS network,n.status AS status,c.name AS country,c.currency_name_fr,c.currency_code, wp.id AS wallet_password FROM networks n
$query = $this->db->query("SELECT n.id AS id_network , n.name AS network,n.status AS status,c.name AS country,c.currency_name_fr, c.currency_name_en , c.currency_code, wp.id AS wallet_password FROM networks n
INNER JOIN countries_currencies c ON n.country_id=c.id INNER JOIN configWallet cw ON cw.id_network = n.id
LEFT JOIN walletsPassword wp ON wp.network_id = n.id WHERE status = 1;");
if($query->num_rows()>0){
@ -2268,10 +2268,11 @@ class User_model extends CI_Model
return $query;
}
// La liste des monnaies pour les pays actifs
public function getCurrencies($code){
$sql= "SELECT * FROM currencies WHERE id IN(
SELECT idCurrency FROM countries WHERE id IN (
SELECT country_id FROM networks WHERE status = 1
SELECT distinct country_id FROM networks WHERE status = 1
)
) AND code <> ? ;";
$query = $this->db->query($sql, array($code));
@ -2282,5 +2283,54 @@ class User_model extends CI_Model
}
}
//Liste des monnaies pour les pays dont un wallet est actif
public function getWalletsCountriesCurrencies($code){
$sql= "SELECT * FROM currencies WHERE id IN(
SELECT idCurrency FROM countries WHERE id IN (
SELECT distinct c.id FROM networks n INNER JOIN countries_currencies c ON n.country_id=c.id INNER JOIN configWallet cw ON cw.id_network = n.id WHERE status = 1
)
) AND code <> ? ;";
$query = $this->db->query($sql, array($code));
if($query->num_rows()>0){
return $query;
}else{
return false;
}
}
public function insertExchangeRate($currency ,$rate){
$sql = "INSERT INTO `exchange_rate` (`target_currency`, `exchange_rate`) VALUES ( ?, ?);";
$query = $this->db->query($sql , array($currency,$rate));
return $query;
}
public function getExchangeRate($currency){
$sql = "SELECT * FROM `exchange_rate` WHERE `target_currency` = ?;";
$query = $this->db->query($sql , array($currency));
if($query->num_rows()>0){
return $query;
}else{
return false;
}
}
public function updateExchangeRate($currency,$rate){
$sql = "UPDATE `exchange_rate` SET `exchange_rate` = ? WHERE (`target_currency` = ?);";
$query = $this->db->query($sql , array($currency,$rate));
return $query;
}
//Liste des pays dont un wallet est actif
public function getWalletsCountries(){
$sql= "SELECT id , name , currency_code FROM countries_currencies WHERE id IN (
SELECT distinct c.id FROM networks n INNER JOIN countries_currencies c ON n.country_id=c.id INNER JOIN configWallet cw ON cw.id_network = n.id WHERE status = 1
);";
$query = $this->db->query($sql);
if($query->num_rows()>0){
return $query;
}else{
return false;
}
}
}

297
application/views/calculator.php Executable file
View File

@ -0,0 +1,297 @@
<link rel="stylesheet"
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
<?php
use Brick\Money\CurrencyConverter;
use Brick\Money\ExchangeRateProvider\PDOProvider;
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
use Brick\Math\RoundingMode;
use Brick\Money\Money;
extract($_POST);
$showResult = false;
$frais = 0;
$config = $hasWallet->first_row();
if(isset($save))
{
$showResult = true;
switch($operation) {
case 1: //Envoi wallet à wallet
$frais = ($init_country != $final_country) ? calculateFees1($plr_user_wallet_wallet, $montant) : calculateFees2($config->taux_com_user_wallet_wallet_min , $config->taux_com_user_wallet_wallet_max, $config->taux_com_user_wallet_wallet, $montant);
break;
case '-':
$res=$fn-$sn;
break;
}
}
function calculateFees1(array $paliers , $montant){
$size = sizeof($paliers);
$min = $paliers[0]->min ;
$max= $size > 0 ? $paliers[$size-1]->max : 0;
$palier = null;
foreach ($paliers as $p){
if($montant >= $p->min && $montant <= $p->max){
$palier = $p;
break;
}
}
if($palier){
return (($palier->min * $palier->taux /100 ) + ($palier->max * $palier->taux /100 ))/2;
}else{
if($montant < $min)
return $min* $paliers[0]->taux /100;
else if ($montant > $max)
return $max* $paliers[$size-1]->taux /100;
}
}
function calculateFees2($min , $max , $taux , $montant){
if($montant < $min)
return $min* $taux /100;
else if ($montant > $max)
return $max*$taux /100;
else
return $montant * $taux /100;
}
// set to whatever your rates are relative to
$baseCurrency = 'USD';
// use your own credentials, or re-use your existing PDO connection
$pdo = new PDO('mysql:host='.$this->db->hostname.';dbname='.$this->db->database, $this->db->username, $this->db->password);
$configuration = new PDOProviderConfiguration();
$configuration->tableName = 'exchange_rate';
$configuration->exchangeRateColumnName = 'exchange_rate';
$configuration->targetCurrencyColumnName = 'target_currency';
$configuration->sourceCurrencyCode = $baseCurrency;
// this provider loads exchange rates from your database
$provider = new PDOProvider($pdo, $configuration);
// this provider calculates exchange rates relative to the base currency
$provider = new BaseCurrencyProvider($provider, $baseCurrency);
// this currency converter can now handle any currency pair
$converter = new CurrencyConverter($provider);
//$money = Money::of('1', 'USD');
//$mone2 = $converter->convert($money, 'XAF', RoundingMode::DOWN);
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('calculator'); ?>
</h1>
<?php
$site_url = base_url();
if ($alert == "ok") {
if (!$success == "ok") {
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<!-- <div class="box-header">-->
<!---->
<!-- </div>-->
<div class="box-body">
<form id="calculatorForm" class="form-content" method="post">
<div class="form-group">
<div class="row">
<div class="col-lg-3">
<label for="montant" > <?php echo $this->lang->line('Montant') ?></label>
<input type="text" required class="form-control" id="montant"
name="montant" value="<?php echo @$montant;?>">
</div>
<div class="col-lg-3">
<?php
$result=$countries;
if($result){
$numrows=$result->num_rows();
if ($numrows > 0) { ?>
<label for="init_country"><?php echo $this->lang->line('departure_country') ?></label>
<select class="form-control" name="init_country" id="init_country" required>
<?php foreach($result->result() as $row) {
echo "<option value='".$row->id."'>".$row->name."</option>";
} ?>
</select>
<?php }else{
echo $this->lang->line('no_country');
}
?>
<?php } else {
echo $this->lang->line('no_country');
} ?>
</div>
<div class="col-lg-3">
<?php
$result=$operations;
if($result){
$numrows= sizeof($result);
if ($numrows > 0) { ?>
<label for="operation">Operation</label>
<select class="form-control" name="operation" id="operation" <?php echo @$operation;?> required>
<?php foreach($result as $row) {
echo "<option value='".$row->id."'>".$row->name."</option>";
} ?>
</select>
<?php }else{
echo $this->lang->line('no_operation');
}
?>
<?php } else {
echo $this->lang->line('no_operation');
} ?>
</div>
<div class="col-lg-3">
<?php
$result=$countries;
if($result){
$numrows=$result->num_rows();
if ($numrows > 0) { ?>
<label for="final_country"><?php echo $this->lang->line('country_of_destination') ?></label>
<select class="form-control" name="final_country" id="final_country" required>
<?php foreach($result->result() as $row) {
echo "<option value='".$row->id."'>".$row->name."</option>";
} ?>
</select>
<?php }else{
echo $this->lang->line('no_country');
}
?>
<?php } else {
echo $this->lang->line('no_country');
} ?>
</div>
</div>
</div>
<?php if($showResult) {
$r1 = array_filter($operations , function ($op) use ($operation){
return $op->id == $operation;
});
$r2 = array_filter($countries->result() , function ($c) use ($init_country){
return $c->id == $init_country;
});
$r3 = array_filter($countries->result() , function ($c) use ($final_country){
return $c->id == $final_country;
});
$op = reset($r1);
$d = reset($r2);
$f = reset($r3);
?>
<div class="login-box" style="width: 600px;">
<h5 ><strong style="text-decoration: underline;" >Resultat</strong> : <?=@$op->name.' du '.$d->name.' vers '.$f->name?></h5>
<div class="login-box-body">
<div class="row">
<?php
$money = Money::of(@$montant, @$d->currency_code);
$money2 = Money::of(round(@$montant - @$frais,0), @$d->currency_code);
$money2 = $converter->convert($money2, @$f->currency_code, RoundingMode::DOWN);
$moneyFrais = Money::of(round(@$frais,0), @$d->currency_code);
?>
<div class="col-lg-6 col-md-6">
<div>
<label> <?php echo $this->lang->line('amount_departure_country') ?></label>
<h4><?= $money->formatTo('fr_FR') ?></h4>
</div>
<div>
<label> Frais de la transaction</label>
<h4><?= $moneyFrais->formatTo('fr_FR') ?></h4>
</div>
</div>
<div class="col-lg-6 col-md-6">
<div>
<label> <?php echo $this->lang->line('amount_country_of_destination') ?></label>
<h4><?= $money2->formatTo('fr_FR') ?></h4>
</div>
</div>
</div>
</div>
</div>
<?php }?>
<button type="submit"
name="save"
class="btn btn-warning btn-block openModal"><?php echo $this->lang->line('calculate'); ?></button>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.5.4"></script>
<script>
$(function () {
anElement = new AutoNumeric('#montant', '', {digitGroupSeparator: ' ', decimalPlaces:'0', minimumValue : '0' , maximumValue: '99999999999999999999999999'});
$("#calculatorForm").submit( function(eventObj) {
var txt = document.getElementById('montant');
const montant = anElement.getNumber();
txt.value = montant;
return true;
});
//onLoad="document.getElementById('leave').options[0].selected = 'selected';"
})
</script>

View File

@ -64,7 +64,7 @@
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Tous les codes générés'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php

View File

@ -166,7 +166,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('entrantes'); ?> </h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -313,7 +313,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('Sortantes'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -455,7 +455,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('entrantes'); ?> <?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -590,7 +590,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('Sortantes'); ?> <?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -722,7 +722,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('entrantes'); ?> <?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -851,7 +851,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('Sortantes'); ?> <?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -983,7 +983,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -1131,7 +1131,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -1261,7 +1261,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php

View File

@ -123,7 +123,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -203,7 +203,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -278,7 +278,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php

View File

@ -189,7 +189,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('entrantes'); ?> </h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -278,7 +278,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('Sortantes'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -367,7 +367,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('entrantes'); ?> <?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -447,7 +447,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('Sortantes'); ?> <?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -530,7 +530,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('entrantes'); ?> <?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -610,7 +610,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('Sortantes'); ?> <?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -704,7 +704,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -795,7 +795,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -874,7 +874,7 @@
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php

View File

@ -9,7 +9,7 @@
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Activer/Désactiver'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -197,7 +197,7 @@
</div>
<!-- /.box-header -->
<div class="box-body table-responsive no-padding">
<div class="box-body table-responsive no-padding" style="overflow-x:auto;">
<table class="table table-hover">
<?php

File diff suppressed because it is too large Load Diff

View File

@ -4,12 +4,10 @@
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
<link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<style type="text/css">
.table-wrapper {
width: 700px;
width: 500px;
margin: 30px auto;
background: #fff;
padding: 20px;
@ -90,6 +88,41 @@
display: none;
}
</style>
<?php
use Brick\Money\CurrencyConverter;
use Brick\Money\ExchangeRateProvider\PDOProvider;
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
use Brick\Math\RoundingMode;
use Brick\Money\Money;
// set to whatever your rates are relative to
$baseCurrency = 'USD';
// use your own credentials, or re-use your existing PDO connection
$pdo = new PDO('mysql:host='.$this->db->hostname.';dbname='.$this->db->database, $this->db->username, $this->db->password);
$configuration = new PDOProviderConfiguration();
$configuration->tableName = 'exchange_rate';
$configuration->exchangeRateColumnName = 'exchange_rate';
$configuration->targetCurrencyColumnName = 'target_currency';
$configuration->sourceCurrencyCode = $baseCurrency;
// this provider loads exchange rates from your database
$provider = new PDOProvider($pdo, $configuration);
// this provider calculates exchange rates relative to the base currency
$provider = new BaseCurrencyProvider($provider, $baseCurrency);
// this currency converter can now handle any currency pair
$converter = new CurrencyConverter($provider);
//$money = Money::of('1', 'USD');
//$mone2 = $converter->convert($money, 'XAF', RoundingMode::DOWN);
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
@ -137,56 +170,53 @@
</div>
</div>
</div>
<div class="table-wrapper">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?php echo $this->lang->line('conversion_rate') ; ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new1"><i class="fa fa-plus"></i> <?php echo $this->lang->line('new_rate') ; ?></button>
</div>
</div>
<div class="row">
<div class="table-wrapper" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label class="col-form-label"><?php echo $this->lang->line('conversion_rate') ; ?></label>
</div>
</div>
</div>
<table id="taux_conversion" class="table table-bordered table-striped" >
<thead>
<tr>
<th width="60%"><?php echo $this->lang->line('currency') ; ?> </th>
<th><?php echo $this->lang->line('rate') ; ?> (%) </th>
</tr>
</thead>
<tbody>
<?php
if($currencies!=false){
foreach($currencies->result() as $row) {
$name = $this->session->userdata('site_lang') === 'french' ? $row->name_fr : $row->name_en;
echo "<tr>
<td>".$row->code.' - '.$name."</td>
<td>".round($provider->getExchangeRate($currency_code ,$row->code)->toFloat(),3)."</td>".'
</tr>';
}
}
?>
</tbody>
</table>
<button type="button" id="save" class="btn btn-primary btn-block" >
<b><?php echo $this->lang->line('update_rate'); ?></b>
</button>
</div>
<table id="taux_conversion" class="table table-bordered">
<thead>
<tr>
<th><?php echo $this->lang->line('currency') ; ?> </th>
<th><?php echo $this->lang->line('rate') ; ?> (%) </th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<!-- --><?php
// if($plr_user_wallet_wallet!=false){
// foreach($plr_user_wallet_wallet->result() as $row) {
// echo "<tr>
// <td>".$row->min."</td>
// <td>".$row->max."</td>
// <td>".$row->taux."</td>".'
// <td>
// <a class="add add1" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
// <a class="edit edit1" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
// <a class="delete delete1" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
// </td>
// </tr>';
// }
// }
// ?>
</tbody>
</table>
<button type="button" id="save" class="btn btn-primary btn-block" >
<b><?php echo $this->lang->line('save'); ?></b>
</button>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
@ -195,11 +225,17 @@
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
<script>
$(function() {
$('#taux_conversion').DataTable();
})
</script>
<script>
toastr.options.closeButton = true;
toastr.options.closeMethod = 'fadeOut';
@ -207,147 +243,33 @@
toastr.options.closeEasing = 'swing';
$('#save').click(function () {
// const network_id = $(this).data('network-id');
// const id_config = $(this).data('id-config');
$.ajax({
url: '<?php echo base_url('index.php/Gestion/fetchExchangeRates')?>',
type: 'GET',
dataType: 'json',
success: function (data) {
if(data=='200'){
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('rates_update')?>",
text:"<?php echo $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
}else{
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
},
var taux_conversion = [];
$('#taux_conversion tr').has('td').each(function() {
var arrayItem = {};
$('td', $(this)).each(function(index, item) {
if(index < 3)
arrayItem[index] = $(item).html();
});
taux_conversion.push(arrayItem);
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
});
console.log(taux_conversion)
//$.ajax({
// url: '<?php //echo base_url('index.php/Gestion/taux_converison')?>//',
// type: 'POST',
// dataType: 'json',
// data: {
// "type" : "ilink",
// "network_id": network_id,"id_config" : id_config,
// "taux_conversion" :taux_conversion
// },
// success: function (data) {
// if(data=='200'){
// Swal.fire({
// icon: 'success',
// title: "<?php //echo $this->lang->line('wallet_update')?>//",
// text:"<?php //echo $this->lang->line('informations_updated')?>//",
// timer: 3000
// }).then(()=>{
// location.reload();
// });
// // alert("Les informations ont été mises à jour.") ? "" :
// }else{
// toastr.error("<?php //echo $this->lang->line('error_message')?>//" , "<?php //echo $this->lang->line('request_error')?>//");
// }
// },
//
// error: function (resultat, statut, error) {
// console.log(resultat + " " + error);
// toastr.error("<?php //echo $this->lang->line('error_message')?>//" , "<?php //echo $this->lang->line('request_error')?>//");
// }
//});
});
</script>
<script>
// Paliers scripts
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
var actions1 = $("#taux_conversion td:last-child").html();
// Append table with add row form on add new button click
$(".new1").click(function(){
if(!actions1){
actions1 = '<a class="add add1" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>\n' +
' <a class="edit edit1" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete1" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#taux_conversion tbody tr:last-child").index();
var row = "<tr> <td>"+
<?php
$result=$currencies;
$numrows=$result->num_rows();
if ($numrows > 0) {
echo '"<select class='.'form-control input-lg'.' id='.'currency'.' required>';
foreach($result->result() as $row) {
echo "<option value=".$row->code.">".$row->code.' - '.$row->name_fr."</option>";
}
echo '</select>"';
}
?>
+"</td>" +
"<td><input type='number' required class='form-control' min='0' name='taux' id='taux'></td>" +
"<td>" + actions1 + "</td>" +
"</tr>";
$("#taux_conversion").append(row);
$("#taux_conversion tbody tr").eq(index + 1).find(".add, .edit").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add1", function(){
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var select = $(this).parents("tr").find('select[id="currency"]');
input.each(function(){
if(!$(this)[0].checkValidity()){
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else{
$(this).removeClass("error");
}
});
$(this).parents("tr").find(".error").first().focus();
if(!empty){
select.each(function(){
$(this).parent("td").html($(this).val());
});
input.each(function(){
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new1").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit1", function(){
$(this).parents("tr").find("td:not(:last-child)").each(function(index){
if(index == 0)
$(this).html("<?php
$result=$currencies;
$numrows=$result->num_rows();
if ($numrows > 0) {
echo "<select class='form-control' id='currency' value='".'EUR'."' required>";
foreach($result->result() as $row) {
echo "<option value=".$row->code.">".$row->code.' - '.$row->name_fr."</option>";
}
echo '</select>';
}
?>");
if(index == 1)
$(this).html('<input type="number" required class="form-control" min="0" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new1").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete1", function(){
$(this).parents("tr").remove();
$(".new1").removeAttr("disabled");
});
});
</script>
<!-- Page script -->
<script src="<?php echo base_url('dist/js/custom.js') ?>"></script>

View File

@ -44,7 +44,7 @@
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('activated_wallets'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
@ -77,7 +77,7 @@
?>
<?php
?>
<td><?php echo $row->currency_name_fr; ?></td>
<td><?php echo $this->session->userdata('site_lang') === 'french' ? $row->currency_name_fr : $row->currency_name_en ?></td>
<td><?php echo $row->currency_code; ?></td>
<?php

View File

@ -1,485 +1,485 @@
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('Gestion des réseaux'); ?>
<input type="button" class="btn btn-primary pull-right" id="Bactiver" value="Activer/Désactiver le(s) réseau(x)" style="display: none;" />
</h1>
<?php
$site_url = base_url();
if($alert=="ok") {
if(!$success=="ok"){
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row">
<div class="col-xs-8">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Réseaux assignés'); ?></h3>
</div>
<div class="box-body">
<?php
$sql2 = $assigned_networks;
if($sql2!=false){
$numrows=$sql2->num_rows();
$num = 0;
if ($numrows > 0) {
?>
<table id="validated" class="table table-bordered table-striped">
<thead>
<tr>
<th align='center'></th>
<th><?php echo $this->lang->line('Reseau'); ?></th>
<th><?php echo $this->lang->line('Pays'); ?></th>
<th align='center'><?php echo $this->lang->line('Statut'); ?></th>
<th align='center'><?php echo $this->lang->line('Activer/Désactiver'); ?></th>
<th align='center'><?php echo $this->lang->line('Modifier'); ?></th>
<th align="center"><?php echo $this->lang->line('Supprimer'); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach($sql2->result() as $row) {
$num ++;
//$member_code = randomString1(10);
$libelle_status = $this->lang->line('Actif');
if($row->status==0){
$libelle_status = $this->lang->line('Inactif');
}
echo "<tr>
<td align='center'>$num</td>
<td >$row->network</td>
<td>$row->country</td>
<td align='center'>$libelle_status</td>";
if($row->status==0){
echo "<td align='center'><label>
<input type='checkbox' name='activer' class='minimal' data-id='".$row->id."' >
</label>
<label>
<input type='checkbox' name='desactiver' class='minimal-red' disabled data-id='".$row->id."'>
</label></td>";
}else{
echo "<td align='center'><label>
<input type='checkbox' name='activer' class='minimal' disabled data-id='".$row->id."'>
</label>
<label>
<input type='checkbox' name='desactiver' class='minimal-red' data-id='".$row->id."'>
</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>
</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>
</td>
</tr>";
}
?>
</tbody>
</table>
<?php
}
else {
echo $this->lang->line('Aucun réseau');
}
}else {
echo $this->lang->line('Aucun réseau');
}
?>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Ajouter un réseau à la liste'); ?></h3>
</div>
<div class="box-body">
<form id="add-network" method="post" class="bottom-75 center-block">
<div class="form-group">
<label for="network"><?php echo $this->lang->line('Reseau'); ?></label>
<input type="text" class="form-control input-lg" name="network" required id="network">
</div>
<div class="form-group">
<input id="btn-add" type="submit" value="<?php echo $this->lang->line('Ajouter'); ?>" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Assigner un réseau à un pays'); ?></h3>
</div>
<div class="box-body">
<form id="assign-form" method="post" class="bottom-75 center-block">
<div class="form-group">
<label for="pays"><?php echo $this->lang->line('Pays'); ?></label>
<?php
$result=$pays;
$numrows=$result->num_rows();
if ($numrows > 0) { ?>
<select class="form-control input-lg" name="pays" required id="pays" multiple="multiple" >
<?php foreach($result->result() as $row) {
echo "<option value='".$row->id."' id='".$row->code_country."'>".$row->name."</option>";
} ?>
</select>
<?php }else{
echo $this->lang->line("Aucun pays");
}
?>
</div>
<div class="form-group">
<label for="ville"><?php echo $this->lang->line('Reseaux'); ?></label>
<?php
$result=$networks;
if($result!=false) {
$numrows = $result->num_rows();
if ($numrows > 0) { ?>
<select class="form-control input-lg" name="network" required id="network">
<?php foreach ($result->result() as $row) {
echo "<option value='" . $row->name. "'>" . $row->name . "</option>";
} ?>
</select>
<?php } else {
echo $this->lang->line("Aucun réseau");
}
}else{
echo $this->lang->line("Aucun réseau");
}
?>
</div>
<div class="form-group">
<input id="btn-add" type="submit" value="<?php echo $this->lang->line('Ajouter'); ?>" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title"><?php echo $this->lang->line('Modifier le réseau'); ?></h4>
</div>
<div class="modal-body">
<form id="update-form" method="post" class="bottom-75 center-block">
<div class="form-group">
<label for="modal-pays"><?php echo $this->lang->line('Pays'); ?></label>
<input type="text" class="form-control input-lg" name="pays" required id="modal-pays" readonly="readonly">
</div>
<div class="form-group">
<label for="modal-reseau"><?php echo $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 id="btn-add" type="submit" value="Confirmer" class="btn btn-primary">
<button type="button" class="btn btn-default pull-right" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
<script>
$(document).ready(function() {
var checkboxes = $("td input[type='checkbox']");
checkboxes.click(function() {
if ($("td input:checkbox:checked").length > 0)
{
$("#Bactiver").css("display", "block");
}else{
$("#Bactiver").css("display", "none");
}
});
var Bactiver = $("#Bactiver");
Bactiver.click(function(){
var activation = [];
var desactivation = [];
$.each($("input[name='activer']:checked"), function(){
activation.push($(this).data('id'));
});
$.each($("input[name='desactiver']:checked"), function(){
desactivation.push($(this).data('id'));
});
$.ajax({
url:'<?php echo base_url('index.php/Gestion/change_status_network')?>',
type: 'post',
data: {activations: activation,desactivations:desactivation},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Réseau(x) activé(s)/désactivé(s)');
location.reload(true);
}else{
alert(data);
//alert("Une erreur s'est produite");
location.reload(true);
}
}
});
console.log("Activation : " + activation.join(", ") + " Desactivation : " + desactivation.join(", "));
});
});
</script>
<script>
$(function() {
$('#unvalidated').DataTable();
$('#validated').DataTable();
})
</script>
<script>
$(function() {
$('#pays').multiselect({
includeSelectAllOption: true
});
});
</script>
<script>
var id_network = null;
var name_network = null;
var id_country = null;
var country = null;
$(document).on("click", ".open-modal", function () {
id_network = $(this).data('id-network');
name_network = $(this).data('name-network');
id_country = $(this).data('id-country');
country = $(this).data('country');
$(".modal-body #modal-pays").val(country);
$(".modal-body #modal-reseau").val( name_network );
});
$("#assign-form").submit(function(event){
//var id_pays = $("#assign-form #pays").val();
var reseau = $("#assign-form #network").val();
var selectedValues = $('#assign-form #pays').val();
$.ajax({
url:'<?php echo base_url('index.php/Gestion/assignation')?>',
type: 'post',
data: {id_country: selectedValues,network:reseau},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Le réseau a été assigné');
location.reload(true);
}else if(data==='existe'){
alert('Ce réseau a déjà été assigné à certains des pays sélectionnés');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
alert(data);
}
}
});
event.preventDefault();
});
$("#add-network").submit(function(event){
var new_network = $("#add-network #network").val();
$.ajax({
url:'<?php echo base_url('index.php/Gestion/creat_network')?>',
type: 'post',
data: {new_network: new_network},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Le réseau a été ajouté');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
event.preventDefault();
});
$("#update-form").submit(function(){
var up_network = $("#update-form #modal-reseau").val();
$.ajax({
url:'<?php echo base_url('index.php/Gestion/update_network')?>',
type: 'post',
data: {new_network: up_network,old_name:name_network},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Le réseau a été modifié');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
event.preventDefault();
});
$(document).ready(function(){
var id_ville = 0;
/* Get the checkboxes values based on the class attached to each check box */
$("#valider").click(function() {
activeVille();
});
$("#disable").click(function() {
desactiveVille();
});
$(".modif").click(function(){
id_ville = $(this).val();
});
});
function activeVille(){
/* declare an checkbox array */
var chkArray = [];
/* look for all checkboes that have a class 'chk' attached to it and check if it was checked */
$(".chk:checked").each(function() {
chkArray.push($(this).val());
});
/* we join the array separated by the comma */
var selected;
selected = chkArray.join(',') ;
/* check if there is selected checkboxes, by default the length is 1 as it contains one single comma */
if(selected.length > 0){
$.ajax({
url:'<?php echo base_url('index.php/Gestion/activer')?>',
type: 'post',
data: {villes: chkArray},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Ville(s) activée(s)');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
}else{
alert("Veuillez cocher des villes");
}
}
function desactiveVille(){
/* declare an checkbox array */
var chkArray = [];
/* look for all checkboes that have a class 'chk' attached to it and check if it was checked */
$(".unchk:checked").each(function() {
chkArray.push($(this).val());
});
/* we join the array separated by the comma */
var selected;
selected = chkArray.join(',') ;
/* check if there is selected checkboxes, by default the length is 1 as it contains one single comma */
if(selected.length > 0){
$.ajax({
url:'<?php echo base_url('index.php/Gestion/desactiver')?>',
type: 'post',
data: {villes: chkArray},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Ville(s) désactivée(s)');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
}else{
alert("Veuillez cocher des villes");
}
}
</script>
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('Gestion des réseaux'); ?>
<input type="button" class="btn btn-primary pull-right" id="Bactiver" value="Activer/Désactiver le(s) réseau(x)" style="display: none;" />
</h1>
<?php
$site_url = base_url();
if($alert=="ok") {
if(!$success=="ok"){
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row">
<div class="col-xs-8">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Réseaux assignés'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<?php
$sql2 = $assigned_networks;
if($sql2!=false){
$numrows=$sql2->num_rows();
$num = 0;
if ($numrows > 0) {
?>
<table id="validated" class="table table-bordered table-striped">
<thead>
<tr>
<th align='center'></th>
<th><?php echo $this->lang->line('Reseau'); ?></th>
<th><?php echo $this->lang->line('Pays'); ?></th>
<th align='center'><?php echo $this->lang->line('Statut'); ?></th>
<th align='center'><?php echo $this->lang->line('Activer/Désactiver'); ?></th>
<th align='center'><?php echo $this->lang->line('Modifier'); ?></th>
<th align="center"><?php echo $this->lang->line('Supprimer'); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach($sql2->result() as $row) {
$num ++;
//$member_code = randomString1(10);
$libelle_status = $this->lang->line('Actif');
if($row->status==0){
$libelle_status = $this->lang->line('Inactif');
}
echo "<tr>
<td align='center'>$num</td>
<td >$row->network</td>
<td>$row->country</td>
<td align='center'>$libelle_status</td>";
if($row->status==0){
echo "<td align='center'><label>
<input type='checkbox' name='activer' class='minimal' data-id='".$row->id."' >
</label>
<label>
<input type='checkbox' name='desactiver' class='minimal-red' disabled data-id='".$row->id."'>
</label></td>";
}else{
echo "<td align='center'><label>
<input type='checkbox' name='activer' class='minimal' disabled data-id='".$row->id."'>
</label>
<label>
<input type='checkbox' name='desactiver' class='minimal-red' data-id='".$row->id."'>
</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>
</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>
</td>
</tr>";
}
?>
</tbody>
</table>
<?php
}
else {
echo $this->lang->line('Aucun réseau');
}
}else {
echo $this->lang->line('Aucun réseau');
}
?>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Ajouter un réseau à la liste'); ?></h3>
</div>
<div class="box-body">
<form id="add-network" method="post" class="bottom-75 center-block">
<div class="form-group">
<label for="network"><?php echo $this->lang->line('Reseau'); ?></label>
<input type="text" class="form-control input-lg" name="network" required id="network">
</div>
<div class="form-group">
<input id="btn-add" type="submit" value="<?php echo $this->lang->line('Ajouter'); ?>" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Assigner un réseau à un pays'); ?></h3>
</div>
<div class="box-body">
<form id="assign-form" method="post" class="bottom-75 center-block">
<div class="form-group">
<label for="pays"><?php echo $this->lang->line('Pays'); ?></label>
<?php
$result=$pays;
$numrows=$result->num_rows();
if ($numrows > 0) { ?>
<select class="form-control input-lg" name="pays" required id="pays" multiple="multiple" >
<?php foreach($result->result() as $row) {
echo "<option value='".$row->id."' id='".$row->code_country."'>".$row->name."</option>";
} ?>
</select>
<?php }else{
echo $this->lang->line("Aucun pays");
}
?>
</div>
<div class="form-group">
<label for="ville"><?php echo $this->lang->line('Reseaux'); ?></label>
<?php
$result=$networks;
if($result!=false) {
$numrows = $result->num_rows();
if ($numrows > 0) { ?>
<select class="form-control input-lg" name="network" required id="network">
<?php foreach ($result->result() as $row) {
echo "<option value='" . $row->name. "'>" . $row->name . "</option>";
} ?>
</select>
<?php } else {
echo $this->lang->line("Aucun réseau");
}
}else{
echo $this->lang->line("Aucun réseau");
}
?>
</div>
<div class="form-group">
<input id="btn-add" type="submit" value="<?php echo $this->lang->line('Ajouter'); ?>" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title"><?php echo $this->lang->line('Modifier le réseau'); ?></h4>
</div>
<div class="modal-body">
<form id="update-form" method="post" class="bottom-75 center-block">
<div class="form-group">
<label for="modal-pays"><?php echo $this->lang->line('Pays'); ?></label>
<input type="text" class="form-control input-lg" name="pays" required id="modal-pays" readonly="readonly">
</div>
<div class="form-group">
<label for="modal-reseau"><?php echo $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 id="btn-add" type="submit" value="Confirmer" class="btn btn-primary">
<button type="button" class="btn btn-default pull-right" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
<script>
$(document).ready(function() {
var checkboxes = $("td input[type='checkbox']");
checkboxes.click(function() {
if ($("td input:checkbox:checked").length > 0)
{
$("#Bactiver").css("display", "block");
}else{
$("#Bactiver").css("display", "none");
}
});
var Bactiver = $("#Bactiver");
Bactiver.click(function(){
var activation = [];
var desactivation = [];
$.each($("input[name='activer']:checked"), function(){
activation.push($(this).data('id'));
});
$.each($("input[name='desactiver']:checked"), function(){
desactivation.push($(this).data('id'));
});
$.ajax({
url:'<?php echo base_url('index.php/Gestion/change_status_network')?>',
type: 'post',
data: {activations: activation,desactivations:desactivation},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Réseau(x) activé(s)/désactivé(s)');
location.reload(true);
}else{
alert(data);
//alert("Une erreur s'est produite");
location.reload(true);
}
}
});
console.log("Activation : " + activation.join(", ") + " Desactivation : " + desactivation.join(", "));
});
});
</script>
<script>
$(function() {
$('#unvalidated').DataTable();
$('#validated').DataTable();
})
</script>
<script>
$(function() {
$('#pays').multiselect({
includeSelectAllOption: true
});
});
</script>
<script>
var id_network = null;
var name_network = null;
var id_country = null;
var country = null;
$(document).on("click", ".open-modal", function () {
id_network = $(this).data('id-network');
name_network = $(this).data('name-network');
id_country = $(this).data('id-country');
country = $(this).data('country');
$(".modal-body #modal-pays").val(country);
$(".modal-body #modal-reseau").val( name_network );
});
$("#assign-form").submit(function(event){
//var id_pays = $("#assign-form #pays").val();
var reseau = $("#assign-form #network").val();
var selectedValues = $('#assign-form #pays').val();
$.ajax({
url:'<?php echo base_url('index.php/Gestion/assignation')?>',
type: 'post',
data: {id_country: selectedValues,network:reseau},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Le réseau a été assigné');
location.reload(true);
}else if(data==='existe'){
alert('Ce réseau a déjà été assigné à certains des pays sélectionnés');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
alert(data);
}
}
});
event.preventDefault();
});
$("#add-network").submit(function(event){
var new_network = $("#add-network #network").val();
$.ajax({
url:'<?php echo base_url('index.php/Gestion/creat_network')?>',
type: 'post',
data: {new_network: new_network},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Le réseau a été ajouté');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
event.preventDefault();
});
$("#update-form").submit(function(){
var up_network = $("#update-form #modal-reseau").val();
$.ajax({
url:'<?php echo base_url('index.php/Gestion/update_network')?>',
type: 'post',
data: {new_network: up_network,old_name:name_network},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Le réseau a été modifié');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
event.preventDefault();
});
$(document).ready(function(){
var id_ville = 0;
/* Get the checkboxes values based on the class attached to each check box */
$("#valider").click(function() {
activeVille();
});
$("#disable").click(function() {
desactiveVille();
});
$(".modif").click(function(){
id_ville = $(this).val();
});
});
function activeVille(){
/* declare an checkbox array */
var chkArray = [];
/* look for all checkboes that have a class 'chk' attached to it and check if it was checked */
$(".chk:checked").each(function() {
chkArray.push($(this).val());
});
/* we join the array separated by the comma */
var selected;
selected = chkArray.join(',') ;
/* check if there is selected checkboxes, by default the length is 1 as it contains one single comma */
if(selected.length > 0){
$.ajax({
url:'<?php echo base_url('index.php/Gestion/activer')?>',
type: 'post',
data: {villes: chkArray},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Ville(s) activée(s)');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
}else{
alert("Veuillez cocher des villes");
}
}
function desactiveVille(){
/* declare an checkbox array */
var chkArray = [];
/* look for all checkboes that have a class 'chk' attached to it and check if it was checked */
$(".unchk:checked").each(function() {
chkArray.push($(this).val());
});
/* we join the array separated by the comma */
var selected;
selected = chkArray.join(',') ;
/* check if there is selected checkboxes, by default the length is 1 as it contains one single comma */
if(selected.length > 0){
$.ajax({
url:'<?php echo base_url('index.php/Gestion/desactiver')?>',
type: 'post',
data: {villes: chkArray},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Ville(s) désactivée(s)');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
}else{
alert("Veuillez cocher des villes");
}
}
</script>

View File

@ -40,7 +40,7 @@
<div class="box-header">
<h3 class="box-title">Publicité interstitielle</h3>
</div>
<div class="box-body table-responsive no-padding">
<div class="box-body table-responsive no-padding" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>

View File

@ -1,369 +1,369 @@
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('Modification et Activation des villes'); ?>
</h1>
<?php
$site_url = base_url();
if($alert=="ok") {
if(!$success=="ok"){
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row">
<div class="col-xs-8">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Activer/Désactiver'); ?></h3>
</div>
<div class="box-body">
<?php
$sql2 = $list_villes;
if($sql2!=false){
$numrows=$sql2->num_rows();
$num = 0;
if ($numrows > 0) {
?>
<table id="validated" class="table table-bordered table-striped">
<thead>
<tr>
<th align='center'></th>
<th><?php echo $this->lang->line('Villes'); ?></th>
<th><?php echo $this->lang->line('Pays'); ?></th>
<th align='center'><?php echo $this->lang->line('Statut'); ?></th>
<th align='center'><?php echo $this->lang->line('Activer'); ?></th>
<th align='center'><?php echo $this->lang->line('Désactiver'); ?></th>
<th align='center'><?php echo $this->lang->line('Modifier'); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach($sql2->result() as $row) {
$num ++;
//$member_code = randomString1(10);
$libelle_status = $this->lang->line('Inactive');
if($row->status==1){
$libelle_status = $this->lang->line('Active');
}
echo "<tr>
<td align='center'>$num</td>
<td >$row->name</td>
<td>$row->country</td>
<td align='center'>$libelle_status</td>";
if($row->status==0) {
echo "<td align='center'><input type='checkbox' name='activer' class='chk' value='".$row->id."'></td>
<td align='center'><input type='checkbox' name='desactiver' value='".$row->id."' disabled></td>";
}else{
echo "<td align='center'><input type='checkbox' name='activer' value='".$row->id."' disabled></td>
<td align='center'><input type='checkbox' name='desactiver' value='".$row->id."' class='unchk'></td>";
}
echo "<td id='edition' align='center'>
<button data-toggle='modal' data-id-town='$row->id' data-town='$row->name' 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>
</td>
</tr>";
}
?>
</tbody>
</table>
<button type="button" class="btn btn-success" id="valider"><?php echo $this->lang->line('Activer/Désactiver'); ?></button>
<?php
}
else {
echo $this->lang->line('Aucune ville');
}
}else {
echo $this->lang->line('Aucune ville');
}
?>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Ajouter une ville'); ?></h3>
</div>
<div class="box-body">
<form action="<?php echo base_url('index.php/Gestion/ajout')?>" method="post" class="bottom-75 center-block">
<div class="form-group">
<label for="pays"><?php echo $this->lang->line('Pays'); ?></label>
<?php
$result=$pays;
$numrows=$result->num_rows();
if ($numrows > 0) { ?>
<select class="form-control input-lg" name="pays" required id="pays">
<?php foreach($result->result() as $row) {
echo "<option value='".$row->id."' id='".$row->code_country."'>".$row->name."</option>";
} ?>
</select>
<?php }else{
echo $this->lang->line('Aucun pays');
}
?>
</div>
<div class="form-group">
<label for="ville"><?php echo $this->lang->line('Ville'); ?></label>
<input type="text" class="form-control input-lg" name="ville" required id="ville">
</div>
<div class="form-group">
<input id="btn-add" type="submit" value="<?php echo $this->lang->line('Ajouter'); ?>" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title"><?php echo $this->lang->line('Modifier la ville'); ?></h4>
</div>
<div class="modal-body">
<form id="update-form" method="post" class="bottom-75 center-block">
<div class="form-group">
<label for="modal-pays"><?php echo $this->lang->line('Pays'); ?></label>
<?php
$result=$pays;
$numrows=$result->num_rows();
if ($numrows > 0) { ?>
<select class="form-control input-lg" name="pays" required id="modal-pays">
<?php foreach($result->result() as $row) {
echo "<option value='".$row->id."' id='".$row->code_country."'>".$row->name."</option>";
} ?>
</select>
<?php }else{
echo $this->lang->line('Aucun pays');
}
?>
</div>
<div class="form-group">
<label for="modal-ville"><?php echo $this->lang->line('Ville'); ?></label>
<input type="text" class="form-control input-lg" name="ville" required id="modal-ville">
</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"><?php echo $this->lang->line('Fermer'); ?></button>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script>
$(function() {
$('#unvalidated').DataTable();
$('#validated').DataTable();
})
</script>
<script>
var town = null;
var id_town = null;
var country = null;
var id_country = null;
$(document).on("click", ".open-modal", function () {
town = $(this).data('town');
id_town = $(this).data('id-town');
country = $(this).data('country');
id_country = $(this).data('id-country');
$(".modal-body #modal-pays").append("<option value='"+id_country+"' selected>"+country+"</option>");
$(".modal-body #modal-ville").val( town );
});
$("#update-form").submit(function(){
var new_id_country = $("#modal-pays").val();
var new_town = $("#modal-ville").val();
$.ajax({
url:'<?php echo base_url('index.php/Gestion/update')?>',
type: 'post',
data: {id_country: new_id_country,id_town:id_town,town:new_town},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('La ville a été mise à jour');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
event.preventDefault();
});
$(document).ready(function(){
var id_ville = 0;
/* Get the checkboxes values based on the class attached to each check box */
$("#valider").click(function() {
activeVille();
});
$("#disable").click(function() {
//desactiveVille();
});
$(".modif").click(function(){
id_ville = $(this).val();
});
});
function activeVille(){
var chkArray = [];
$(".chk:checked").each(function() {
chkArray.push($(this).val());
});
var selected;
selected = chkArray.join(',') ;
var unchkArray = [];
$(".unchk:checked").each(function() {
unchkArray.push($(this).val());
});
var selectedForDisable;
selectedForDisable = unchkArray.join(',') ;
if(selected.length > 0 && selectedForDisable.length === 0){
$.ajax({
url:'<?php echo base_url('index.php/Gestion/activer')?>',
type: 'post',
data: {villes: chkArray},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Ville(s) activée(s)');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
} else if (selectedForDisable.length > 0 && selected.length === 0){
$.ajax({
url:'<?php echo base_url('index.php/Gestion/desactiver')?>',
type: 'post',
data: {villes: unchkArray},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Ville(s) désactivée(s)');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
} else if (selectedForDisable.length > 0 && selected.length > 0){
$.ajax({
url:'<?php echo base_url('index.php/Gestion/activer_desactiver')?>',
type: 'post',
data: {dVilles: unchkArray,aVilles: chkArray},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Ville(s) (dés)activée(s)');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
}else{
alert("Veuillez cocher des villes");
}
}
function desactiveVille(){
var unchkArray = [];
$(".unchk:checked").each(function() {
unchkArray.push($(this).val());
});
var selectedForDisable;
selectedForDisable = unchkArray.join(',') ;
if(selectedForDisable.length > 0){
$.ajax({
url:'<?php echo base_url('index.php/Gestion/desactiver')?>',
type: 'post',
data: {villes: unchkArray},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Ville(s) désactivée(s)');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
}else{
alert("Veuillez cocher des villes");
}
}
</script>
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('Modification et Activation des villes'); ?>
</h1>
<?php
$site_url = base_url();
if($alert=="ok") {
if(!$success=="ok"){
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row">
<div class="col-xs-8">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Activer/Désactiver'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<?php
$sql2 = $list_villes;
if($sql2!=false){
$numrows=$sql2->num_rows();
$num = 0;
if ($numrows > 0) {
?>
<table id="validated" class="table table-bordered table-striped">
<thead>
<tr>
<th align='center'></th>
<th><?php echo $this->lang->line('Villes'); ?></th>
<th><?php echo $this->lang->line('Pays'); ?></th>
<th align='center'><?php echo $this->lang->line('Statut'); ?></th>
<th align='center'><?php echo $this->lang->line('Activer'); ?></th>
<th align='center'><?php echo $this->lang->line('Désactiver'); ?></th>
<th align='center'><?php echo $this->lang->line('Modifier'); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach($sql2->result() as $row) {
$num ++;
//$member_code = randomString1(10);
$libelle_status = $this->lang->line('Inactive');
if($row->status==1){
$libelle_status = $this->lang->line('Active');
}
echo "<tr>
<td align='center'>$num</td>
<td >$row->name</td>
<td>$row->country</td>
<td align='center'>$libelle_status</td>";
if($row->status==0) {
echo "<td align='center'><input type='checkbox' name='activer' class='chk' value='".$row->id."'></td>
<td align='center'><input type='checkbox' name='desactiver' value='".$row->id."' disabled></td>";
}else{
echo "<td align='center'><input type='checkbox' name='activer' value='".$row->id."' disabled></td>
<td align='center'><input type='checkbox' name='desactiver' value='".$row->id."' class='unchk'></td>";
}
echo "<td id='edition' align='center'>
<button data-toggle='modal' data-id-town='$row->id' data-town='$row->name' 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>
</td>
</tr>";
}
?>
</tbody>
</table>
<button type="button" class="btn btn-success" id="valider"><?php echo $this->lang->line('Activer/Désactiver'); ?></button>
<?php
}
else {
echo $this->lang->line('Aucune ville');
}
}else {
echo $this->lang->line('Aucune ville');
}
?>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Ajouter une ville'); ?></h3>
</div>
<div class="box-body">
<form action="<?php echo base_url('index.php/Gestion/ajout')?>" method="post" class="bottom-75 center-block">
<div class="form-group">
<label for="pays"><?php echo $this->lang->line('Pays'); ?></label>
<?php
$result=$pays;
$numrows=$result->num_rows();
if ($numrows > 0) { ?>
<select class="form-control input-lg" name="pays" required id="pays">
<?php foreach($result->result() as $row) {
echo "<option value='".$row->id."' id='".$row->code_country."'>".$row->name."</option>";
} ?>
</select>
<?php }else{
echo $this->lang->line('Aucun pays');
}
?>
</div>
<div class="form-group">
<label for="ville"><?php echo $this->lang->line('Ville'); ?></label>
<input type="text" class="form-control input-lg" name="ville" required id="ville">
</div>
<div class="form-group">
<input id="btn-add" type="submit" value="<?php echo $this->lang->line('Ajouter'); ?>" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title"><?php echo $this->lang->line('Modifier la ville'); ?></h4>
</div>
<div class="modal-body">
<form id="update-form" method="post" class="bottom-75 center-block">
<div class="form-group">
<label for="modal-pays"><?php echo $this->lang->line('Pays'); ?></label>
<?php
$result=$pays;
$numrows=$result->num_rows();
if ($numrows > 0) { ?>
<select class="form-control input-lg" name="pays" required id="modal-pays">
<?php foreach($result->result() as $row) {
echo "<option value='".$row->id."' id='".$row->code_country."'>".$row->name."</option>";
} ?>
</select>
<?php }else{
echo $this->lang->line('Aucun pays');
}
?>
</div>
<div class="form-group">
<label for="modal-ville"><?php echo $this->lang->line('Ville'); ?></label>
<input type="text" class="form-control input-lg" name="ville" required id="modal-ville">
</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"><?php echo $this->lang->line('Fermer'); ?></button>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script>
$(function() {
$('#unvalidated').DataTable();
$('#validated').DataTable();
})
</script>
<script>
var town = null;
var id_town = null;
var country = null;
var id_country = null;
$(document).on("click", ".open-modal", function () {
town = $(this).data('town');
id_town = $(this).data('id-town');
country = $(this).data('country');
id_country = $(this).data('id-country');
$(".modal-body #modal-pays").append("<option value='"+id_country+"' selected>"+country+"</option>");
$(".modal-body #modal-ville").val( town );
});
$("#update-form").submit(function(){
var new_id_country = $("#modal-pays").val();
var new_town = $("#modal-ville").val();
$.ajax({
url:'<?php echo base_url('index.php/Gestion/update')?>',
type: 'post',
data: {id_country: new_id_country,id_town:id_town,town:new_town},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('La ville a été mise à jour');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
event.preventDefault();
});
$(document).ready(function(){
var id_ville = 0;
/* Get the checkboxes values based on the class attached to each check box */
$("#valider").click(function() {
activeVille();
});
$("#disable").click(function() {
//desactiveVille();
});
$(".modif").click(function(){
id_ville = $(this).val();
});
});
function activeVille(){
var chkArray = [];
$(".chk:checked").each(function() {
chkArray.push($(this).val());
});
var selected;
selected = chkArray.join(',') ;
var unchkArray = [];
$(".unchk:checked").each(function() {
unchkArray.push($(this).val());
});
var selectedForDisable;
selectedForDisable = unchkArray.join(',') ;
if(selected.length > 0 && selectedForDisable.length === 0){
$.ajax({
url:'<?php echo base_url('index.php/Gestion/activer')?>',
type: 'post',
data: {villes: chkArray},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Ville(s) activée(s)');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
} else if (selectedForDisable.length > 0 && selected.length === 0){
$.ajax({
url:'<?php echo base_url('index.php/Gestion/desactiver')?>',
type: 'post',
data: {villes: unchkArray},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Ville(s) désactivée(s)');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
} else if (selectedForDisable.length > 0 && selected.length > 0){
$.ajax({
url:'<?php echo base_url('index.php/Gestion/activer_desactiver')?>',
type: 'post',
data: {dVilles: unchkArray,aVilles: chkArray},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Ville(s) (dés)activée(s)');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
}else{
alert("Veuillez cocher des villes");
}
}
function desactiveVille(){
var unchkArray = [];
$(".unchk:checked").each(function() {
unchkArray.push($(this).val());
});
var selectedForDisable;
selectedForDisable = unchkArray.join(',') ;
if(selectedForDisable.length > 0){
$.ajax({
url:'<?php echo base_url('index.php/Gestion/desactiver')?>',
type: 'post',
data: {villes: unchkArray},
dataType: 'json',
success: function(data){
if(data==='completed'){
alert('Ville(s) désactivée(s)');
location.reload(true);
}else{
alert("Une erreur s'est produite");
location.reload(true);
}
}
});
}else{
alert("Veuillez cocher des villes");
}
}
</script>

View File

@ -329,7 +329,7 @@ if ($transactions != false) {
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Commission Hyperviseur') ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<table id="example1" class="table table-bordered table-hover">
<thead>
<tr>

View File

@ -375,7 +375,7 @@
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Commissions Superviseurs') ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<table id="example1" class="table table-bordered table-hover">
<thead>
<tr>

View File

@ -435,7 +435,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<h3 class="box-title"><?php echo $this->lang->line('rate_com_user_wallet_wallet_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -464,7 +464,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<h3 class="box-title"><?php echo $this->lang->line('rate_com_user_wallet_wallet_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -493,7 +493,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<h3 class="box-title"><?php echo $this->lang->line('rate_com_user_wallet_cash_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -522,7 +522,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<h3 class="box-title"><?php echo $this->lang->line('rate_com_user_wallet_cash_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -551,7 +551,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<h3 class="box-title"><?php echo $this->lang->line('rate_com_agent_depot_wallet_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -580,7 +580,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<h3 class="box-title"><?php echo $this->lang->line('rate_com_agent_depot_wallet_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -609,7 +609,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<h3 class="box-title"><?php echo $this->lang->line('rate_com_agent_cash_cash_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -638,7 +638,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<h3 class="box-title"><?php echo $this->lang->line('rate_com_agent_cash_cash_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -700,7 +700,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Commission Hyperviseur') ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<table id="example1" class="table table-bordered table-hover">
<thead>
<tr>

View File

@ -568,7 +568,7 @@
<h3 class="box-title"><?php echo $this->lang->line('rate_com_user_wallet_wallet_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -597,7 +597,7 @@
<h3 class="box-title"><?php echo $this->lang->line('rate_com_user_wallet_wallet_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -626,7 +626,7 @@
<h3 class="box-title"><?php echo $this->lang->line('rate_com_user_wallet_cash_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -655,7 +655,7 @@
<h3 class="box-title"><?php echo $this->lang->line('rate_com_user_wallet_cash_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -684,7 +684,7 @@
<h3 class="box-title"><?php echo $this->lang->line('rate_com_agent_depot_wallet_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -713,7 +713,7 @@
<h3 class="box-title"><?php echo $this->lang->line('rate_com_agent_depot_wallet_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -742,7 +742,7 @@
<h3 class="box-title"><?php echo $this->lang->line('rate_com_agent_cash_cash_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -771,7 +771,7 @@
<h3 class="box-title"><?php echo $this->lang->line('rate_com_agent_cash_cash_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
@ -832,7 +832,7 @@
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Commissions Superviseurs') ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<table id="example1" class="table table-bordered table-hover">
<thead>
<tr>
@ -909,7 +909,7 @@
<form id="walletForm">
<div class="row">
<div class="col-lg-4">
<div class="form-group">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
@ -973,7 +973,7 @@
</div>
</div>
</div>
<div class="form-group">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
@ -1084,7 +1084,7 @@
</div>
</div>
</div>
<div class="form-group">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
@ -1155,7 +1155,7 @@
</div>
</div>
</div>
<div class="form-group">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">

View File

@ -225,7 +225,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Commissions Agents') ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<table id="example1" class="table table-bordered table-hover">
<thead>
<tr>

View File

@ -44,7 +44,7 @@
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Réseaux activés'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php

View File

@ -154,6 +154,13 @@
<i class="glyphicon glyphicon-lock"></i> <span><?php echo $this->lang->line('menu_wallet_password'); ?></span>
</a>
</li>
<?php if($hasWallet->first_row()->type == 'ilink'){ ?>
<li class="<?php if($active=="calculator"){echo "active";} ?>">
<a href="<?php echo base_url('index.php/Hyperviseur_dash/calculator') ?>">
<i class="glyphicon glyphicon-adjust"></i> <span><?php echo $this->lang->line('calculator'); ?></span>
</a>
</li>
<?php }?>
<?php } ?>
</ul>

View File

@ -76,7 +76,7 @@
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('recharge_historic'); ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
if($transactions){
$numrows = $transactions->num_rows();

View File

@ -76,7 +76,7 @@
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Historique des transactions') ?></h3>
</div>
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
if($transactions){
$numrows = $transactions->num_rows();
@ -97,6 +97,7 @@
<th><?php echo $this->lang->line('Commission de l\'hyperviseur') ?></th>
<th><?php echo $this->lang->line('Commission du superviseur') ?></th>
<th><?php echo $this->lang->line('Commission de l\'agent') ?></th>
<th><?php echo $this->lang->line('agent_name') ?></th>
<th align='center'>Date</th>
</tr>
</thead>
@ -127,6 +128,7 @@
<td>".$fmt->format( $row->commission_hyp)."</td>
<td>".$fmt->format( $row->commission_sup)."</td>
<td>".$fmt->format( $row->commission_ag)."</td>
<td>".$row->agent."</td>
<td>".toLocateDate($row->date_created,$this->session->userdata('timezone'))."</td>
</tr>";
@ -183,7 +185,7 @@
$('#transactions').DataTable({
"aaSorting": [[ 0, "desc" ]],
"columnDefs": [ {
targets: 9,
targets: 10,
render: $.fn.dataTable.render.moment( 'YYYY-MM-DD HH:mm:ss' , 'D MMMM YYYY HH:mm:ss', format)
}]
});

View File

@ -1,416 +1,418 @@
<!-- jvectormap -->
<link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>">
<!-- Date Picker -->
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
<!-- Daterange picker -->
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
<!-- bootstrap wysihtml5 - text editor -->
<link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
<!-- ChartJS -->
<script src="<?php echo base_url('bower_components/Chart.js/Chart.js') ?>"></script>
<?php
function convertDate($date){
$month = null;
switch ($date) {
case "Jan":
$month = 1;
break;
case "Feb":
$month = 2;
break;
case "Mar":
$month = 3;
break;
case "Apr":
$month = 4;
break;
case "May":
$month = 5;
break;
case "Jun":
$month = 6;
break;
case "Jul":
$month = 7;
break;
case "Aug":
$month = 8;
break;
case "Sep":
$month = 9;
break;
case "Oct":
$month = 10;
break;
case "Nov":
$month = 11;
break;
case "Dec":
$month = 12;
break;
}
return $month;
}
$month = time();
$months[]=convertDate(date("M"));
$label_months [] = date("M")." ".date("Y");
$years[]= date("Y");
for ($i = 1; $i <= 11; $i++) {
$month = strtotime('last month', $month);
$months [] = convertDate(date("M", $month));
$years[] = date("Y", $month);
$label_months [] = date("M", $month)." ".date("Y", $month);
}
/**
** Simple User Treatment
**/
$date = date("Y");
$super_data =array();
for ($i = 1; $i <= 12; $i++) {
$super_query_mounth = $this->db->query("SELECT agent_id FROM super_infos
WHERE MONTH(date_created) = '".$months[$i-1]."' AND YEAR(date_created) = '".$years[$i-1]."'
AND category='super'
AND code_parrain='".$this->session->userdata('member_code')."'"
);
$super_data[] = $super_query_mounth->num_rows();
}
$demandes_query = $listdem;
if($demandes_query!=false){
$demandes=$demandes_query->num_rows();
// Count networks for simple users
$array_simple = array();
$num = 0;
if ($demandes > 0) {
foreach($demandes_query->result() as $row) {
$num++;
$array_simple[] = $row->codeMembre;
}
$vals_simple = array_count_values($array_simple);
//echo 'No. of NON Duplicate Items: '.count($vals_simple).'<br><br>';
//print_r($vals_simple);
$pieChart2 = array();
foreach(array_keys($vals_simple) as $paramName2) {
$color2 = dechex(rand(0x000000, 0xFFFFFF));
$trash2 = array("value" => $vals_simple[$paramName2],
"color" => "#".$color2,
"highlight" => "#".$color2,
"label" => $paramName2);
$pieChart2[]= $trash2;
}
}
}else{
$pieChart2 = array();
}
/**
** Geolocated User Treatment
**/
$users_geolocated_query = $list_geolocated_users;
// Geolocated Users by month replace 2016 by NOW()
$users_geolocated_data =array();
for ($i = 1; $i <= 12; $i++) {
$users_geolocated_query_january = $this->db->query("SELECT agent_id FROM super_infos
WHERE MONTH(date_created) = '".$months[$i-1]."' AND YEAR(date_created) = '".$years[$i-1]."'
AND category='geolocated' AND latitude!=-1 AND longitude!=-1
AND code_parrain IN (SELECT code_membre FROM super_infos WHERE code_parrain='".$this->session->userdata('member_code')."')
");
$users_geolocated_data[] = $users_geolocated_query_january->num_rows();
}
if($users_geolocated_query!=false){
$users_geolocated=$users_geolocated_query->num_rows();
//$users_geolocated_query = json_encode($users_geolocated_query->result());
// Counts network for geolocated users
$array_geolocated = array();
$num = 0;
if ($users_geolocated > 0) {
foreach($users_geolocated_query->result() as $row) {
$num++;
$array_geolocated[] = $row->town;
}
$vals_geolocated = array_count_values($array_geolocated);
//echo 'No. of NON Duplicate Items: '.count($vals_geolocated).'<br><br>';
//print_r($vals_geolocated);
$pieChart = array();
foreach(array_keys($vals_geolocated) as $paramName) {
$color = dechex(rand(0x000000, 0xFFFFFF));
$trash = array("value" => $vals_geolocated[$paramName],
"color" => "#".$color,
"highlight" => "#".$color,
"label" => $paramName);
$pieChart[]= $trash;
}
}
}else{
$pieChart = array();
}
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('Hyperviseur'); ?>
<small><?php echo $this->lang->line('Tableau de bord'); ?></small>
</h1>
</section>
<section class="content">
<!-- Small boxes (Stat box) -->
<div class="row">
<!-- ./col -->
<div class="col-lg-2 col-xs-2">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3><?php echo $count_geo;?></h3>
<p><?php echo $this->lang->line('Utilisateurs géolocalisés'); ?></p>
</div>
<div class="icon">
<i class=""></i>
</div>
<a href="#" data-toggle="modal" data-target="#modal-default" class="small-box-footer"><?php echo $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-2 col-xs-2">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<h3><?php echo $count_sup;?></h3>
<p><?php echo $this->lang->line('Superviseur'); ?></p>
</div>
<div class="icon">
<i class=""></i>
</div>
<a href="<?php echo base_url('index.php/Hyperviseur_dash/getAllSupervisor') ?>" class="small-box-footer"><?php echo $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-2 col-xs-2">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3><?php echo $count_d_users;?></h3>
<p><?php echo $this->lang->line('Demandes de crédits'); ?></p>
</div>
<div class="icon">
<i class=""></i>
</div>
<a href="#" data-toggle="modal" data-target="#modal-default2" class="small-box-footer"><?php echo $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-2 col-xs-2">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3><?php echo $count_d_traite;?></h3>
<p><?php echo $this->lang->line("Demandes traitées"); ?></p>
</div>
<div class="icon">
<i class=""></i>
</div>
<a href="#" data-toggle="modal" data-target="#modal-default2" class="small-box-footer"><?php echo $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-2 col-xs-2">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3><?php echo $count_d_no_traite;?></h3>
<p><?php echo $this->lang->line("Demandes non traitées"); ?></p>
</div>
<div class="icon">
<i class=""></i>
</div>
<a href="#" data-toggle="modal" data-target="#modal-default2" class="small-box-footer"><?php echo $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-xs-12">
<!-- BAR CHART -->
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line("Adhésions"); ?></h3>
</div>
<div class="box-body">
<div class="chart">
<canvas id="barChart" style="height:230px"></canvas>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
<div class="col-xs-6">
<!-- DONUT CHART -->
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line("Demandes de crédits par superviseur"); ?></h3>
</div>
<div class="box-body" id="chart2">
<canvas id="pieChart2" style="height:250px"></canvas>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<div class="col-xs-6">
<!-- DONUT CHART -->
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line("Utilisateurs géolocalisés par ville"); ?></h3>
</div>
<div class="box-body" id="chart">
<canvas id="pieChart" style="height:250px"></canvas>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
<!-- /.row -->
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- jQuery UI 1.11.4 -->
<script src="<?php echo base_url('bower_components/jquery-ui/jquery-ui.min.js') ?>"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
$.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- Morris.js charts -->
<script src="<?php echo base_url('bower_components/raphael/raphael.min.js') ?>"></script>
<!-- Sparkline -->
<script src="<?php echo base_url('bower_components/jquery-sparkline/dist/jquery.sparkline.min.js') ?>"></script>
<!-- jvectormap -->
<script src="<?php echo base_url('plugins/jvectormap/jquery-jvectormap-1.2.2.min.js') ?>"></script>
<script src="<?php echo base_url('plugins/jvectormap/jquery-jvectormap-world-mill-en.js') ?>"></script>
<!-- jQuery Knob Chart -->
<script src="<?php echo base_url('bower_components/jquery-knob/dist/jquery.knob.min.js') ?>"></script>
<!-- daterangepicker -->
<script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
<!-- datepicker -->
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<!-- ChartJS -->
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
<script >
/*
var cities = [];
var cities_simple = [];
//console.log(geocodeposition(52.5487429714954,-1.81602098644987));
for(var i = 0 ; i < 1 ; i++ ) {
var cit;
var latit = Number(users[i]['latitude']);
var longi = Number(users[i]['longitude']);
//cit = geocodeposition(latit, longi);
cities[i] = {};
cities[i] = cit;
}
*/
//console.log(cities);
var Pie = '<?php echo json_encode($pieChart) ?>';
if(Pie==='[]'){
var select = document.getElementById('chart');
$(select.children).hide();
$(select).append("<p>Aucun utilisateur géolocalisé</p>");
}else{
Pie = JSON.parse(Pie);
}
var Pie2 = '<?php echo json_encode($pieChart2) ?>';
if(Pie2==='[]') {
var select = document.getElementById('chart2');
$(select.children).hide();
$(select).append("<p>Aucune demande de crédit</p>");
}else{
Pie2 = JSON.parse(Pie2);
}
var areaChartData = {
labels : <?php echo json_encode($label_months) ?>,
datasets: [
{
label : 'Electronics',
fillColor : 'rgba(255, 162, 0, 1)',
strokeColor : 'rgba(255, 162, 0, 1)',
pointColor : 'rgba(255, 162, 0, 1)',
pointStrokeColor : '#ffa200',
pointHighlightFill : '#fff',
pointHighlightStroke: 'rgba(220,220,220,1)',
data: <?php echo json_encode($users_geolocated_data) ?>
},
{
label : 'Digital Goods',
fillColor : 'rgba(0, 187, 255, 1)',
strokeColor : 'rgba(0, 187, 255, 1)',
pointColor : '#00bbff',
pointStrokeColor : 'rgba(0, 187, 255, 1)',
pointHighlightFill : '#fff',
pointHighlightStroke: 'rgba(0, 187, 255, 1)',
data : <?php echo json_encode($super_data) ?>
}
]
};
</script>
<!-- Page script -->
<script src="<?php echo base_url('dist/js/custom.js') ?>"></script>
<!-- jvectormap -->
<link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>">
<!-- Date Picker -->
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
<!-- Daterange picker -->
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
<!-- bootstrap wysihtml5 - text editor -->
<link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
<!-- ChartJS -->
<script src="<?php echo base_url('bower_components/Chart.js/Chart.js') ?>"></script>
<?php
function convertDate($date){
$month = null;
switch ($date) {
case "Jan":
$month = 1;
break;
case "Feb":
$month = 2;
break;
case "Mar":
$month = 3;
break;
case "Apr":
$month = 4;
break;
case "May":
$month = 5;
break;
case "Jun":
$month = 6;
break;
case "Jul":
$month = 7;
break;
case "Aug":
$month = 8;
break;
case "Sep":
$month = 9;
break;
case "Oct":
$month = 10;
break;
case "Nov":
$month = 11;
break;
case "Dec":
$month = 12;
break;
}
return $month;
}
$month = time();
$months[]=convertDate(date("M"));
$label_months [] = date("M")." ".date("Y");
$years[]= date("Y");
for ($i = 1; $i <= 11; $i++) {
$month = strtotime('last month', $month);
$months [] = convertDate(date("M", $month));
$years[] = date("Y", $month);
$label_months [] = date("M", $month)." ".date("Y", $month);
}
/**
** Simple User Treatment
**/
$date = date("Y");
$super_data =array();
for ($i = 1; $i <= 12; $i++) {
$super_query_mounth = $this->db->query("SELECT agent_id FROM super_infos
WHERE MONTH(date_created) = '".$months[$i-1]."' AND YEAR(date_created) = '".$years[$i-1]."'
AND category='super'
AND code_parrain='".$this->session->userdata('member_code')."'"
);
$super_data[] = $super_query_mounth->num_rows();
}
$demandes_query = $listdem;
if($demandes_query!=false){
$demandes=$demandes_query->num_rows();
// Count networks for simple users
$array_simple = array();
$num = 0;
if ($demandes > 0) {
foreach($demandes_query->result() as $row) {
$num++;
$array_simple[] = $row->codeMembre;
}
$vals_simple = array_count_values($array_simple);
//echo 'No. of NON Duplicate Items: '.count($vals_simple).'<br><br>';
//print_r($vals_simple);
$pieChart2 = array();
foreach(array_keys($vals_simple) as $paramName2) {
$color2 = dechex(rand(0x000000, 0xFFFFFF));
$trash2 = array("value" => $vals_simple[$paramName2],
"color" => "#".$color2,
"highlight" => "#".$color2,
"label" => $paramName2);
$pieChart2[]= $trash2;
}
}
}else{
$pieChart2 = array();
}
/**
** Geolocated User Treatment
**/
$users_geolocated_query = $list_geolocated_users;
// Geolocated Users by month replace 2016 by NOW()
$users_geolocated_data =array();
for ($i = 1; $i <= 12; $i++) {
$users_geolocated_query_january = $this->db->query("SELECT agent_id FROM super_infos
WHERE MONTH(date_created) = '".$months[$i-1]."' AND YEAR(date_created) = '".$years[$i-1]."'
AND category='geolocated' AND latitude!=-1 AND longitude!=-1
AND code_parrain IN (SELECT code_membre FROM super_infos WHERE code_parrain='".$this->session->userdata('member_code')."')
");
$users_geolocated_data[] = $users_geolocated_query_january->num_rows();
}
if($users_geolocated_query!=false){
$users_geolocated=$users_geolocated_query->num_rows();
//$users_geolocated_query = json_encode($users_geolocated_query->result());
// Counts network for geolocated users
$array_geolocated = array();
$num = 0;
if ($users_geolocated > 0) {
foreach($users_geolocated_query->result() as $row) {
$num++;
$array_geolocated[] = $row->town;
}
$vals_geolocated = array_count_values($array_geolocated);
//echo 'No. of NON Duplicate Items: '.count($vals_geolocated).'<br><br>';
//print_r($vals_geolocated);
$pieChart = array();
foreach(array_keys($vals_geolocated) as $paramName) {
$color = dechex(rand(0x000000, 0xFFFFFF));
$trash = array("value" => $vals_geolocated[$paramName],
"color" => "#".$color,
"highlight" => "#".$color,
"label" => $paramName);
$pieChart[]= $trash;
}
}
}else{
$pieChart = array();
}
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('Hyperviseur'); ?>
<small><?php echo $this->lang->line('Tableau de bord'); ?></small>
</h1>
</section>
<section class="content">
<!-- Small boxes (Stat box) -->
<div class="row">
<!-- ./col -->
<div class="col-lg-2 col-md-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3><?php echo $count_geo;?></h3>
<p><?php echo $this->lang->line('Utilisateurs géolocalisés'); ?></p>
</div>
<div class="icon">
<i class=""></i>
</div>
<a href="#" data-toggle="modal" data-target="#modal-default" class="small-box-footer"><?php echo $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-2 col-md-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<h3><?php echo $count_sup;?></h3>
<p><?php echo $this->lang->line('Superviseur'); ?></p>
</div>
<div class="icon">
<i class=""></i>
</div>
<a href="<?php echo base_url('index.php/Hyperviseur_dash/getAllSupervisor') ?>" class="small-box-footer"><?php echo $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-2 col-md-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3><?php echo $count_d_users;?></h3>
<p><?php echo $this->lang->line('Demandes de crédits'); ?></p>
</div>
<div class="icon">
<i class=""></i>
</div>
<a href="#" data-toggle="modal" data-target="#modal-default2" class="small-box-footer"><?php echo $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-2 col-md-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3><?php echo $count_d_traite;?></h3>
<p><?php echo $this->lang->line("Demandes traitées"); ?></p>
</div>
<div class="icon">
<i class=""></i>
</div>
<a href="#" data-toggle="modal" data-target="#modal-default2" class="small-box-footer"><?php echo $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-2 col-md-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3><?php echo $count_d_no_traite;?></h3>
<p><?php echo $this->lang->line("Demandes non traitées"); ?></p>
</div>
<div class="icon">
<i class=""></i>
</div>
<a href="#" data-toggle="modal" data-target="#modal-default2" class="small-box-footer"><?php echo $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- /.col -->
</div>
<div class="row">
<div class="col-xs-12">
<!-- BAR CHART -->
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line("Adhésions"); ?></h3>
</div>
<div class="box-body">
<div class="chart">
<canvas id="barChart" style="height:230px"></canvas>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
<div class="row">
<div class="col-xs-6">
<!-- DONUT CHART -->
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line("Demandes de crédits par superviseur"); ?></h3>
</div>
<div class="box-body" id="chart2">
<canvas id="pieChart2" style="height:250px"></canvas>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<div class="col-xs-6">
<!-- DONUT CHART -->
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line("Utilisateurs géolocalisés par ville"); ?></h3>
</div>
<div class="box-body" id="chart">
<canvas id="pieChart" style="height:250px"></canvas>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
<!-- /.row -->
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- jQuery UI 1.11.4 -->
<script src="<?php echo base_url('bower_components/jquery-ui/jquery-ui.min.js') ?>"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
$.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- Morris.js charts -->
<script src="<?php echo base_url('bower_components/raphael/raphael.min.js') ?>"></script>
<!-- Sparkline -->
<script src="<?php echo base_url('bower_components/jquery-sparkline/dist/jquery.sparkline.min.js') ?>"></script>
<!-- jvectormap -->
<script src="<?php echo base_url('plugins/jvectormap/jquery-jvectormap-1.2.2.min.js') ?>"></script>
<script src="<?php echo base_url('plugins/jvectormap/jquery-jvectormap-world-mill-en.js') ?>"></script>
<!-- jQuery Knob Chart -->
<script src="<?php echo base_url('bower_components/jquery-knob/dist/jquery.knob.min.js') ?>"></script>
<!-- daterangepicker -->
<script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
<!-- datepicker -->
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<!-- ChartJS -->
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
<script >
/*
var cities = [];
var cities_simple = [];
//console.log(geocodeposition(52.5487429714954,-1.81602098644987));
for(var i = 0 ; i < 1 ; i++ ) {
var cit;
var latit = Number(users[i]['latitude']);
var longi = Number(users[i]['longitude']);
//cit = geocodeposition(latit, longi);
cities[i] = {};
cities[i] = cit;
}
*/
//console.log(cities);
var Pie = '<?php echo json_encode($pieChart) ?>';
if(Pie==='[]'){
var select = document.getElementById('chart');
$(select.children).hide();
$(select).append("<p>Aucun utilisateur géolocalisé</p>");
}else{
Pie = JSON.parse(Pie);
}
var Pie2 = '<?php echo json_encode($pieChart2) ?>';
if(Pie2==='[]') {
var select = document.getElementById('chart2');
$(select.children).hide();
$(select).append("<p>Aucune demande de crédit</p>");
}else{
Pie2 = JSON.parse(Pie2);
}
var areaChartData = {
labels : <?php echo json_encode($label_months) ?>,
datasets: [
{
label : 'Electronics',
fillColor : 'rgba(255, 162, 0, 1)',
strokeColor : 'rgba(255, 162, 0, 1)',
pointColor : 'rgba(255, 162, 0, 1)',
pointStrokeColor : '#ffa200',
pointHighlightFill : '#fff',
pointHighlightStroke: 'rgba(220,220,220,1)',
data: <?php echo json_encode($users_geolocated_data) ?>
},
{
label : 'Digital Goods',
fillColor : 'rgba(0, 187, 255, 1)',
strokeColor : 'rgba(0, 187, 255, 1)',
pointColor : '#00bbff',
pointStrokeColor : 'rgba(0, 187, 255, 1)',
pointHighlightFill : '#fff',
pointHighlightStroke: 'rgba(0, 187, 255, 1)',
data : <?php echo json_encode($super_data) ?>
}
]
};
</script>
<!-- Page script -->
<script src="<?php echo base_url('dist/js/custom.js') ?>"></script>

View File

@ -1,291 +1,291 @@
<!-- DataTables -->
<link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
<div class="content-wrapper">
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box">
<?php
if($alert=="ok") {
if(!$success=="ok"){
?>
<div class='alert alert-danger alert-dismissible'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Error!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
<div class="box-header with-border">
<h3 class="box-title">Liste des utilisateurs de votre zone</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<?php
$this->db->select('*');
$this->db->from('users_simple');
$this->db->where('network',$network);
$result=$this->db->get();
$numrows=$result->num_rows();
$num = 0;
if ($numrows > 0) {
?>
<table id="listeMembres" class="table table-bordered table-striped">
<thead>
<tr class="label-primary">
<th>Quartier</th>
<th>Nom</th>
<th>Code pays</th>
<th>Reseau</th>
<th>Email</th>
<th>Contact</th>
<th>Balance</th>
<th>Modifier</th>
<th>Effacer</th>
</tr>
</thead>
<tbody>
<?php
$site_url = base_url();
$url = base_url('index.php/list_user_s/modif');
// output data of each row
foreach($result->result() as $row) {
$num++;
echo "<tr>
<td>$row->firstname</td>
<td>$row->lastname </td>
<td>$row->country_code</td>
<td>$row->network</td>
<td>$row->email </td>
<td>$row->phone</td>
<td>$row->balance</td>
<td >
<a id='modal-497395".$num."' href='#modal-container-497395".$num."' class='btn btn-app' role='button' role='button' data-toggle='modal'><i class='fa fa-edit'></i>Edit</a>
<div class='modal fade' id='modal-container-497395".$num."' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-body'>
<h4 class='modal-title' id='myModalLabel'>
Modification
<hr class='colorgraph'>
</h4>
<form action='$url' id='form-horizontal' method='POST' >
<div class='control-group'>
<label class='control-label' for='inputEmail' >Nom</label>
<div class='controls'>
<input id='inputEmail' type='text' name='nm' class='form-control input-sm' value='$row->lastname'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail' >prenom</label>
<div class='controls'>
<input id='inputEmail' type='text' name='prnm' class='form-control input-sm' value='$row->firstname'/>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>Code Pays</label>
<div class='controls'>
<input id='inputEmail' type='text' name='cdpays' class='form-control input-sm' value='$row->country_code'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>Reseau</label>
<div class='controls'>
<input id='inputEmail' type='text' name='reso' class='form-control input-sm' value='$row->network'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>Code Membre</label>
<div class='controls'>
<input id='inputEmail' type='text' name='cmbre' class='form-control input-sm' value='$row->member_code'>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>Email</label>
<div class='controls'>
<input id='inputEmail' type='text' name='maill' class='form-control input-sm' value='$row->email'/>
</div>
</div><div class='control-group'>
<label class='control-label' for='inputEmail'>Category</label>
<div class='controls'>
<input id='inputEmail' type='text' name='cat' class='form-control input-sm' value='$row->category'/>
</div>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail' >Telephone</label>
<div class='controls'>
<input id='inputEmail' type='text' name='tel' class='form-control input-sm' value='$row->phone' readonly/>
</div>
</div>
<hr class='colorgraph'>
<input name='modifbtn' type='Submit' class='btn btn-primary' value='Sauvegarder'/>
&nbsp;
<button type='button' class='btn btn-default' data-dismiss='modal'>
Fermer
</button>
</form>
</div>
</div>
</div>
</div>
</td>
<td>
<a href='#myModal-1".$num."' role='button' class='btn btn-app btn-danger' data-toggle='modal'><i class='fa fa-remove'></i>Delete</a>
<div class='modal fade' id='myModal-1".$num."' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal' aria-label='Close'>
<span aria-hidden='true'>&times;</span></button>
<h4 class='modal-title'>Confirmer la suppression</h4>
</div>
<div class='modal-body'>
<p class='error-text'><i class='icon-warning-sign modal-icon'></i>Do you really want to delete the user". $row->phone."?</p>
</div>
<div class='modal-footer'>
<button type='button' class='btn btn-default pull-left' data-dismiss='modal'>Close</button>
<a href='".$site_url."Listes_members/suppr/?recordId=".$row->phone."' role='button' class='btn btn-danger'>
Delete</a>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
</td>
</tr>";
}
?>
<?php
} else {
echo "1 results";
}
$this->db->close();
?>
</tbody>
<tfoot>
<tr>
<th>Quartier</th>
<th>Nom</th>
<th>Code pays</th>
<th>Reseau</th>
<th>Email</th>
<th>Contact</th>
<th>Balance</th>
<th>Modifier</th>
<th>Effacer</th>
</tr>
</tfoot>
</table>
</div>
<!-- /.box-body -->
<div class="box-footer clearfix">
<ul class="pagination pagination-sm no-margin pull-right">
<li><a href="#">&laquo;</a></li>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">&raquo;</a></li>
</ul>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- SlimScroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script>
$(function () {
$('#listeMembres').DataTable()
})
</script>
<!-- DataTables -->
<link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
<div class="content-wrapper">
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box">
<?php
if($alert=="ok") {
if(!$success=="ok"){
?>
<div class='alert alert-danger alert-dismissible'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Error!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
<div class="box-header with-border">
<h3 class="box-title">Liste des utilisateurs de votre zone</h3>
</div>
<!-- /.box-header -->
<div class="box-body" style="overflow-x:auto;">
<?php
$this->db->select('*');
$this->db->from('users_simple');
$this->db->where('network',$network);
$result=$this->db->get();
$numrows=$result->num_rows();
$num = 0;
if ($numrows > 0) {
?>
<table id="listeMembres" class="table table-bordered table-striped">
<thead>
<tr class="label-primary">
<th>Quartier</th>
<th>Nom</th>
<th>Code pays</th>
<th>Reseau</th>
<th>Email</th>
<th>Contact</th>
<th>Balance</th>
<th>Modifier</th>
<th>Effacer</th>
</tr>
</thead>
<tbody>
<?php
$site_url = base_url();
$url = base_url('index.php/list_user_s/modif');
// output data of each row
foreach($result->result() as $row) {
$num++;
echo "<tr>
<td>$row->firstname</td>
<td>$row->lastname </td>
<td>$row->country_code</td>
<td>$row->network</td>
<td>$row->email </td>
<td>$row->phone</td>
<td>$row->balance</td>
<td >
<a id='modal-497395".$num."' href='#modal-container-497395".$num."' class='btn btn-app' role='button' role='button' data-toggle='modal'><i class='fa fa-edit'></i>Edit</a>
<div class='modal fade' id='modal-container-497395".$num."' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-body'>
<h4 class='modal-title' id='myModalLabel'>
Modification
<hr class='colorgraph'>
</h4>
<form action='$url' id='form-horizontal' method='POST' >
<div class='control-group'>
<label class='control-label' for='inputEmail' >Nom</label>
<div class='controls'>
<input id='inputEmail' type='text' name='nm' class='form-control input-sm' value='$row->lastname'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail' >prenom</label>
<div class='controls'>
<input id='inputEmail' type='text' name='prnm' class='form-control input-sm' value='$row->firstname'/>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>Code Pays</label>
<div class='controls'>
<input id='inputEmail' type='text' name='cdpays' class='form-control input-sm' value='$row->country_code'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>Reseau</label>
<div class='controls'>
<input id='inputEmail' type='text' name='reso' class='form-control input-sm' value='$row->network'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>Code Membre</label>
<div class='controls'>
<input id='inputEmail' type='text' name='cmbre' class='form-control input-sm' value='$row->member_code'>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>Email</label>
<div class='controls'>
<input id='inputEmail' type='text' name='maill' class='form-control input-sm' value='$row->email'/>
</div>
</div><div class='control-group'>
<label class='control-label' for='inputEmail'>Category</label>
<div class='controls'>
<input id='inputEmail' type='text' name='cat' class='form-control input-sm' value='$row->category'/>
</div>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail' >Telephone</label>
<div class='controls'>
<input id='inputEmail' type='text' name='tel' class='form-control input-sm' value='$row->phone' readonly/>
</div>
</div>
<hr class='colorgraph'>
<input name='modifbtn' type='Submit' class='btn btn-primary' value='Sauvegarder'/>
&nbsp;
<button type='button' class='btn btn-default' data-dismiss='modal'>
Fermer
</button>
</form>
</div>
</div>
</div>
</div>
</td>
<td>
<a href='#myModal-1".$num."' role='button' class='btn btn-app btn-danger' data-toggle='modal'><i class='fa fa-remove'></i>Delete</a>
<div class='modal fade' id='myModal-1".$num."' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal' aria-label='Close'>
<span aria-hidden='true'>&times;</span></button>
<h4 class='modal-title'>Confirmer la suppression</h4>
</div>
<div class='modal-body'>
<p class='error-text'><i class='icon-warning-sign modal-icon'></i>Do you really want to delete the user". $row->phone."?</p>
</div>
<div class='modal-footer'>
<button type='button' class='btn btn-default pull-left' data-dismiss='modal'>Close</button>
<a href='".$site_url."Listes_members/suppr/?recordId=".$row->phone."' role='button' class='btn btn-danger'>
Delete</a>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
</td>
</tr>";
}
?>
<?php
} else {
echo "1 results";
}
$this->db->close();
?>
</tbody>
<tfoot>
<tr>
<th>Quartier</th>
<th>Nom</th>
<th>Code pays</th>
<th>Reseau</th>
<th>Email</th>
<th>Contact</th>
<th>Balance</th>
<th>Modifier</th>
<th>Effacer</th>
</tr>
</tfoot>
</table>
</div>
<!-- /.box-body -->
<div class="box-footer clearfix">
<ul class="pagination pagination-sm no-margin pull-right">
<li><a href="#">&laquo;</a></li>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">&raquo;</a></li>
</ul>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- SlimScroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script>
$(function () {
$('#listeMembres').DataTable()
})
</script>

View File

@ -311,7 +311,7 @@ function randomString($length=10 )
<div class="container-fluid">
<div class="row-fluid">
<div class="row-fluid" style="overflow-x:auto;">
<?php
$result=$this->db->get('users');

View File

@ -311,7 +311,7 @@ function randomString($length=10 )
<div class="container-fluid">
<div class="row-fluid">
<div class="row-fluid" style="overflow-x:auto;">
<?php
$result=$this->db->get('users');

View File

@ -158,7 +158,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</ul>
<div class="container-fluid">
<div class="row-fluid">
<div class="row-fluid" style="overflow-x:auto;">

View File

@ -70,7 +70,7 @@
<h3 class="box-title"><?php echo $this->lang->line('Tous les'); ?> <?php echo $map_title ?> <?php //if($this->session->userdata('category')=='super'){ echo "(".$numberGeo." ".$this->lang->line('Restant').")";} ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php

View File

@ -1,374 +1,374 @@
<!-- DataTables -->
<link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
<div class="content-wrapper">
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box">
<?php
if($alert=="ok") {
if(!$success=="ok"){
?>
<div class='alert alert-danger alert-dismissible'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Error!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Utilisateurs simples'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<?php
$result=$list;
if($result!=false){
$numrows=$result->num_rows();
$num = 0;
if ($numrows > 0) {
?>
<table id="listeMembres" class="table table-bordered table-striped">
<thead>
<tr class="label-primary">
<th><?php echo $this->lang->line('Nom'); ?></th>
<th><?php echo $this->lang->line('Pays'); ?></th>
<th><?php echo $this->lang->line('Adresse'); ?></th>
<th><?php echo $this->lang->line('Reseau'); ?></th>
<th><?php echo $this->lang->line('Email'); ?></th>
<th><?php echo $this->lang->line('Solde'); ?></th>
<th><?php echo $this->lang->line('Téléphone'); ?></th>
<th><?php echo $this->lang->line('Modifier'); ?></th>
<th><?php echo $this->lang->line('Supprimer'); ?></th>
</tr>
</thead>
<tbody>
<?php
$site_url = base_url();
$url = base_url('index.php/Listes_members/modif');
// output data of each row
foreach($result->result() as $row) {
$num++;
echo "<tr>
<td>$row->lastname </td>
<td>$row->country</td>
<td>$row->adresse</td>
<td>$row->network</td>
<td>$row->email </td>
<td> $row->solde</td>
<td>$row->phone</td>
<td>
<a id='modal-497395".$num."' href='#modal-container-497395".$num."' class='btn btn-app' role='button' role='button' data-toggle='modal'><i class='fa fa-edit'></i>".$this->lang->line('Modifier')."</a>
<div class='modal fade' id='modal-container-497395".$num."' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-body'>
<h4 class='modal-title' id='myModalLabel'>".$this->lang->line('Mettre à jour des informations')."<hr class='colorgraph'></h4>
<form action='$url' id='form-horizontal' method='POST' >
<div class='control-group'>
<label class='control-label' for='inputEmail' >".$this->lang->line('Nom')."</label>
<div class='controls'>
<input id='nom' type='text' name='nom' class='form-control input-sm' value='$row->lastname'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail' >".$this->lang->line('Adresse')."</label>
<div class='controls'>
<input id='adresse' type='text' name='adresse' class='form-control input-sm' value='$row->adresse'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>".$this->lang->line('Reseau')."</label>
<div class='controls'>
<input id='inputEmail' type='text' name='reso' class='form-control input-sm' value='$row->network' readonly/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>".$this->lang->line('code membre')."</label>
<div class='controls'>
<input id='inputEmail' type='text' name='cmbre' class='form-control input-sm' value='$row->user_id' readonly>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>".$this->lang->line('Email')."</label>
<div class='controls'>
<input id='inputEmail' type='email' name='email' class='form-control input-sm' value='$row->email'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail' >".$this->lang->line('Téléphone')."</label>
<div class='controls'>
<input id='inputEmail' type='text' name='tel' class='form-control input-sm' value='$row->phone' readonly/>
</div>
</div>
<hr class='colorgraph'>
<input name='modifbtn' type='Submit' class='btn btn-primary' value='Sauvegarder'/>
&nbsp;
<button type='button' class='btn btn-default' data-dismiss='modal'>
".$this->lang->line('Fermer')."
</button>
</form>
</div>
</div>
</div>
</div>
</td>
<td>
<a href='#myModal-1".$num."' role='button' class='btn btn-app btn-danger' data-toggle='modal'><i class='fa fa-remove'></i>".$this->lang->line('Supprimer')."</a>
<div class='modal fade' id='myModal-1".$num."' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal' aria-label='Close'>
<span aria-hidden='true'>&times;</span></button>
<h4 class='modal-title'>".$this->lang->line('Confirmer la suppression')."</h4>
</div>
<div class='modal-body'>
<p class='error-text'><i class='icon-warning-sign modal-icon'></i>".$this->lang->line('Message suppression')." ". $row->phone."?</p>
</div>
<div class='modal-footer'>
<button type='button' class='btn btn-default pull-left' data-dismiss='modal'>".$this->lang->line('Fermer')."</button>
<a href='".$site_url."Listes_members/suppr/?recordId=".$row->phone."' role='button' class='btn btn-danger'>
".$this->lang->line('Supprimer')."</a>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
</td>
</tr>";
}
?>
<?php
} else {
echo "1 results";
}
?>
</tbody>
<tfoot>
<tr>
<th><?php echo $this->lang->line('Nom'); ?></th>
<th><?php echo $this->lang->line('Pays'); ?></th>
<th><?php echo $this->lang->line('Adresse'); ?></th>
<th><?php echo $this->lang->line('Reseau'); ?></th>
<th><?php echo $this->lang->line('Email'); ?></th>
<th><?php echo $this->lang->line('Solde'); ?></th>
<th><?php echo $this->lang->line('Téléphone'); ?></th>
<th><?php echo $this->lang->line('Modifier'); ?></th>
<th><?php echo $this->lang->line('Supprimer'); ?></th>
</tr>
</tfoot>
</table>
<?php
}else{
echo "Aucun utilisateur simple à afficher";
}
?>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- SlimScroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script>
$(function () {
$('#listeMembres').DataTable()
})
</script>
<script type='text/javascript'>
$(document).ready(function(){
$('#pays').change(function(){
var pays = $(this).val();
$.ajax({
url:'<?php echo base_url('index.php/Admin/getHypByPays')?>',
type: 'post',
data: {pays: pays},
dataType: 'json',
success: function(data){
var len = data.length;
if(len > 0){
var select = document.getElementById('hyper');
if(select===null){
var grpPays = document.getElementById('grp-pays');
$(grpPays).empty();
$(grpPays).append("<select class='form-control input-lg' name='hyper' required id='hyper'></select>");
select = document.getElementById('hyper');
}
$(select).empty();
for (var i in data) {
$(select).append('<option value=' + data[i].code_membre + '>' + data[i].lastname +'-' + data[i].network + ' ('+ data[i].code_membre +')</option>');
}
var code = data[0].code_membre;
$.ajax({
url:'<?php echo base_url('index.php/Admin/getVilleByHyp')?>',
type: 'post',
data: {code: code,pays:pays},
dataType: 'json',
success: function(list){
var len = list.length;
if(len > 0){
var select = document.getElementById('ville');
if(select===null){
var grpVille = document.getElementById('grp-ville');
$(grpVille).empty();
$(grpVille).append("<select class='form-control input-lg' name='ville' required id='ville'></select>");
select = document.getElementById('ville');
}
$(select).empty();
for (var i in list) {
$(select).append('<option value=' + list[i].town_id + '>' + list[i].town +'</option>');
}
}else{
var select = document.getElementById('ville');
$(select).empty();
}
}
});
}else{
var select = document.getElementById('hyper');
$(select).empty();
var select2 = document.getElementById('ville');
$(select2).empty();
}
}
});
});
$('#hyper').change(function(){
var code = $(this).val();
$.ajax({
url:'<?php echo base_url('index.php/Admin/getVilleByHyp')?>',
type: 'post',
data: {code: code},
dataType: 'json',
success: function(list){
var len = list.length;
if(len > 0){
var select = document.getElementById('ville');
$(select).empty();
for (var i in list) {
$(select).append('<option value=' + list[i].town_id + '>' + list[i].town +'</option>');
}
}else{
var select = document.getElementById('ville');
$(select).empty();
}
}
});
});
});
</script>
<!-- DataTables -->
<link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
<div class="content-wrapper">
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box">
<?php
if($alert=="ok") {
if(!$success=="ok"){
?>
<div class='alert alert-danger alert-dismissible'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Error!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Utilisateurs simples'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body" style="overflow-x:auto;">
<?php
$result=$list;
if($result!=false){
$numrows=$result->num_rows();
$num = 0;
if ($numrows > 0) {
?>
<table id="listeMembres" class="table table-bordered table-striped">
<thead>
<tr class="label-primary">
<th><?php echo $this->lang->line('Nom'); ?></th>
<th><?php echo $this->lang->line('Pays'); ?></th>
<th><?php echo $this->lang->line('Adresse'); ?></th>
<th><?php echo $this->lang->line('Reseau'); ?></th>
<th><?php echo $this->lang->line('Email'); ?></th>
<th><?php echo $this->lang->line('Solde'); ?></th>
<th><?php echo $this->lang->line('Téléphone'); ?></th>
<th><?php echo $this->lang->line('Modifier'); ?></th>
<th><?php echo $this->lang->line('Supprimer'); ?></th>
</tr>
</thead>
<tbody>
<?php
$site_url = base_url();
$url = base_url('index.php/Listes_members/modif');
// output data of each row
foreach($result->result() as $row) {
$num++;
echo "<tr>
<td>$row->lastname </td>
<td>$row->country</td>
<td>$row->adresse</td>
<td>$row->network</td>
<td>$row->email </td>
<td> $row->solde</td>
<td>$row->phone</td>
<td>
<a id='modal-497395".$num."' href='#modal-container-497395".$num."' class='btn btn-app' role='button' role='button' data-toggle='modal'><i class='fa fa-edit'></i>".$this->lang->line('Modifier')."</a>
<div class='modal fade' id='modal-container-497395".$num."' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-body'>
<h4 class='modal-title' id='myModalLabel'>".$this->lang->line('Mettre à jour des informations')."<hr class='colorgraph'></h4>
<form action='$url' id='form-horizontal' method='POST' >
<div class='control-group'>
<label class='control-label' for='inputEmail' >".$this->lang->line('Nom')."</label>
<div class='controls'>
<input id='nom' type='text' name='nom' class='form-control input-sm' value='$row->lastname'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail' >".$this->lang->line('Adresse')."</label>
<div class='controls'>
<input id='adresse' type='text' name='adresse' class='form-control input-sm' value='$row->adresse'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>".$this->lang->line('Reseau')."</label>
<div class='controls'>
<input id='inputEmail' type='text' name='reso' class='form-control input-sm' value='$row->network' readonly/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>".$this->lang->line('code membre')."</label>
<div class='controls'>
<input id='inputEmail' type='text' name='cmbre' class='form-control input-sm' value='$row->user_id' readonly>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail'>".$this->lang->line('Email')."</label>
<div class='controls'>
<input id='inputEmail' type='email' name='email' class='form-control input-sm' value='$row->email'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='inputEmail' >".$this->lang->line('Téléphone')."</label>
<div class='controls'>
<input id='inputEmail' type='text' name='tel' class='form-control input-sm' value='$row->phone' readonly/>
</div>
</div>
<hr class='colorgraph'>
<input name='modifbtn' type='Submit' class='btn btn-primary' value='Sauvegarder'/>
&nbsp;
<button type='button' class='btn btn-default' data-dismiss='modal'>
".$this->lang->line('Fermer')."
</button>
</form>
</div>
</div>
</div>
</div>
</td>
<td>
<a href='#myModal-1".$num."' role='button' class='btn btn-app btn-danger' data-toggle='modal'><i class='fa fa-remove'></i>".$this->lang->line('Supprimer')."</a>
<div class='modal fade' id='myModal-1".$num."' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal' aria-label='Close'>
<span aria-hidden='true'>&times;</span></button>
<h4 class='modal-title'>".$this->lang->line('Confirmer la suppression')."</h4>
</div>
<div class='modal-body'>
<p class='error-text'><i class='icon-warning-sign modal-icon'></i>".$this->lang->line('Message suppression')." ". $row->phone."?</p>
</div>
<div class='modal-footer'>
<button type='button' class='btn btn-default pull-left' data-dismiss='modal'>".$this->lang->line('Fermer')."</button>
<a href='".$site_url."Listes_members/suppr/?recordId=".$row->phone."' role='button' class='btn btn-danger'>
".$this->lang->line('Supprimer')."</a>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
</td>
</tr>";
}
?>
<?php
} else {
echo "1 results";
}
?>
</tbody>
<tfoot>
<tr>
<th><?php echo $this->lang->line('Nom'); ?></th>
<th><?php echo $this->lang->line('Pays'); ?></th>
<th><?php echo $this->lang->line('Adresse'); ?></th>
<th><?php echo $this->lang->line('Reseau'); ?></th>
<th><?php echo $this->lang->line('Email'); ?></th>
<th><?php echo $this->lang->line('Solde'); ?></th>
<th><?php echo $this->lang->line('Téléphone'); ?></th>
<th><?php echo $this->lang->line('Modifier'); ?></th>
<th><?php echo $this->lang->line('Supprimer'); ?></th>
</tr>
</tfoot>
</table>
<?php
}else{
echo "Aucun utilisateur simple à afficher";
}
?>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- SlimScroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script>
$(function () {
$('#listeMembres').DataTable()
})
</script>
<script type='text/javascript'>
$(document).ready(function(){
$('#pays').change(function(){
var pays = $(this).val();
$.ajax({
url:'<?php echo base_url('index.php/Admin/getHypByPays')?>',
type: 'post',
data: {pays: pays},
dataType: 'json',
success: function(data){
var len = data.length;
if(len > 0){
var select = document.getElementById('hyper');
if(select===null){
var grpPays = document.getElementById('grp-pays');
$(grpPays).empty();
$(grpPays).append("<select class='form-control input-lg' name='hyper' required id='hyper'></select>");
select = document.getElementById('hyper');
}
$(select).empty();
for (var i in data) {
$(select).append('<option value=' + data[i].code_membre + '>' + data[i].lastname +'-' + data[i].network + ' ('+ data[i].code_membre +')</option>');
}
var code = data[0].code_membre;
$.ajax({
url:'<?php echo base_url('index.php/Admin/getVilleByHyp')?>',
type: 'post',
data: {code: code,pays:pays},
dataType: 'json',
success: function(list){
var len = list.length;
if(len > 0){
var select = document.getElementById('ville');
if(select===null){
var grpVille = document.getElementById('grp-ville');
$(grpVille).empty();
$(grpVille).append("<select class='form-control input-lg' name='ville' required id='ville'></select>");
select = document.getElementById('ville');
}
$(select).empty();
for (var i in list) {
$(select).append('<option value=' + list[i].town_id + '>' + list[i].town +'</option>');
}
}else{
var select = document.getElementById('ville');
$(select).empty();
}
}
});
}else{
var select = document.getElementById('hyper');
$(select).empty();
var select2 = document.getElementById('ville');
$(select2).empty();
}
}
});
});
$('#hyper').change(function(){
var code = $(this).val();
$.ajax({
url:'<?php echo base_url('index.php/Admin/getVilleByHyp')?>',
type: 'post',
data: {code: code},
dataType: 'json',
success: function(list){
var len = list.length;
if(len > 0){
var select = document.getElementById('ville');
$(select).empty();
for (var i in list) {
$(select).append('<option value=' + list[i].town_id + '>' + list[i].town +'</option>');
}
}else{
var select = document.getElementById('ville');
$(select).empty();
}
}
});
});
});
</script>

View File

@ -250,7 +250,7 @@ function randomString1($length=10 )
<div class="row-fluid">
<div class="block span6">
<a href="#tablewidget" class="block-heading" data-toggle="collapse">Demandes<span class="label label-warning"><?php echo $this->db->count_all('demande_superviseur');?></span></a>
<div id="tablewidget" class="block-body collapse in">
<div id="tablewidget" class="block-body collapse in" style="overflow-x:auto;">
<?php
$sql2 = $this->db->get('demande_superviseur');
@ -402,7 +402,7 @@ else {
</div>
<div class="block span6">
<a href="#widget1container" class="block-heading" data-toggle="collapse">Codes' Table </a>
<div id="widget1container" class="block-body collapse in">
<div id="widget1container" class="block-body collapse in" style="overflow-x:auto;">
<?php
$sql1 = $this->db->query('SELECT * FROM codemembre');
@ -509,4 +509,4 @@ $this->db->close();
</script>
</body>
</html>
</html>

View File

@ -57,7 +57,7 @@
<h3 class="box-title"><?php echo $this->lang->line("Demandes adhésion"); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
$sql2 = $list_dem;
@ -160,7 +160,7 @@
<h3 class="box-title"><?php echo $this->lang->line("Codes valides"); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="box-body" style="overflow-x:auto;">
<?php
$sql1 = $list_codes;

View File

@ -307,7 +307,7 @@ function randomString1($length=10 )
<div class="row-fluid">
<div class="block span6">
<a href="#tablewidget" class="block-heading" data-toggle="collapse">Demandes<span class="label label-warning"><?php echo $this->db->count_all('demande_superviseur');?></span></a>
<div id="tablewidget" class="block-body collapse in">
<div id="tablewidget" class="block-body collapse in" style="overflow-x:auto;">
<?php
$sql2 = $this->db->get('demande_superviseur');
@ -456,7 +456,7 @@ else {
<div class="block span6">
<a href="#widget1container" class="block-heading" data-toggle="collapse">Codes' Table </a>
<div id="widget1container" class="block-body collapse in">
<div id="widget1container" class="block-body collapse in" style="overflow-x:auto;">
<?php
$sql1 = $this->db->query('SELECT * FROM codemembre');
@ -558,4 +558,4 @@ $this->db->close();
</script>
</body>
</html>
</html>

View File

@ -338,7 +338,7 @@ echo "You have selected :" .$selected_val; // Displaying Selected Value
<div class="container-fluid">
<div class="row-fluid">
<div class="row-fluid" style="overflow-x:auto;">
<?php
if($this->input->post('cherch'))
{
@ -540,4 +540,4 @@ $this->db->close();
</div>
</div>
</body>
</html>
</html>

View File

@ -1,79 +1,79 @@
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
<div class="content-wrapper">
<section class="content">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>demande_id</th>
<th>montant</th>
<th>statut</th>
<th>dateAjout</th>
<th>dateModif</th>
<th>reseau</th>
<th>codeParrain</th>
<th>codeMembre</th>
<th>category</th>
<th>temps</th>
<th>ville</th>
<th>pays</th>
</tr>
</thead>
<tfoot>
<tr>
<th>demande_id</th>
<th>montant</th>
<th>statut</th>
<th>dateAjout</th>
<th>dateModif</th>
<th>reseau</th>
<th>codeParrain</th>
<th>codeMembre</th>
<th>category</th>
<th>temps</th>
<th>ville</th>
<th>pays</th>
</tr>
</tfoot>
</table>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- SlimScroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script>
$(document).ready(function() {
$('#example').DataTable( {
"ajax": "<?php echo base_url('files/info_demandeCredits.json') ?>",
"columns": [
{ "data": "UserName" },
{ "data": "Type" },
{ "data": "Context" },
{ "data": "Password" },
{ "data": "Domain" },
{ "data": "server" }
]
} );
} );
</script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
<div class="content-wrapper">
<section class="content">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12" style="overflow-x:auto;">
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>demande_id</th>
<th>montant</th>
<th>statut</th>
<th>dateAjout</th>
<th>dateModif</th>
<th>reseau</th>
<th>codeParrain</th>
<th>codeMembre</th>
<th>category</th>
<th>temps</th>
<th>ville</th>
<th>pays</th>
</tr>
</thead>
<tfoot>
<tr>
<th>demande_id</th>
<th>montant</th>
<th>statut</th>
<th>dateAjout</th>
<th>dateModif</th>
<th>reseau</th>
<th>codeParrain</th>
<th>codeMembre</th>
<th>category</th>
<th>temps</th>
<th>ville</th>
<th>pays</th>
</tr>
</tfoot>
</table>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- SlimScroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script>
$(document).ready(function() {
$('#example').DataTable( {
"ajax": "<?php echo base_url('files/info_demandeCredits.json') ?>",
"columns": [
{ "data": "UserName" },
{ "data": "Type" },
{ "data": "Context" },
{ "data": "Password" },
{ "data": "Domain" },
{ "data": "server" }
]
} );
} );
</script>

View File

@ -9,8 +9,6 @@
<h1>
<?php echo $this->lang->line('header_wallet_password'); ?>
<input type="button" class="btn btn-primary pull-right" id="Bactiver"
value="Activer/Désactiver le(s) réseau(x)" style="display: none;"/>
</h1>
<?php
$site_url = base_url();

View File

@ -57,6 +57,7 @@
"jquery-sparkline": "^2.1.3",
"font-awesome": "^4.7.0",
"Ionicons": "ionicons#^2.0.1",
"jquery-ui": "1.11.4"
"jquery-ui": "1.11.4",
"toastr": "^2.1.3"
}
}

View File

@ -13,7 +13,8 @@
"require": {
"php": ">=5.4",
"spatie/async": "^1.4",
"nesbot/carbon": "^2.33"
"nesbot/carbon": "^2.33",
"brick/money": "^0.4.5"
},
"suggest": {
"paragonie/random_compat": "Provides better randomness in PHP 5.x"

166
dist/js/money.js vendored Normal file
View File

@ -0,0 +1,166 @@
/*!
* money.js / fx() v0.2
* Copyright 2014 Open Exchange Rates
*
* JavaScript library for realtime currency conversion and exchange rate calculation.
*
* Freely distributable under the MIT license.
* Portions of money.js are inspired by or borrowed from underscore.js
*
* For details, examples and documentation:
* http://openexchangerates.github.io/money.js/
*/
(function(root, undefined) {
// Create a safe reference to the money.js object for use below.
var fx = function(obj) {
return new fxWrapper(obj);
};
// Current version.
fx.version = '0.2';
/* --- Setup --- */
// fxSetup can be defined before loading money.js, to set the exchange rates and the base
// (and default from/to) currencies - or the rates can be loaded in later if needed.
var fxSetup = root.fxSetup || {
rates : {},
base : ""
};
// Object containing exchange rates relative to the fx.base currency, eg { "GBP" : "0.64" }
fx.rates = fxSetup.rates;
// Default exchange rate base currency (eg "USD"), which all the exchange rates are relative to
fx.base = fxSetup.base;
// Default from / to currencies for conversion via fx.convert():
fx.settings = {
from : fxSetup.from || fx.base,
to : fxSetup.to || fx.base
};
/* --- Conversion --- */
// The base function of the library: converts a value from one currency to another
var convert = fx.convert = function(val, opts) {
// Convert arrays recursively
if (typeof val === 'object' && val.length) {
for (var i = 0; i< val.length; i++ ) {
val[i] = convert(val[i], opts);
}
return val;
}
// Make sure we gots some opts
opts = opts || {};
// We need to know the `from` and `to` currencies
if( !opts.from ) opts.from = fx.settings.from;
if( !opts.to ) opts.to = fx.settings.to;
// Multiple the value by the exchange rate
return val * getRate( opts.to, opts.from );
};
// Returns the exchange rate to `target` currency from `base` currency
var getRate = function(to, from) {
// Save bytes in minified version
var rates = fx.rates;
// Make sure the base rate is in the rates object:
rates[fx.base] = 1;
// Throw an error if either rate isn't in the rates array
if ( !rates[to] || !rates[from] ) throw "fx error";
// If `from` currency === fx.base, return the basic exchange rate for the `to` currency
if ( from === fx.base ) {
return rates[to];
}
// If `to` currency === fx.base, return the basic inverse rate of the `from` currency
if ( to === fx.base ) {
return 1 / rates[from];
}
// Otherwise, return the `to` rate multipled by the inverse of the `from` rate to get the
// relative exchange rate between the two currencies
return rates[to] * (1 / rates[from]);
};
/* --- OOP wrapper and chaining --- */
// If fx(val) is called as a function, it returns a wrapped object that can be used OO-style
var fxWrapper = function(val) {
// Experimental: parse strings to pull out currency code and value:
if ( typeof val === "string" ) {
this._v = parseFloat(val.replace(/[^0-9-.]/g, ""));
this._fx = val.replace(/([^A-Za-z])/g, "");
} else {
this._v = val;
}
};
// Expose `wrapper.prototype` as `fx.prototype`
var fxProto = fx.prototype = fxWrapper.prototype;
// fx(val).convert(opts) does the same thing as fx.convert(val, opts)
fxProto.convert = function() {
var args = Array.prototype.slice.call(arguments);
args.unshift(this._v);
return convert.apply(fx, args);
};
// fx(val).from(currency) returns a wrapped `fx` where the value has been converted from
// `currency` to the `fx.base` currency. Should be followed by `.to(otherCurrency)`
fxProto.from = function(currency) {
var wrapped = fx(convert(this._v, {from: currency, to: fx.base}));
wrapped._fx = fx.base;
return wrapped;
};
// fx(val).to(currency) returns the value, converted from `fx.base` to `currency`
fxProto.to = function(currency) {
return convert(this._v, {from: this._fx ? this._fx : fx.settings.from, to: currency});
};
/* --- Module Definition --- */
// Export the fx object for CommonJS. If being loaded as an AMD module, define it as such.
// Otherwise, just add `fx` to the global object
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = fx;
}
exports.fx = fx;
} else if (typeof define === 'function' && define.amd) {
// Return the library as an AMD module:
define([], function() {
return fx;
});
} else {
// Use fx.noConflict to restore `fx` back to its original value before money.js loaded.
// Returns a reference to the library's `fx` object; e.g. `var money = fx.noConflict();`
fx.noConflict = (function(previousFx) {
return function() {
// Reset the value of the root's `fx` variable:
root.fx = previousFx;
// Delete the noConflict function:
fx.noConflict = undefined;
// Return reference to the library to re-assign it:
return fx;
};
})(root.fx);
// Declare `fx` on the root (global/window) object:
root['fx'] = fx;
}
// Root will be `window` in browser or `global` on the server:
}(this));