2020-06-05 16:53:04 +00:00
|
|
|
|
<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
|
2020-06-10 14:20:30 +00:00
|
|
|
|
|
2020-06-05 16:53:04 +00:00
|
|
|
|
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;
|
2020-06-10 14:20:30 +00:00
|
|
|
|
|
2020-06-05 16:53:04 +00:00
|
|
|
|
extract($_POST);
|
|
|
|
|
|
|
|
|
|
$showResult = false;
|
|
|
|
|
$frais = 0;
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$taxe = 0;
|
2020-06-05 16:53:04 +00:00
|
|
|
|
$config = $hasWallet->first_row();
|
2020-06-13 14:47:09 +00:00
|
|
|
|
|
2020-06-09 15:06:44 +00:00
|
|
|
|
$plr_user_wallet_wallet = $plr_user_wallet_wallet ? $plr_user_wallet_wallet->result() : [];
|
|
|
|
|
$plr_user_wallet_cash = $plr_user_wallet_cash ? $plr_user_wallet_cash->result() : [];
|
2020-06-13 14:47:09 +00:00
|
|
|
|
$plr_agent_depot_wallet_ilink = $plr_agent_depot_wallet_ilink ? $plr_agent_depot_wallet_ilink->result() : [];
|
|
|
|
|
$plr_agent_depot_autre_wallet = $plr_agent_depot_autre_wallet ? $plr_agent_depot_autre_wallet->result() : [];
|
2020-06-09 15:06:44 +00:00
|
|
|
|
$plr_agent_cash_cash = $plr_agent_cash_cash ? $plr_agent_cash_cash->result() : [];
|
2020-06-13 14:47:09 +00:00
|
|
|
|
|
|
|
|
|
$plr_user_wallet_wallet_national = $plr_user_wallet_wallet_national ? $plr_user_wallet_wallet_national->result() : [];
|
|
|
|
|
$plr_user_wallet_cash_national = $plr_user_wallet_cash_national ? $plr_user_wallet_cash_national->result() : [];
|
|
|
|
|
$plr_agent_depot_wallet_ilink_national = $plr_agent_depot_wallet_ilink_national ? $plr_agent_depot_wallet_ilink_national->result() : [];
|
|
|
|
|
$plr_agent_depot_autre_wallet_national = $plr_agent_depot_autre_wallet_national ? $plr_agent_depot_autre_wallet_national->result() : [];
|
|
|
|
|
$plr_agent_cash_cash_national = $plr_agent_cash_cash_national ? $plr_agent_cash_cash_national->result() : [];
|
|
|
|
|
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$taxes = $taxes ? $taxes->result() : [];
|
|
|
|
|
$taxesNationales = array_filter($taxes, function ($tax) {
|
|
|
|
|
return $tax->destination == 'national';
|
|
|
|
|
});
|
2020-06-09 15:06:44 +00:00
|
|
|
|
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$taxesInternationales = array_filter($taxes, function ($tax) {
|
|
|
|
|
return $tax->destination == 'international';
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (isset($save)) {
|
2020-06-05 16:53:04 +00:00
|
|
|
|
$showResult = true;
|
2020-06-10 14:20:30 +00:00
|
|
|
|
switch ($operation) {
|
|
|
|
|
case 1: //Envoi wallet à wallet
|
2020-06-13 14:47:09 +00:00
|
|
|
|
$frais = ($init_country != $final_country) ? calculateFees1($plr_user_wallet_wallet, $montant) : calculateFees1($plr_user_wallet_wallet_national, $montant);
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$taxe = ($init_country != $final_country) ? calculateTax($taxesInternationales , $frais) : calculateTax($taxesNationales ,$frais);
|
|
|
|
|
break;
|
|
|
|
|
case 2: //Envoi de wallet à carte
|
|
|
|
|
$frais = $montant * $config->taux_com_user_wallet_carte / 100;
|
2020-06-13 14:47:09 +00:00
|
|
|
|
// $taxe = ($init_country != $final_country) ? calculateTax($taxesInternationales , $frais) : calculateTax($taxesNationales ,$frais);
|
2020-06-10 14:20:30 +00:00
|
|
|
|
break;
|
|
|
|
|
case 3: //Envoi de wallet à cash
|
2020-06-13 14:47:09 +00:00
|
|
|
|
$frais = ($init_country != $final_country) ? calculateFees1($plr_user_wallet_cash, $montant) : calculateFees1($plr_user_wallet_cash_national, $montant);
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$taxe = ($init_country != $final_country) ? calculateTax($taxesInternationales , $frais) : calculateTax($taxesNationales ,$frais);
|
|
|
|
|
break;
|
|
|
|
|
case 4: //Envoi de wallet à banque
|
|
|
|
|
// Non disponible
|
2020-06-13 14:47:09 +00:00
|
|
|
|
//Pas de taxes
|
2020-06-10 14:20:30 +00:00
|
|
|
|
break;
|
2020-06-13 14:47:09 +00:00
|
|
|
|
// case 5: //Envoi de carte à wallet
|
|
|
|
|
// $frais =$montant * $config->taux_com_user_carte_wallet / 100;
|
|
|
|
|
//// $taxe = ($init_country != $final_country) ? calculateTax($taxesInternationales , $frais) : calculateTax($taxesNationales ,$frais);
|
|
|
|
|
// break;
|
|
|
|
|
// case 6: //Envoi de carte à cash
|
|
|
|
|
// $frais =$montant * $config->taux_com_user_carte_cash / 100;
|
|
|
|
|
//// $taxe = ($init_country != $final_country) ? calculateTax($taxesInternationales , $frais) : calculateTax($taxesNationales ,$frais);
|
|
|
|
|
// break;
|
2020-06-10 14:20:30 +00:00
|
|
|
|
case 9: // Retrait de wallet en cash
|
2020-06-13 14:47:09 +00:00
|
|
|
|
$frais = ($init_country != $final_country) ? calculateFees1($plr_user_wallet_cash, $montant) : calculateFees1($plr_user_wallet_cash_national, $montant);
|
|
|
|
|
$taxe = ($init_country != $final_country) ? calculateTax($taxesInternationales , $frais) : calculateTax($taxesNationales ,$frais);
|
2020-06-10 14:20:30 +00:00
|
|
|
|
break;
|
|
|
|
|
case 10: //Retrait de carte vers wallet
|
|
|
|
|
$frais = $montant * $config->taux_com_user_carte_wallet / 100;
|
|
|
|
|
break;
|
|
|
|
|
case 11: // Retrait de wallet en cash
|
|
|
|
|
$frais = $montant * $config->taux_com_user_carte_cash / 100;
|
|
|
|
|
break;
|
2020-06-13 14:47:09 +00:00
|
|
|
|
case 12: // Agent - Retrait en cash
|
|
|
|
|
// empty
|
|
|
|
|
break;
|
|
|
|
|
case 13: // Agent - Retrait de la carte vers cash
|
|
|
|
|
$frais = $montant * $config->taux_com_wallet_ag_carte_cash / 100;
|
|
|
|
|
break;
|
|
|
|
|
case 14: // Agent - Envoi de cash vers wallet iLink
|
|
|
|
|
$frais = ($init_country != $final_country) ? calculateFees1($plr_agent_depot_wallet_ilink, $montant) : calculateFees1($plr_agent_depot_wallet_ilink_national, $montant);
|
|
|
|
|
$taxe = ($init_country != $final_country) ? calculateTax($taxesInternationales , $frais) : calculateTax($taxesNationales ,$frais);
|
|
|
|
|
break;
|
|
|
|
|
case 15: // Agent - Envoi de cash vers autre wallet
|
|
|
|
|
$frais = ($init_country != $final_country) ? calculateFees1($plr_agent_depot_autre_wallet, $montant) : calculateFees1($plr_agent_depot_autre_wallet_national, $montant);
|
|
|
|
|
$taxe = ($init_country != $final_country) ? calculateTax($taxesInternationales , $frais) : calculateTax($taxesNationales ,$frais);
|
|
|
|
|
break;
|
|
|
|
|
case 16: // Agent - Envoi de cash vers une carte visa
|
|
|
|
|
$frais = $montant * $config->taux_com_wallet_ag_envoi_cash_carte / 100;
|
|
|
|
|
break;
|
|
|
|
|
case 17: // Agent - Envoi de cash vers cash
|
|
|
|
|
$frais = ($init_country != $final_country) ? calculateFees1($plr_agent_cash_cash, $montant) : calculateFees1($plr_agent_cash_cash_national, $montant);
|
|
|
|
|
$taxe = ($init_country != $final_country) ? calculateTax($taxesInternationales , $frais) : calculateTax($taxesNationales ,$frais);
|
|
|
|
|
break;
|
|
|
|
|
case 18: // Agent - Envoi de cash vers banque
|
|
|
|
|
// Indisponible
|
|
|
|
|
break;
|
2020-06-05 16:53:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-10 14:20:30 +00:00
|
|
|
|
//Calcul des frais internationaux
|
|
|
|
|
function calculateFees1(array $paliers, $montant)
|
|
|
|
|
{
|
2020-06-05 16:53:04 +00:00
|
|
|
|
$size = sizeof($paliers);
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$min = $paliers[0]->min;
|
|
|
|
|
$max = $size > 0 ? $paliers[$size - 1]->max : 0;
|
2020-06-05 16:53:04 +00:00
|
|
|
|
$palier = null;
|
2020-06-10 14:20:30 +00:00
|
|
|
|
foreach ($paliers as $p) {
|
|
|
|
|
if ($montant >= $p->min && $montant <= $p->max) {
|
2020-06-05 16:53:04 +00:00
|
|
|
|
$palier = $p;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-10 14:20:30 +00:00
|
|
|
|
if ($palier) {
|
|
|
|
|
return (($palier->min + $palier->max) / 2 * $palier->taux / 100);
|
|
|
|
|
} else {
|
|
|
|
|
if ($montant < $min)
|
|
|
|
|
return $min * $paliers[0]->taux / 100;
|
2020-06-05 16:53:04 +00:00
|
|
|
|
else if ($montant > $max)
|
2020-06-10 14:20:30 +00:00
|
|
|
|
return $max * $paliers[$size - 1]->taux / 100;
|
2020-06-05 16:53:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-10 14:20:30 +00:00
|
|
|
|
//Calcul des frais nationaux
|
|
|
|
|
function calculateFees2($min, $max, $taux, $montant)
|
|
|
|
|
{
|
|
|
|
|
if ($montant < $min)
|
|
|
|
|
return $min * $taux / 100;
|
2020-06-05 16:53:04 +00:00
|
|
|
|
else if ($montant > $max)
|
2020-06-10 14:20:30 +00:00
|
|
|
|
return $max * $taux / 100;
|
2020-06-05 16:53:04 +00:00
|
|
|
|
else
|
2020-06-10 14:20:30 +00:00
|
|
|
|
return $montant * $taux / 100;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Calcul des taxes
|
|
|
|
|
function calculateTax(array $taxes, $frais)
|
|
|
|
|
{
|
|
|
|
|
$sommeTaux = 0;
|
|
|
|
|
$sommeFixe = 0;
|
|
|
|
|
foreach ($taxes as $tax) {
|
|
|
|
|
if ($tax->type == '%')
|
|
|
|
|
$sommeTaux += $tax->valeur;
|
|
|
|
|
|
|
|
|
|
if ($tax->type == 'fixe')
|
|
|
|
|
$sommeFixe += $tax->valeur;
|
|
|
|
|
}
|
|
|
|
|
return ($frais * $sommeTaux / 100) + $sommeFixe;
|
2020-06-05 16:53:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// set to whatever your rates are relative to
|
|
|
|
|
$baseCurrency = 'USD';
|
|
|
|
|
|
|
|
|
|
// use your own credentials, or re-use your existing PDO connection
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$pdo = new PDO('mysql:host=' . $this->db->hostname . ';dbname=' . $this->db->database, $this->db->username, $this->db->password);
|
2020-06-05 16:53:04 +00:00
|
|
|
|
|
|
|
|
|
$configuration = new PDOProviderConfiguration();
|
|
|
|
|
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$configuration->tableName = 'exchange_rate';
|
|
|
|
|
$configuration->exchangeRateColumnName = 'exchange_rate';
|
2020-06-05 16:53:04 +00:00
|
|
|
|
$configuration->targetCurrencyColumnName = 'target_currency';
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$configuration->sourceCurrencyCode = $baseCurrency;
|
2020-06-05 16:53:04 +00:00
|
|
|
|
|
|
|
|
|
// 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">×</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">
|
2020-06-10 14:20:30 +00:00
|
|
|
|
<label for="montant"> <?php echo $this->lang->line('Montant') ?></label>
|
2020-06-05 16:53:04 +00:00
|
|
|
|
<input type="text" required class="form-control" id="montant"
|
2020-06-10 14:20:30 +00:00
|
|
|
|
name="montant" value="<?php echo @$montant; ?>">
|
2020-06-05 16:53:04 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="col-lg-3">
|
|
|
|
|
<?php
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$result = $countries;
|
|
|
|
|
if ($result) {
|
|
|
|
|
$numrows = $result->num_rows();
|
2020-06-05 16:53:04 +00:00
|
|
|
|
|
|
|
|
|
if ($numrows > 0) { ?>
|
|
|
|
|
<label for="init_country"><?php echo $this->lang->line('departure_country') ?></label>
|
2020-06-10 14:20:30 +00:00
|
|
|
|
<select class="form-control" name="init_country" id="init_country"
|
|
|
|
|
required>
|
|
|
|
|
<?php foreach ($result->result() as $row) {
|
2020-06-05 16:53:04 +00:00
|
|
|
|
|
2020-06-10 14:20:30 +00:00
|
|
|
|
echo "<option value='" . $row->id . "'>" . $row->name . "</option>";
|
2020-06-05 16:53:04 +00:00
|
|
|
|
} ?>
|
|
|
|
|
</select>
|
2020-06-10 14:20:30 +00:00
|
|
|
|
<?php } else {
|
2020-06-05 16:53:04 +00:00
|
|
|
|
echo $this->lang->line('no_country');
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<?php } else {
|
|
|
|
|
echo $this->lang->line('no_country');
|
|
|
|
|
} ?>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-lg-3">
|
|
|
|
|
<?php
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$result = $operations;
|
|
|
|
|
if ($result) {
|
|
|
|
|
$numrows = sizeof($result);
|
2020-06-05 16:53:04 +00:00
|
|
|
|
if ($numrows > 0) { ?>
|
|
|
|
|
<label for="operation">Operation</label>
|
2020-06-10 14:20:30 +00:00
|
|
|
|
<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>";
|
2020-06-05 16:53:04 +00:00
|
|
|
|
} ?>
|
|
|
|
|
</select>
|
2020-06-10 14:20:30 +00:00
|
|
|
|
<?php } else {
|
2020-06-05 16:53:04 +00:00
|
|
|
|
echo $this->lang->line('no_operation');
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<?php } else {
|
|
|
|
|
echo $this->lang->line('no_operation');
|
|
|
|
|
} ?>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-lg-3">
|
|
|
|
|
<?php
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$result = $countries;
|
|
|
|
|
if ($result) {
|
|
|
|
|
$numrows = $result->num_rows();
|
2020-06-05 16:53:04 +00:00
|
|
|
|
|
|
|
|
|
if ($numrows > 0) { ?>
|
|
|
|
|
<label for="final_country"><?php echo $this->lang->line('country_of_destination') ?></label>
|
2020-06-10 14:20:30 +00:00
|
|
|
|
<select class="form-control" name="final_country" id="final_country"
|
|
|
|
|
required>
|
|
|
|
|
<?php foreach ($result->result() as $row) {
|
2020-06-05 16:53:04 +00:00
|
|
|
|
|
2020-06-10 14:20:30 +00:00
|
|
|
|
echo "<option value='" . $row->id . "'>" . $row->name . "</option>";
|
2020-06-05 16:53:04 +00:00
|
|
|
|
} ?>
|
|
|
|
|
</select>
|
2020-06-10 14:20:30 +00:00
|
|
|
|
<?php } else {
|
2020-06-05 16:53:04 +00:00
|
|
|
|
echo $this->lang->line('no_country');
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<?php } else {
|
|
|
|
|
echo $this->lang->line('no_country');
|
|
|
|
|
} ?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-06-10 14:20:30 +00:00
|
|
|
|
<?php if ($showResult) {
|
|
|
|
|
$r1 = array_filter($operations, function ($op) use ($operation) {
|
2020-06-05 16:53:04 +00:00
|
|
|
|
return $op->id == $operation;
|
|
|
|
|
});
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$r2 = array_filter($countries->result(), function ($c) use ($init_country) {
|
2020-06-05 16:53:04 +00:00
|
|
|
|
return $c->id == $init_country;
|
|
|
|
|
});
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$r3 = array_filter($countries->result(), function ($c) use ($final_country) {
|
2020-06-05 16:53:04 +00:00
|
|
|
|
return $c->id == $final_country;
|
|
|
|
|
});
|
|
|
|
|
$op = reset($r1);
|
|
|
|
|
$d = reset($r2);
|
|
|
|
|
$f = reset($r3);
|
|
|
|
|
?>
|
|
|
|
|
<div class="login-box" style="width: 600px;">
|
2020-06-10 14:20:30 +00:00
|
|
|
|
<h5><strong style="text-decoration: underline;">Resultat</strong>
|
|
|
|
|
: <?= @$op->name . ' du ' . $d->name . ' vers ' . $f->name ?></h5>
|
2020-06-05 16:53:04 +00:00
|
|
|
|
<div class="login-box-body">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<?php
|
|
|
|
|
$money = Money::of(@$montant, @$d->currency_code);
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$money2 = Money::of(round(@$montant - @$frais - @$taxe, 0), @$d->currency_code);
|
|
|
|
|
$money3 = Money::of(round(@$montant - @$frais - @$taxe, 0), @$d->currency_code);
|
|
|
|
|
$moneyTaxe = Money::of(round(@$taxe, 0), @$d->currency_code);
|
2020-06-05 16:53:04 +00:00
|
|
|
|
$money2 = $converter->convert($money2, @$f->currency_code, RoundingMode::DOWN);
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$money3 = $converter->convert($money3, @$d->currency_code, RoundingMode::DOWN);
|
|
|
|
|
$moneyFrais = Money::of(round(@$frais, 0), @$d->currency_code);
|
2020-06-13 14:47:09 +00:00
|
|
|
|
$moneyTotalTaxe = Money::of(round(@$frais + @$taxe, 0), @$d->currency_code);
|
2020-06-05 16:53:04 +00:00
|
|
|
|
?>
|
|
|
|
|
<div class="col-lg-6 col-md-6">
|
2020-06-10 14:20:30 +00:00
|
|
|
|
<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>
|
|
|
|
|
<label>Taxe de la transaction </label>
|
|
|
|
|
<h4><?= $moneyTaxe->formatTo('fr-FR') ?></h4>
|
|
|
|
|
</div>
|
2020-06-13 14:47:09 +00:00
|
|
|
|
<div>
|
|
|
|
|
<label>Total frais + taxe de la transaction </label>
|
|
|
|
|
<h4><?= $moneyTotalTaxe->formatTo('fr-FR') ?></h4>
|
|
|
|
|
</div>
|
2020-06-05 16:53:04 +00:00
|
|
|
|
</div>
|
2020-06-10 14:20:30 +00:00
|
|
|
|
<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>
|
|
|
|
|
<h4><?= $money3->formatTo('fr_FR') ?></h4>
|
|
|
|
|
</div>
|
2020-06-05 16:53:04 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-06-10 14:20:30 +00:00
|
|
|
|
<?php } ?>
|
2020-06-05 16:53:04 +00:00
|
|
|
|
<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 () {
|
2020-06-10 14:20:30 +00:00
|
|
|
|
anElement = new AutoNumeric('#montant', '', {
|
|
|
|
|
digitGroupSeparator: ' ',
|
|
|
|
|
decimalPlaces: '0',
|
|
|
|
|
minimumValue: '0',
|
|
|
|
|
maximumValue: '99999999999999999999999999'
|
|
|
|
|
});
|
2020-06-05 16:53:04 +00:00
|
|
|
|
|
2020-06-10 14:20:30 +00:00
|
|
|
|
$("#calculatorForm").submit(function (eventObj) {
|
2020-06-05 16:53:04 +00:00
|
|
|
|
var txt = document.getElementById('montant');
|
|
|
|
|
const montant = anElement.getNumber();
|
|
|
|
|
txt.value = montant;
|
|
|
|
|
return true;
|
|
|
|
|
});
|
|
|
|
|
//onLoad="document.getElementById('leave').options[0].selected = 'selected';"
|
|
|
|
|
})
|
|
|
|
|
</script>
|