+ Simulator finished
This commit is contained in:
parent
987ee7015a
commit
df12737861
|
@ -734,7 +734,7 @@ class Hyperviseur_dash extends CI_Controller
|
|||
// $this->session->set_userdata('frais_retrait',$frais);
|
||||
$code = $this->random_string();
|
||||
$data['message_code'] = ''.$code;
|
||||
$this->user_model->insertSimulateur($frais,$montant-$frais-$taxe,$code);
|
||||
$this->user_model->insertSimulateur($frais,$montant-$frais-$taxe,$code,$montant);
|
||||
break;
|
||||
case 4: //Envoi de wallet à banque
|
||||
// Non disponible
|
||||
|
@ -756,7 +756,7 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$this->session->set_userdata('com_hyp',$com_hyp);
|
||||
$code = $this->random_string();
|
||||
$data['message_code'] = ''.$code;
|
||||
$this->user_model->insertSimulateur($frais,$montant-$frais-$taxe,$code);
|
||||
$this->user_model->insertSimulateur($frais,$montant-$frais-$taxe,$code,$montant);
|
||||
break;
|
||||
case 10: //Retrait de carte vers wallet
|
||||
$frais = $montant * $config->taux_com_user_carte_wallet / 100;
|
||||
|
@ -773,7 +773,7 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$this->session->set_userdata('com_hyp',$com_hyp);$this->session->set_userdata('com_bq',$com_bq);
|
||||
$code = $this->random_string();
|
||||
$data['message_code'] = ''.$code;
|
||||
$this->user_model->insertSimulateur($frais * $config->taux_com_hyp_retrait_carte_cash / 100,$montant-$frais-$taxe,$code);
|
||||
$this->user_model->insertSimulateur($frais * $config->taux_com_hyp_retrait_carte_cash_ilink / 100,$montant-$frais-$taxe,$code,$montant);
|
||||
break;
|
||||
case 12: // Agent - Retrait en cash
|
||||
// empty
|
||||
|
@ -786,13 +786,19 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$com_ag += $part_ag;
|
||||
$com_sup += $part_sup ;
|
||||
$com_hyp -= ($part_ag + $part_sup);
|
||||
$data['montant_retrait'] = $simulateur->first_row()->montant_retrait;
|
||||
$data['frais_retrait'] = $simulateur->first_row()->com_hyp;
|
||||
$data['montant_init'] = $simulateur->first_row()->montant;
|
||||
$this->session->set_userdata('com_ag',$com_ag);$this->session->set_userdata('com_sup',$com_sup);
|
||||
$this->session->set_userdata('com_hyp',$com_hyp);
|
||||
}else{
|
||||
$data['error_simulateur'] = 'Code de retrait incorrect';
|
||||
}
|
||||
}else{
|
||||
$data['error_simulateur'] = 'Code de retrait incorrect';
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case 13: // Agent - Retrait de la carte vers cash
|
||||
$frais = $montant * $config->taux_com_wallet_ag_carte_cash / 100;
|
||||
|
@ -841,7 +847,7 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$this->session->set_userdata('com_hyp',$com_hyp);
|
||||
$code = $this->random_string();
|
||||
$data['message_code'] = ''.$code;
|
||||
$this->user_model->insertSimulateur($frais,$montant-$frais-$taxe,$code);
|
||||
$this->user_model->insertSimulateur($frais,$montant-$frais-$taxe,$code,$montant);
|
||||
break;
|
||||
case 18: // Agent - Envoi de cash vers banque
|
||||
// Indisponible
|
||||
|
@ -857,6 +863,8 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$data['operation'] = $operation;
|
||||
$data['init_country'] = $init_country;
|
||||
$data['final_country'] = $final_country;
|
||||
$data['montant'] = $montant;
|
||||
|
||||
|
||||
$data['com_ag'] = $com_ag;
|
||||
$data['com_sup'] = $com_sup;
|
||||
|
@ -887,7 +895,7 @@ class Hyperviseur_dash extends CI_Controller
|
|||
// 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');
|
||||
|
@ -947,8 +955,8 @@ class Hyperviseur_dash extends CI_Controller
|
|||
public function random_string()
|
||||
{
|
||||
$character_set_array = array();
|
||||
$character_set_array[] = array('count' => 7, 'characters' => 'abcdefghjkmnpqrstuvwxyz');
|
||||
$character_set_array[] = array('count' => 1, 'characters' => '23456789');
|
||||
$character_set_array[] = array('count' => 12, 'characters' => 'abcdefghjkmnpqrstuvwxyz');
|
||||
$character_set_array[] = array('count' => 4, 'characters' => '23456789');
|
||||
$temp_array = array();
|
||||
foreach ($character_set_array as $character_set) {
|
||||
for ($i = 0; $i < $character_set['count']; $i++) {
|
||||
|
|
|
@ -336,6 +336,8 @@ $lang ['rate_com_hyp_remove_cart'] = 'Hypervisor commission rate on card withdra
|
|||
$lang ['rate_com_bq_remove_cart'] = 'Bank commission rate on card withdrawal operation';
|
||||
$lang ['rate_com_agent_cart_cash'] = 'Geolocated agent commission rate on cash card withdrawal';
|
||||
$lang ['rate_com_agent_cash_cart'] = 'Commission rate of the geolocated agent on cash deposit to card';
|
||||
$lang ['rate_com_hyp_remove_cart_ilink'] = 'Hypervisor commission rate on card withdrawal operation for iLink user';
|
||||
$lang ['rate_com_bq_remove_cart_ilink'] = 'Bank commission rate on card withdrawal operation for iLink user';
|
||||
|
||||
// Currency management
|
||||
$lang ['currency'] = 'Currency';
|
||||
|
@ -380,6 +382,10 @@ $lang ['op15'] = 'Agent - Sending cash to another wallet';
|
|||
$lang ['op16'] = 'Agent - Sending cash to a visa card';
|
||||
$lang ['op17'] = 'Agent - Sending cash to cash';
|
||||
$lang ['op18'] = 'Agent - Sending cash to bank';
|
||||
$lang ['new_tax'] = 'New tax'
|
||||
|
||||
$lang ['new_tax'] = 'New tax';
|
||||
$lang['ilink_first_rule'] = 'The sum of commission splits on sending money must be equal to 100%';
|
||||
$lang['ilink_second_rule'] = 'The sum of the commission distributions on the withdrawal operation must be equal to 100%';
|
||||
$lang['ilink_third_rule'] = 'The sum of the distribution of commission on cash deposit to card operation must be equal to 100%';
|
||||
$lang['ilink_fourth_rule'] = 'The sum of the distribution of commission on withdrawal operation in the card must be equal to 100%';
|
||||
$lang['ilink_fifth_rule'] = 'The sum of the distribution of commission on withdrawal operation in the card for iLink user must be equal to 100%';
|
||||
?>
|
||||
|
|
|
@ -348,8 +348,8 @@
|
|||
$lang['rate_com_bq_remove_cart'] = 'Taux de commission de la banque sur operation de retrait dans carte ';
|
||||
$lang['rate_com_agent_cart_cash'] = 'Taux de commission de l\'agent géolocalisé sur retrait carte à cash ';
|
||||
$lang['rate_com_agent_cash_cart'] = 'Taux de commission de l\'agent géolocalisé sur depot cash vers carte ';
|
||||
$lang['rate_com_hyp_remove_cart_ilink'] = 'Taux de commission hyperviseur sur operation de retrait dans carte pour utilisateur ';
|
||||
$lang['rate_com_bq_remove_cart_ilink'] = 'Taux de commission hyperviseur sur operation de retrait dans carte ';
|
||||
$lang['rate_com_hyp_remove_cart_ilink'] = 'Taux de commission hyperviseur sur operation de retrait dans carte pour utilisateur iLink ';
|
||||
$lang['rate_com_bq_remove_cart_ilink'] = 'Taux de commission banque sur operation de retrait dans carte pour utilisateur iLink ';
|
||||
|
||||
// Gestion de la monnaie
|
||||
$lang['currency'] = 'Monnaie';
|
||||
|
|
|
@ -2395,9 +2395,9 @@ class User_model extends CI_Model
|
|||
}
|
||||
}
|
||||
|
||||
public function insertSimulateur($frais , $montant ,$code){
|
||||
$sql = "INSERT INTO `simulateur` (`com_hyp` , `montant_retrait`, `code`) VALUES ( ?, ?, ?);";
|
||||
$query = $this->db->query($sql , array($frais,$montant,$code));
|
||||
public function insertSimulateur($frais , $montant ,$code , $montant_init){
|
||||
$sql = "INSERT INTO `simulateur` (`com_hyp` , `montant_retrait`, `code` ,`montant` ) VALUES ( ?, ?, ? , ?);";
|
||||
$query = $this->db->query($sql , array($frais,$montant,$code,$montant_init));
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
|
|
@ -378,7 +378,7 @@ $converter = new CurrencyConverter($provider);
|
|||
$f = reset($r3);
|
||||
?>
|
||||
<div class="login-box" style="width: 600px;">
|
||||
<h5><strong style="text-decoration: underline;">Resultat</strong>
|
||||
<h5 id="result" data-operation="<?=$op->id?>"><strong style="text-decoration: underline;">Resultat</strong>
|
||||
: <?= @$op->name . ' du ' . $d->name . ' vers ' . $f->name ?></h5>
|
||||
<div class="login-box-body">
|
||||
<div class="row">
|
||||
|
@ -426,7 +426,8 @@ $converter = new CurrencyConverter($provider);
|
|||
<h5><strong style="text-decoration: underline;">Simulateur</strong></h5>
|
||||
<div class="login-box-body">
|
||||
<div class="row" style="margin-bottom: 10px">
|
||||
<div class="col-lg-6">
|
||||
<div class="row">
|
||||
<div class="col-lg-6" id="codePanel">
|
||||
<label for="code">Code de retrait</label>
|
||||
<input type="text" class="form-control" id="code"
|
||||
name="code" value="">
|
||||
|
@ -443,6 +444,28 @@ $converter = new CurrencyConverter($provider);
|
|||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if(isset($montant_retrait)) {
|
||||
$currency = @$d->currency_code ? @$d->currency_code : 'XAF';
|
||||
$moneyMontantRetrait = Money::of(round(@$montant_retrait, 0),$currency);
|
||||
$moneyInit = Money::of(round(@$montant_init, 0),$currency);
|
||||
$moneyFraisRetrait = Money::of(round(@$frais_retrait, 0),$currency);
|
||||
?>
|
||||
<div class="row" style="margin-top: 15px">
|
||||
<div class="col-lg-4">
|
||||
<label for="code">Montant de la transaction</label>
|
||||
<h4> <?= $moneyInit->formatTo('fr_FR')?></h4>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<label for="code">Montant de retrait</label>
|
||||
<h4><?= $moneyMontantRetrait->formatTo('fr_FR')?></h4>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<label for="code">Frais</label>
|
||||
<h4><?= $moneyFraisRetrait->formatTo('fr_FR')?></h4>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="row">
|
||||
<?php
|
||||
$currency = @$d->currency_code ? @$d->currency_code : 'XAF';
|
||||
|
@ -529,5 +552,20 @@ $converter = new CurrencyConverter($provider);
|
|||
return true;
|
||||
});
|
||||
//onLoad="document.getElementById('leave').options[0].selected = 'selected';"
|
||||
var idOp = parseInt($('#result').data('operation'));
|
||||
if(idOp == 12){
|
||||
$('#codePanel').show();
|
||||
}else{
|
||||
$('#codePanel').hide();
|
||||
}
|
||||
|
||||
$('#operation').change(function(){
|
||||
if($(this).val() == 12){
|
||||
$('#codePanel').show();
|
||||
}else{
|
||||
$('#codePanel').hide();
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -430,7 +430,7 @@
|
|||
<div class="small-box bg-red-active">
|
||||
<div class="inner">
|
||||
<h3><?php echo $taux_hyp_r_c; ?><sup style="font-size: 20px">%</sup></h3>
|
||||
<p><?php echo $this->lang->line('rate_com_sup_remove_cash') ?> </p>
|
||||
<p><?php echo $this->lang->line('rate_com_hyp_remove_cash') ?> </p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-android-arrow-down"></i>
|
||||
|
|
Loading…
Reference in New Issue