+ Pagination of Wallet iLink Transactions
+ Add bank_code to banks
This commit is contained in:
parent
3f2d7ca7c4
commit
468696abf0
|
@ -2378,8 +2378,9 @@ class Gestion extends CI_Controller
|
||||||
$id_country = $this->input->post('id_country');
|
$id_country = $this->input->post('id_country');
|
||||||
$name = $this->input->post('name');
|
$name = $this->input->post('name');
|
||||||
$address = $this->input->post('address');
|
$address = $this->input->post('address');
|
||||||
|
$code = $this->input->post('code');
|
||||||
|
|
||||||
$res = $this->wallet_model->updateBank($id_bank, $id_country ,$name , $address);
|
$res = $this->wallet_model->updateBank($id_bank, $id_country ,$name , $address , $code);
|
||||||
|
|
||||||
if ($res == true) {
|
if ($res == true) {
|
||||||
echo json_encode("completed");
|
echo json_encode("completed");
|
||||||
|
|
|
@ -441,7 +441,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
$networkDetails = $this->user_model->getNetworkDetails($network_id);
|
$networkDetails = $this->user_model->getNetworkDetails($network_id);
|
||||||
$data['currency_name_fr'] = $networkDetails->first_row()->currency_name_fr;
|
$data['currency_name_fr'] = $networkDetails->first_row()->currency_name_fr;
|
||||||
$data['currency_name_en'] = $networkDetails->first_row()->currency_name_en;
|
$data['currency_name_en'] = $networkDetails->first_row()->currency_name_en;
|
||||||
$data['transactions'] = $this->wallet_model->getIlinkTransactions($startDate, $endDate, $network_id);
|
// $data['transactions'] = $this->wallet_model->getIlinkTransactions($startDate, $endDate, $network_id);
|
||||||
} else if ($type == 'commission_transfer')
|
} else if ($type == 'commission_transfer')
|
||||||
$data['transactions'] = $this->wallet_model->getCommissionTransfers($startDate, $endDate, $this->session->userdata('member_code'));
|
$data['transactions'] = $this->wallet_model->getCommissionTransfers($startDate, $endDate, $this->session->userdata('member_code'));
|
||||||
else if ($type == 'balance_statement')
|
else if ($type == 'balance_statement')
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
|
||||||
|
use Brick\Money\Context\AutoContext;
|
||||||
|
use Brick\Money\CurrencyConverter;
|
||||||
|
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
|
||||||
|
use Brick\Money\ExchangeRateProvider\PDOProvider;
|
||||||
|
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
|
||||||
|
use Brick\Money\Money;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
class WalletIlinkTransaction extends CI_Controller
|
||||||
|
{
|
||||||
|
private $converter = null;
|
||||||
|
private $context = null;
|
||||||
|
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
// Load member model
|
||||||
|
$this->load->model('pagination/WalletIlinkTransaction_model', 'wit_model');
|
||||||
|
|
||||||
|
// 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
|
||||||
|
$this->converter = new CurrencyConverter($provider);
|
||||||
|
$this->context = new AutoContext();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function toLocateDate($date , $timezone){
|
||||||
|
if($date){
|
||||||
|
$carbon = Carbon::createFromFormat('Y-m-d H:i:s', $date, 'UTC');
|
||||||
|
$carbon->setTimezone($timezone);
|
||||||
|
return $carbon->toDateTimeString();
|
||||||
|
}
|
||||||
|
return $date;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getLists()
|
||||||
|
{
|
||||||
|
$data = $row = array();
|
||||||
|
|
||||||
|
// Fetch member's records
|
||||||
|
$witData = $this->wit_model->getRows($_POST);
|
||||||
|
|
||||||
|
$i = $_POST['start'];
|
||||||
|
foreach ($witData as $row) {
|
||||||
|
$i++;
|
||||||
|
$created = $this->toLocateDate($row->date,$this->session->userdata('timezone')) ; //date('jS M Y', strtotime($row->date));
|
||||||
|
// $status = ($row->status == 1)?'Active':'Inactive';
|
||||||
|
$operation = strtoupper($row->acteur) . ' - ' . ($this->session->userdata('site_lang') === 'french' ? $row->operation_fr : $row->operation_en);
|
||||||
|
$numero_carte = join(" ", str_split($row->numero_carte, 4));
|
||||||
|
|
||||||
|
|
||||||
|
$moneyNetInit = Money::of(round($row->montant_net, 2), $row->init_currency, $this->context);
|
||||||
|
$agent = $row->agent ? ($row->agent . " | " . $row->code_agent . " | " . $row->phone_agent) : "";
|
||||||
|
if ($row->destinataire_phone) {
|
||||||
|
$destinataire = $row->destinataire_phone . ' | ' . $row->destinataire_name;
|
||||||
|
} else {
|
||||||
|
$destinataire = ($row->id_destinataire ? $row->id_destinataire . ' | ' : '') . ($row->nom_destinataire ? $row->nom_destinataire : '') . (' ' . $row->prenom_destinataire ? $row->prenom_destinataire : '');
|
||||||
|
|
||||||
|
}
|
||||||
|
if ($row->user_phone) {
|
||||||
|
$emetteur = $row->user_phone . ' | ' . $row->user;
|
||||||
|
} else {
|
||||||
|
$emetteur = ($row->nom_emetteur ? $row->nom_emetteur : '') . (' ' . $row->prenom_emetteur ? $row->prenom_emetteur : '');
|
||||||
|
}
|
||||||
|
$moneyNetFinal = Money::of(round($row->montant_net_final_country, 2), $row->final_currency ? $row->final_currency : 'XAF', $this->context);
|
||||||
|
|
||||||
|
$data[] = array($row->id_transaction, $operation, $numero_carte, $moneyNetInit->formatTo('fr_FR'), $moneyNetFinal->formatTo('fr_FR'),
|
||||||
|
Money::of(round($row->part_reseau_payeur_final_country ? $row->part_reseau_payeur_final_country : 0, 2), $row->final_currency ? $row->final_currency : 'XAF', $this->context)->formatTo('fr_FR'),
|
||||||
|
str_replace('_', ' ', $row->status_reseau_payeur), $row->final_currency, $row->pays_init,$row->pays_final, Money::of(round($row->frais,2), $row->init_currency,$this->context)->formatTo('fr_FR'),
|
||||||
|
Money::of(round($row->taxe, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),Money::of(round($row->commission_banque ? $row->commission_banque : 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),
|
||||||
|
Money::of(round($row->commission_hyp ? $row->commission_hyp : 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),Money::of(round($row->commission_sup ? $row->commission_sup : 0 , 2),$row->init_currency,$this->context)->formatTo('fr_FR'),
|
||||||
|
Money::of(round($row->commission_ag ? $row->commission_ag : 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'), $agent , $emetteur, $destinataire, $created);
|
||||||
|
}
|
||||||
|
|
||||||
|
$output = array(
|
||||||
|
"draw" => $_POST['draw'],
|
||||||
|
"recordsTotal" => $this->wit_model->countAll($_POST),
|
||||||
|
"recordsFiltered" => $this->wit_model->countFiltered($_POST),
|
||||||
|
"data" => $data,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Output to JSON format
|
||||||
|
echo json_encode($output);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -537,4 +537,5 @@ $lang['paying_networks'] = 'Paying networks';
|
||||||
$lang['configure_transmitter_network'] = 'Configure the sending network';
|
$lang['configure_transmitter_network'] = 'Configure the sending network';
|
||||||
$lang['paying_and_transmitting_networks_accounts'] = "Accounts of paying and issuing networks";
|
$lang['paying_and_transmitting_networks_accounts'] = "Accounts of paying and issuing networks";
|
||||||
$lang['transmitting_networks_accounts'] = 'Accounts of transmitting networks';
|
$lang['transmitting_networks_accounts'] = 'Accounts of transmitting networks';
|
||||||
|
$lang['bank_code'] = "Bank code";
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -549,5 +549,6 @@ $lang['paying_networks'] = 'Réseaux payeurs';
|
||||||
$lang['configure_transmitter_network'] = 'Configurer le réseau émetteur';
|
$lang['configure_transmitter_network'] = 'Configurer le réseau émetteur';
|
||||||
$lang['paying_and_transmitting_networks_accounts'] = "Comptes des reseaux payeurs et émetteurs";
|
$lang['paying_and_transmitting_networks_accounts'] = "Comptes des reseaux payeurs et émetteurs";
|
||||||
$lang['transmitting_networks_accounts'] = 'Comptes des reseaux émetteurs';
|
$lang['transmitting_networks_accounts'] = 'Comptes des reseaux émetteurs';
|
||||||
|
$lang['bank_code'] = "Code banque";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -864,7 +864,7 @@ INNER JOIN countries_currencies cc ON n.country_id= cc.id INNER JOIN configWalle
|
||||||
|
|
||||||
// Banques
|
// Banques
|
||||||
public function getAllBanksCountries(){
|
public function getAllBanksCountries(){
|
||||||
$query = $this->db->query("SELECT b.id, b.nom as bank_name , bc.adresse as bank_address , bc.status, c.name as country , c.id as country_id FROM banks_countries bc INNER JOIN banks b ON b.id = bc.id_bank INNER JOIN countries c ON c.id = bc.id_country");
|
$query = $this->db->query("SELECT b.id, b.nom as bank_name , bc.adresse as bank_address , bc.code_banque as bank_code , bc.status, c.name as country , c.id as country_id FROM banks_countries bc INNER JOIN banks b ON b.id = bc.id_bank INNER JOIN countries c ON c.id = bc.id_country");
|
||||||
return $query->num_rows() > 0 ? $query : false ;
|
return $query->num_rows() > 0 ? $query : false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -883,12 +883,12 @@ INNER JOIN countries_currencies cc ON n.country_id= cc.id INNER JOIN configWalle
|
||||||
return $query->num_rows() > 0 ? $query : false ;
|
return $query->num_rows() > 0 ? $query : false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateBank($id_bank,$id_country, $name , $address){
|
public function updateBank($id_bank,$id_country, $name , $address , $code){
|
||||||
$sql = "UPDATE `banks` SET `nom` = ? WHERE (`id` = ?);";
|
$sql = "UPDATE `banks` SET `nom` = ? WHERE (`id` = ?);";
|
||||||
$this->db->query($sql , array($name,$id_bank));
|
$this->db->query($sql , array($name,$id_bank));
|
||||||
|
|
||||||
$sql = "UPDATE `banks_countries` SET `adresse` = ? WHERE (`id_bank` = ? AND `id_country` = ?);";
|
$sql = "UPDATE `banks_countries` SET `adresse` = ? , `code_banque` = ? WHERE (`id_bank` = ? AND `id_country` = ?);";
|
||||||
return $this->db->query($sql , array($address,$id_bank,$id_country));
|
return $this->db->query($sql , array($address,$code,$id_bank,$id_country));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteBankCountry($id_bank, $id_country){
|
public function deleteBankCountry($id_bank, $id_country){
|
||||||
|
@ -898,7 +898,7 @@ INNER JOIN countries_currencies cc ON n.country_id= cc.id INNER JOIN configWalle
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBanksForNetwork($id_network){
|
public function getBanksForNetwork($id_network){
|
||||||
$sql = "SELECT bc.id, b.nom as bank_name , bc.adresse as bank_address, c.name as country , c.id as country_id , nb.id_network FROM networks n
|
$sql = "SELECT bc.id, b.nom as bank_name , bc.adresse as bank_address, bc.code_banque as bank_code , c.name as country , c.id as country_id , nb.id_network FROM networks n
|
||||||
CROSS JOIN banks_countries bc INNER JOIN banks b ON b.id = bc.id_bank INNER JOIN countries c ON c.id = bc.id_country
|
CROSS JOIN banks_countries bc INNER JOIN banks b ON b.id = bc.id_bank INNER JOIN countries c ON c.id = bc.id_country
|
||||||
LEFT JOIn networks_banks nb ON nb.id_bank_country = bc.id AND nb.id_network = n.id WHERE bc.status = 1 AND n.id = ?";
|
LEFT JOIn networks_banks nb ON nb.id_bank_country = bc.id AND nb.id_network = n.id WHERE bc.status = 1 AND n.id = ?";
|
||||||
$query = $this->db->query($sql , array($id_network));
|
$query = $this->db->query($sql , array($id_network));
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class WalletIlinkTransaction_model extends CI_Model
|
||||||
|
{
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
// Set table name
|
||||||
|
$this->table = 'infos_ilink_transaction';
|
||||||
|
// Set orderable column fields
|
||||||
|
$this->column_order = array('id_transaction', 'operation_fr', 'numero_carte', 'montant_net', 'montant_net_final_country',
|
||||||
|
'part_reseau_payeur_final_country', 'status_reseau_payeur','final_currency', 'pays_init', 'pays_final', 'frais', 'taxe', 'commission_banque',
|
||||||
|
'commission_hyp', 'commission_sup', 'commission_ag', 'agent', null, null,'date');
|
||||||
|
// Set searchable column fields
|
||||||
|
$this->column_search = array('id_transaction', 'operation_fr', 'numero_carte', 'montant_net', 'montant_net_final_country',
|
||||||
|
'part_reseau_payeur_final_country', 'status_reseau_payeur','final_currency', 'pays_init', 'pays_final', 'frais', 'taxe', 'commission_banque',
|
||||||
|
'commission_hyp', 'commission_sup', 'commission_ag', 'agent','date');
|
||||||
|
// Set default order
|
||||||
|
$this->order = array('date' => 'desc');
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Fetch members data from the database
|
||||||
|
* @param $_POST filter data based on the posted parameters
|
||||||
|
*/
|
||||||
|
public function getRows($postData)
|
||||||
|
{
|
||||||
|
$this->_get_datatables_query($postData);
|
||||||
|
if ($postData['length'] != -1) {
|
||||||
|
$this->db->limit($postData['length'], $postData['start']);
|
||||||
|
}
|
||||||
|
$query = $this->db->get();
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Count all records
|
||||||
|
*/
|
||||||
|
public function countAll($postData)
|
||||||
|
{
|
||||||
|
$this->db->from($this->table);
|
||||||
|
$this->db->where('network_emetteur', $postData['id_network']);
|
||||||
|
return $this->db->count_all_results();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Count records based on the filter params
|
||||||
|
* @param $_POST filter data based on the posted parameters
|
||||||
|
*/
|
||||||
|
public function countFiltered($postData)
|
||||||
|
{
|
||||||
|
$this->_get_datatables_query($postData);
|
||||||
|
$query = $this->db->get();
|
||||||
|
return $query->num_rows();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Perform the SQL queries needed for an server-side processing requested
|
||||||
|
* @param $_POST filter data based on the posted parameters
|
||||||
|
*/
|
||||||
|
private function _get_datatables_query($postData)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->db->from($this->table);
|
||||||
|
$this->db->where('network_emetteur', $postData['id_network']);
|
||||||
|
if (strlen($postData['startDate']) > 0 && strlen($postData['endDate']) > 0) {
|
||||||
|
$this->db->where('date >=', date('Y-m-d h:i:s', strtotime($postData['startDate'])));
|
||||||
|
$this->db->where('date <=', date('Y-m-d h:i:s', strtotime($postData['endDate'])));
|
||||||
|
}
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
// loop searchable columns
|
||||||
|
foreach ($this->column_search as $item) {
|
||||||
|
// if datatable send POST for search
|
||||||
|
if ($postData['search']['value']) {
|
||||||
|
// first loop
|
||||||
|
if ($i === 0) {
|
||||||
|
// open bracket
|
||||||
|
$this->db->group_start();
|
||||||
|
$this->db->like($item, $postData['search']['value']);
|
||||||
|
} else {
|
||||||
|
$this->db->or_like($item, $postData['search']['value']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// last loop
|
||||||
|
if (count($this->column_search) - 1 == $i) {
|
||||||
|
// close bracket
|
||||||
|
$this->db->group_end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($postData['order'])) {
|
||||||
|
$this->db->order_by($this->column_order[$postData['order']['0']['column']], $postData['order']['0']['dir']);
|
||||||
|
} else if (isset($this->order)) {
|
||||||
|
$order = $this->order;
|
||||||
|
$this->db->order_by(key($order), $order[key($order)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -59,6 +59,7 @@
|
||||||
<th align='center'>N°</th>
|
<th align='center'>N°</th>
|
||||||
<th><?php echo $this->lang->line('Pays'); ?></th>
|
<th><?php echo $this->lang->line('Pays'); ?></th>
|
||||||
<th><?php echo $this->lang->line('Nom'); ?></th>
|
<th><?php echo $this->lang->line('Nom'); ?></th>
|
||||||
|
<th><?php echo $this->lang->line('bank_code'); ?></th>
|
||||||
<th><?php echo $this->lang->line('Adresse'); ?></th>
|
<th><?php echo $this->lang->line('Adresse'); ?></th>
|
||||||
<th align='center'><?php echo $this->lang->line('Statut'); ?></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('Activer/Désactiver'); ?></th>
|
||||||
|
@ -70,7 +71,6 @@
|
||||||
<?php
|
<?php
|
||||||
foreach($sql2->result() as $row) {
|
foreach($sql2->result() as $row) {
|
||||||
$num ++;
|
$num ++;
|
||||||
//$member_code = randomString1(10);
|
|
||||||
$libelle_status = $this->lang->line('Actif');
|
$libelle_status = $this->lang->line('Actif');
|
||||||
if($row->status==0){
|
if($row->status==0){
|
||||||
$libelle_status = $this->lang->line('Inactif');
|
$libelle_status = $this->lang->line('Inactif');
|
||||||
|
@ -79,6 +79,7 @@
|
||||||
<td align='center'>$num</td>
|
<td align='center'>$num</td>
|
||||||
<td>$row->country</td>
|
<td>$row->country</td>
|
||||||
<td >$row->bank_name</td>
|
<td >$row->bank_name</td>
|
||||||
|
<td >$row->bank_code</td>
|
||||||
<td >$row->bank_address</td>
|
<td >$row->bank_address</td>
|
||||||
<td align='center'>$libelle_status</td>";
|
<td align='center'>$libelle_status</td>";
|
||||||
if($row->status==0){
|
if($row->status==0){
|
||||||
|
@ -97,7 +98,7 @@
|
||||||
</label></td>";
|
</label></td>";
|
||||||
}
|
}
|
||||||
echo "<td id='edition' align='center'>
|
echo "<td id='edition' align='center'>
|
||||||
<button data-toggle='modal' data-id-bank='$row->id' data-name-bank='$row->bank_name' data-address-bank='$row->bank_address'
|
<button data-toggle='modal' data-id-bank='$row->id' data-name-bank='$row->bank_name' data-address-bank='$row->bank_address' data-code-bank='$row->bank_code'
|
||||||
data-country='$row->country' data-id-country='$row->country_id' class='open-modal btn btn-success' data-target='#editModal'><i class='fa fa-edit'></i></button>
|
data-country='$row->country' data-id-country='$row->country_id' class='open-modal btn btn-success' data-target='#editModal'><i class='fa fa-edit'></i></button>
|
||||||
</td>
|
</td>
|
||||||
<td id='suppression' align='center'>
|
<td id='suppression' align='center'>
|
||||||
|
@ -210,6 +211,10 @@
|
||||||
<label for="name"><?php echo $this->lang->line('Nom'); ?></label>
|
<label for="name"><?php echo $this->lang->line('Nom'); ?></label>
|
||||||
<input type="text" class="form-control input-lg" name="name" required id="name">
|
<input type="text" class="form-control input-lg" name="name" required id="name">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for=code"><?php echo $this->lang->line('bank_code'); ?></label>
|
||||||
|
<input type="text" pattern=".{4,}" class="form-control input-lg" name="code" required id="code">
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="address"><?php echo $this->lang->line('Adresse'); ?></label>
|
<label for="address"><?php echo $this->lang->line('Adresse'); ?></label>
|
||||||
<input type="text" class="form-control input-lg" name="address" required id="address">
|
<input type="text" class="form-control input-lg" name="address" required id="address">
|
||||||
|
@ -282,11 +287,11 @@
|
||||||
success: function(data){
|
success: function(data){
|
||||||
if(data==='completed'){
|
if(data==='completed'){
|
||||||
alert('Banques(s) activée(s)/désactivée(s)');
|
alert('Banques(s) activée(s)/désactivée(s)');
|
||||||
location.reload(true);
|
location.reload();
|
||||||
}else{
|
}else{
|
||||||
alert(data);
|
alert(data);
|
||||||
//alert("<?= $this->lang->line('error_message') ?>");
|
//alert("<?= $this->lang->line('error_message') ?>");
|
||||||
location.reload(true);
|
location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -321,12 +326,14 @@
|
||||||
id_bank = $(this).data('id-bank');
|
id_bank = $(this).data('id-bank');
|
||||||
const bank_name = $(this).data('name-bank');
|
const bank_name = $(this).data('name-bank');
|
||||||
const bank_address = $(this).data('address-bank');
|
const bank_address = $(this).data('address-bank');
|
||||||
|
const bank_code = $(this).data('code-bank');
|
||||||
id_country = $(this).data('id-country');
|
id_country = $(this).data('id-country');
|
||||||
country = $(this).data('country');
|
country = $(this).data('country');
|
||||||
|
|
||||||
$(".modal-body #modal-pays").val(country);
|
$(".modal-body #modal-pays").val(country);
|
||||||
$(".modal-body #name").val( bank_name );
|
$(".modal-body #name").val( bank_name );
|
||||||
$(".modal-body #address").val( bank_address );
|
$(".modal-body #address").val( bank_address );
|
||||||
|
$(".modal-body #code").val( bank_code );
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -342,10 +349,10 @@
|
||||||
success: function(data){
|
success: function(data){
|
||||||
if(data==='completed'){
|
if(data==='completed'){
|
||||||
alert("<?= $this->lang->line('bank_deleted') ?>");
|
alert("<?= $this->lang->line('bank_deleted') ?>");
|
||||||
location.reload(true);
|
location.reload();
|
||||||
}else{
|
}else{
|
||||||
alert("<?= $this->lang->line('error_message') ?>");
|
alert("<?= $this->lang->line('error_message') ?>");
|
||||||
location.reload(true);
|
location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -365,13 +372,13 @@
|
||||||
success: function(data){
|
success: function(data){
|
||||||
if(data==='completed'){
|
if(data==='completed'){
|
||||||
alert("<?= $this->lang->line('bank_assigned') ?>");
|
alert("<?= $this->lang->line('bank_assigned') ?>");
|
||||||
location.reload(true);
|
location.reload();
|
||||||
}else if(data==='existe'){
|
}else if(data==='existe'){
|
||||||
alert('Ce réseau a déjà été assigné à certains des pays sélectionnés');
|
alert('Ce réseau a déjà été assigné à certains des pays sélectionnés');
|
||||||
location.reload(true);
|
location.reload();
|
||||||
}else{
|
}else{
|
||||||
alert("<?= $this->lang->line('error_message') ?>");
|
alert("<?= $this->lang->line('error_message') ?>");
|
||||||
location.reload(true);
|
location.reload();
|
||||||
alert(data);
|
alert(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -390,10 +397,10 @@
|
||||||
success: function(data){
|
success: function(data){
|
||||||
if(data==='completed'){
|
if(data==='completed'){
|
||||||
alert("<?= $this->lang->line('bank_added') ?>");
|
alert("<?= $this->lang->line('bank_added') ?>");
|
||||||
location.reload(true);
|
location.reload();
|
||||||
}else{
|
}else{
|
||||||
alert("<?= $this->lang->line('error_message') ?>");
|
alert("<?= $this->lang->line('error_message') ?>");
|
||||||
location.reload(true);
|
location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -403,18 +410,19 @@
|
||||||
$("#update-form").submit(function(event){
|
$("#update-form").submit(function(event){
|
||||||
const name = $("#update-form #name").val();
|
const name = $("#update-form #name").val();
|
||||||
const address = $("#update-form #address").val();
|
const address = $("#update-form #address").val();
|
||||||
|
const code = $("#update-form #code").val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:'<?php echo base_url('index.php/Gestion/update_bank')?>',
|
url:'<?php echo base_url('index.php/Gestion/update_bank')?>',
|
||||||
type: 'post',
|
type: 'post',
|
||||||
data: {id_bank: id_bank ,name:name , address :address , id_country : id_country},
|
data: {id_bank: id_bank ,name:name , address :address , id_country : id_country , code : code},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(data){
|
success: function(data){
|
||||||
if(data==='completed'){
|
if(data==='completed'){
|
||||||
alert("<?= $this->lang->line('bank_modified') ?>");
|
alert("<?= $this->lang->line('bank_modified') ?>");
|
||||||
location.reload(true);
|
location.reload();
|
||||||
}else{
|
}else{
|
||||||
alert("<?= $this->lang->line('error_message') ?>");
|
alert("<?= $this->lang->line('error_message') ?>");
|
||||||
location.reload(true);
|
location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
<th align='center'>N°</th>
|
<th align='center'>N°</th>
|
||||||
<th><?php echo $this->lang->line('Pays'); ?></th>
|
<th><?php echo $this->lang->line('Pays'); ?></th>
|
||||||
<th><?php echo $this->lang->line('Nom'); ?></th>
|
<th><?php echo $this->lang->line('Nom'); ?></th>
|
||||||
|
<th><?php echo $this->lang->line('bank_code'); ?></th>
|
||||||
<th align='center'><?php echo $this->lang->line('Adresse'); ?></th>
|
<th align='center'><?php echo $this->lang->line('Adresse'); ?></th>
|
||||||
<th align='center'><?php echo $this->lang->line('Statut'); ?></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('Activer/Désactiver'); ?></th>
|
||||||
|
@ -74,6 +75,7 @@
|
||||||
<td align='center'>$num</td>
|
<td align='center'>$num</td>
|
||||||
<td >$row->country</td>
|
<td >$row->country</td>
|
||||||
<td >$row->bank_name</td>
|
<td >$row->bank_name</td>
|
||||||
|
<td >$row->bank_code</td>
|
||||||
<td>$row->bank_address</td>";
|
<td>$row->bank_address</td>";
|
||||||
?>
|
?>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -12,7 +12,6 @@ use Brick\Money\CurrencyConverter;
|
||||||
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
|
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
|
||||||
use Brick\Money\ExchangeRateProvider\PDOProvider;
|
use Brick\Money\ExchangeRateProvider\PDOProvider;
|
||||||
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
|
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
|
||||||
use Brick\Money\Money;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
function toLocateDate($date , $timezone){
|
function toLocateDate($date , $timezone){
|
||||||
|
@ -123,13 +122,6 @@ function toLocateDate($date , $timezone){
|
||||||
<h3 class="box-title"><?php echo $this->lang->line('export_transaction_history') ?></h3>
|
<h3 class="box-title"><?php echo $this->lang->line('export_transaction_history') ?></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body" style="overflow-x:auto;">
|
<div class="box-body" style="overflow-x:auto;">
|
||||||
<?php
|
|
||||||
if($transactions){
|
|
||||||
$numrows = $transactions->num_rows();
|
|
||||||
$num = 0;
|
|
||||||
if ($numrows > 0) {
|
|
||||||
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
|
|
||||||
?>
|
|
||||||
|
|
||||||
<table id="transactions" class="table table-bordered table-striped">
|
<table id="transactions" class="table table-bordered table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -154,82 +146,9 @@ function toLocateDate($date , $timezone){
|
||||||
<th><?php echo $this->lang->line('issuer_id') ?></th>
|
<th><?php echo $this->lang->line('issuer_id') ?></th>
|
||||||
<th><?php echo $this->lang->line('recipient_id')?></th>
|
<th><?php echo $this->lang->line('recipient_id')?></th>
|
||||||
<th align='center'>Date</th>
|
<th align='center'>Date</th>
|
||||||
<?php if ($this->session->userdata('category') != 'super') { ?>
|
|
||||||
<!-- <th align='center'>Action</th>-->
|
|
||||||
<?php } ?>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
foreach ($transactions->result() as $row) {
|
|
||||||
$num++;
|
|
||||||
|
|
||||||
$net = 0;
|
|
||||||
$banque = 0;
|
|
||||||
$moneyNetInit = Money::of(round($row->montant_net ,2), $row->init_currency,$context);
|
|
||||||
$agent = $row->agent ? ( $row->agent." | ".$row->code_agent." | ".$row->phone_agent ) : "";
|
|
||||||
if($row->destinataire_phone){
|
|
||||||
$destinataire = $row->destinataire_phone.' | '.$row->destinataire_name;
|
|
||||||
}else{
|
|
||||||
$destinataire = ($row->id_destinataire ? $row->id_destinataire.' | ' : '').($row->nom_destinataire ? $row->nom_destinataire : '').(' '.$row->prenom_destinataire? $row->prenom_destinataire : '');
|
|
||||||
|
|
||||||
}
|
|
||||||
if($row->user_phone){
|
|
||||||
$emetteur = $row->user_phone.' | '.$row->user;
|
|
||||||
}else{
|
|
||||||
$emetteur = ($row->nom_emetteur? $row->nom_emetteur : '').(' '.$row->prenom_emetteur ? $row->prenom_emetteur : '');
|
|
||||||
}
|
|
||||||
$moneyNetFinal =Money::of(round($row->montant_net_final_country,2),$row->final_currency ? $row->final_currency : 'XAF',$context);
|
|
||||||
echo "<tr>
|
|
||||||
<td align='center' >$row->id_transaction</td>
|
|
||||||
<td>" . strtoupper($row->acteur) . ' - ' .($this->session->userdata('site_lang') === 'french' ? $row->operation_fr : $row->operation_en). "</td>
|
|
||||||
<td>" . join(" ", str_split($row->numero_carte, 4)) . "</td>
|
|
||||||
<td>" . $moneyNetInit->formatTo('fr_FR') . "</td>
|
|
||||||
<td>" . $moneyNetFinal->formatTo('fr_FR') . "</td>
|
|
||||||
<td>" . Money::of(round($row->part_reseau_payeur_final_country ? $row->part_reseau_payeur_final_country : 0, 2), $row->final_currency ? $row->final_currency : 'XAF', $context)->formatTo('fr_FR') . "</td>
|
|
||||||
<td>" . str_replace('_',' ',$row->status_reseau_payeur). "</td>
|
|
||||||
<td>" . $row->final_currency . "</td>
|
|
||||||
<td>".$row->pays_init."</td>
|
|
||||||
<td>".$row->pays_final."</td>
|
|
||||||
<td>".Money::of(round($row->frais,2), $row->init_currency,$context)->formatTo('fr_FR')."</td>
|
|
||||||
<td>".Money::of(round($row->taxe, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
|
|
||||||
<td>".Money::of(round($row->commission_banque ? $row->commission_banque : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
|
|
||||||
<td>".Money::of(round($row->commission_hyp ? $row->commission_hyp : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
|
|
||||||
<td>".Money::of(round($row->commission_sup ? $row->commission_sup : 0 , 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
|
|
||||||
<td>".Money::of(round($row->commission_ag ? $row->commission_ag : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
|
|
||||||
<td>".$agent."</td>
|
|
||||||
<td>".$emetteur."</td>
|
|
||||||
<td>".$destinataire."</td>
|
|
||||||
<td>".toLocateDate($row->date,$this->session->userdata('timezone'))."</td>";
|
|
||||||
?>
|
|
||||||
<?php if ($this->session->userdata('category') != 'super') { ?>
|
|
||||||
<!-- <td>-->
|
|
||||||
<!-- <button data-id-transaction="--><?php //echo $row->id_transaction ?><!--" id="cancel"-->
|
|
||||||
<!-- class="btn btn-danger btn-block" --><?php //if ($row->canceled) echo "disabled" ?><!-- >-->
|
|
||||||
<!-- <b>--><?php //echo $this->lang->line('cancel') ?><!--</b>-->
|
|
||||||
<!-- </button>-->
|
|
||||||
<!-- </td>-->
|
|
||||||
<?php } ?>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
} else {
|
|
||||||
echo $this->lang->line('Aucune transaction');
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
echo $this->lang->line('Aucune transaction');
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -274,17 +193,35 @@ function toLocateDate($date , $timezone){
|
||||||
const lang = $('#picker').data('lang');
|
const lang = $('#picker').data('lang');
|
||||||
const format = lang === 'french' ? 'fr' : 'en';
|
const format = lang === 'french' ? 'fr' : 'en';
|
||||||
moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date
|
moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date
|
||||||
|
|
||||||
var table = $('#transactions').DataTable({
|
var table = $('#transactions').DataTable({
|
||||||
|
// Processing indicator
|
||||||
|
"processing": true,
|
||||||
|
// DataTables server-side processing mode
|
||||||
|
"serverSide": true,
|
||||||
|
// Initial no order.
|
||||||
|
"order": [],
|
||||||
|
// Load data from an Ajax source
|
||||||
|
"ajax": {
|
||||||
|
"url": "<?php echo base_url('pagination/WalletIlinkTransaction/getLists'); ?>",
|
||||||
|
"data":{
|
||||||
|
"startDate" : "<?= $startDate?>",
|
||||||
|
"endDate" : "<?= $endDate?>",
|
||||||
|
"id_network" : <?= $id_network ?>
|
||||||
|
},
|
||||||
|
"type": "POST"
|
||||||
|
},
|
||||||
"aaSorting": [[19, "desc"]],
|
"aaSorting": [[19, "desc"]],
|
||||||
"columnDefs": [{
|
"columnDefs": [{
|
||||||
targets: 19,
|
"targets": [19],
|
||||||
|
// "orderable": false,
|
||||||
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
|
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
|
||||||
}],
|
}],
|
||||||
dom: 'Bfrtip',
|
dom: 'Bfrtip',
|
||||||
"buttons": [
|
"buttons": [
|
||||||
'pageLength',
|
'pageLength',
|
||||||
{
|
{
|
||||||
extend: 'excelHtml5',
|
"extend": 'excelHtml5',
|
||||||
title: "<?= $this->lang->line('Historique des transactions') ?>",
|
title: "<?= $this->lang->line('Historique des transactions') ?>",
|
||||||
// exportOptions: {
|
// exportOptions: {
|
||||||
// columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
// columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
||||||
|
@ -302,7 +239,8 @@ function toLocateDate($date , $timezone){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
trim: false
|
trim: false,
|
||||||
|
"action": newexportaction
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
extend: 'csvHtml5',
|
extend: 'csvHtml5',
|
||||||
|
@ -310,7 +248,8 @@ function toLocateDate($date , $timezone){
|
||||||
exportOptions: {
|
exportOptions: {
|
||||||
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
||||||
},
|
},
|
||||||
trim: false
|
trim: false,
|
||||||
|
"action": newexportaction
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
extend: 'pdfHtml5',
|
extend: 'pdfHtml5',
|
||||||
|
@ -320,7 +259,8 @@ function toLocateDate($date , $timezone){
|
||||||
exportOptions: {
|
exportOptions: {
|
||||||
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
||||||
},
|
},
|
||||||
trim: false
|
trim: false,
|
||||||
|
"action": newexportaction
|
||||||
},
|
},
|
||||||
// 'colvis'
|
// 'colvis'
|
||||||
]
|
]
|
||||||
|
@ -328,6 +268,48 @@ function toLocateDate($date , $timezone){
|
||||||
|
|
||||||
table.buttons().container()
|
table.buttons().container()
|
||||||
.appendTo('#example_wrapper .col-sm-6:eq(0)');
|
.appendTo('#example_wrapper .col-sm-6:eq(0)');
|
||||||
|
|
||||||
|
function newexportaction(e, dt, button, config) {
|
||||||
|
var self = this;
|
||||||
|
var oldStart = dt.settings()[0]._iDisplayStart;
|
||||||
|
dt.one('preXhr', function (e, s, data) {
|
||||||
|
// Just this once, load all data from the server...
|
||||||
|
data.start = 0;
|
||||||
|
data.length = 2147483647;
|
||||||
|
dt.one('preDraw', function (e, settings) {
|
||||||
|
// Call the original action function
|
||||||
|
if (button[0].className.indexOf('buttons-copy') >= 0) {
|
||||||
|
$.fn.dataTable.ext.buttons.copyHtml5.action.call(self, e, dt, button, config);
|
||||||
|
} else if (button[0].className.indexOf('buttons-excel') >= 0) {
|
||||||
|
$.fn.dataTable.ext.buttons.excelHtml5.available(dt, config) ?
|
||||||
|
$.fn.dataTable.ext.buttons.excelHtml5.action.call(self, e, dt, button, config) :
|
||||||
|
$.fn.dataTable.ext.buttons.excelFlash.action.call(self, e, dt, button, config);
|
||||||
|
} else if (button[0].className.indexOf('buttons-csv') >= 0) {
|
||||||
|
$.fn.dataTable.ext.buttons.csvHtml5.available(dt, config) ?
|
||||||
|
$.fn.dataTable.ext.buttons.csvHtml5.action.call(self, e, dt, button, config) :
|
||||||
|
$.fn.dataTable.ext.buttons.csvFlash.action.call(self, e, dt, button, config);
|
||||||
|
} else if (button[0].className.indexOf('buttons-pdf') >= 0) {
|
||||||
|
$.fn.dataTable.ext.buttons.pdfHtml5.available(dt, config) ?
|
||||||
|
$.fn.dataTable.ext.buttons.pdfHtml5.action.call(self, e, dt, button, config) :
|
||||||
|
$.fn.dataTable.ext.buttons.pdfFlash.action.call(self, e, dt, button, config);
|
||||||
|
} else if (button[0].className.indexOf('buttons-print') >= 0) {
|
||||||
|
$.fn.dataTable.ext.buttons.print.action(e, dt, button, config);
|
||||||
|
}
|
||||||
|
dt.one('preXhr', function (e, s, data) {
|
||||||
|
// DataTables thinks the first item displayed is index 0, but we're not drawing that.
|
||||||
|
// Set the property to what it was before exporting.
|
||||||
|
settings._iDisplayStart = oldStart;
|
||||||
|
data.start = oldStart;
|
||||||
|
});
|
||||||
|
// Reload the grid with the original page. Otherwise, API functions like table.cell(this) don't work properly.
|
||||||
|
setTimeout(dt.ajax.reload, 0);
|
||||||
|
// Prevent rendering of the full data to the DOM
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// Requery the server with the new one-time export settings
|
||||||
|
dt.ajax.reload();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue