diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php index ff436426..d82e7a9a 100755 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -2378,8 +2378,9 @@ class Gestion extends CI_Controller $id_country = $this->input->post('id_country'); $name = $this->input->post('name'); $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) { echo json_encode("completed"); diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index f107ceb5..bb2a6dee 100755 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -441,7 +441,7 @@ class Hyperviseur_dash extends CI_Controller $networkDetails = $this->user_model->getNetworkDetails($network_id); $data['currency_name_fr'] = $networkDetails->first_row()->currency_name_fr; $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') $data['transactions'] = $this->wallet_model->getCommissionTransfers($startDate, $endDate, $this->session->userdata('member_code')); else if ($type == 'balance_statement') diff --git a/application/controllers/pagination/WalletIlinkTransaction.php b/application/controllers/pagination/WalletIlinkTransaction.php new file mode 100755 index 00000000..6f87dfb9 --- /dev/null +++ b/application/controllers/pagination/WalletIlinkTransaction.php @@ -0,0 +1,108 @@ +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); + } + +} diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index 5dea6000..7cd692d4 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -537,4 +537,5 @@ $lang['paying_networks'] = 'Paying networks'; $lang['configure_transmitter_network'] = 'Configure the sending network'; $lang['paying_and_transmitting_networks_accounts'] = "Accounts of paying and issuing networks"; $lang['transmitting_networks_accounts'] = 'Accounts of transmitting networks'; +$lang['bank_code'] = "Bank code"; ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index 7af8d917..179fcdc9 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -549,5 +549,6 @@ $lang['paying_networks'] = 'Réseaux payeurs'; $lang['configure_transmitter_network'] = 'Configurer le réseau émetteur'; $lang['paying_and_transmitting_networks_accounts'] = "Comptes des reseaux payeurs et émetteurs"; $lang['transmitting_networks_accounts'] = 'Comptes des reseaux émetteurs'; +$lang['bank_code'] = "Code banque"; ?> diff --git a/application/models/Wallet_model.php b/application/models/Wallet_model.php index 95cda339..22375624 100644 --- a/application/models/Wallet_model.php +++ b/application/models/Wallet_model.php @@ -864,7 +864,7 @@ INNER JOIN countries_currencies cc ON n.country_id= cc.id INNER JOIN configWalle // Banques 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 ; } @@ -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 ; } - 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` = ?);"; $this->db->query($sql , array($name,$id_bank)); - $sql = "UPDATE `banks_countries` SET `adresse` = ? WHERE (`id_bank` = ? AND `id_country` = ?);"; - return $this->db->query($sql , array($address,$id_bank,$id_country)); + $sql = "UPDATE `banks_countries` SET `adresse` = ? , `code_banque` = ? WHERE (`id_bank` = ? AND `id_country` = ?);"; + return $this->db->query($sql , array($address,$code,$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){ - $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 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)); diff --git a/application/models/pagination/WalletIlinkTransaction_model.php b/application/models/pagination/WalletIlinkTransaction_model.php new file mode 100644 index 00000000..a55bd54c --- /dev/null +++ b/application/models/pagination/WalletIlinkTransaction_model.php @@ -0,0 +1,101 @@ +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)]); + } + } +} diff --git a/application/views/gestion_banques_admin.php b/application/views/gestion_banques_admin.php index e5d371b7..f3210f3a 100755 --- a/application/views/gestion_banques_admin.php +++ b/application/views/gestion_banques_admin.php @@ -59,6 +59,7 @@ N° lang->line('Pays'); ?> lang->line('Nom'); ?> + lang->line('bank_code'); ?> lang->line('Adresse'); ?> lang->line('Statut'); ?> lang->line('Activer/Désactiver'); ?> @@ -70,7 +71,6 @@ result() as $row) { $num ++; - //$member_code = randomString1(10); $libelle_status = $this->lang->line('Actif'); if($row->status==0){ $libelle_status = $this->lang->line('Inactif'); @@ -79,6 +79,7 @@ $num $row->country $row->bank_name + $row->bank_code $row->bank_address $libelle_status"; if($row->status==0){ @@ -97,7 +98,7 @@ "; } echo " - @@ -210,6 +211,10 @@ +
+ + +
@@ -282,11 +287,11 @@ success: function(data){ if(data==='completed'){ alert('Banques(s) activée(s)/désactivée(s)'); - location.reload(true); + location.reload(); }else{ alert(data); //alert("lang->line('error_message') ?>"); - location.reload(true); + location.reload(); } } }); @@ -321,12 +326,14 @@ id_bank = $(this).data('id-bank'); const bank_name = $(this).data('name-bank'); const bank_address = $(this).data('address-bank'); + const bank_code = $(this).data('code-bank'); id_country = $(this).data('id-country'); country = $(this).data('country'); $(".modal-body #modal-pays").val(country); $(".modal-body #name").val( bank_name ); $(".modal-body #address").val( bank_address ); + $(".modal-body #code").val( bank_code ); }); @@ -342,10 +349,10 @@ success: function(data){ if(data==='completed'){ alert("lang->line('bank_deleted') ?>"); - location.reload(true); + location.reload(); }else{ alert("lang->line('error_message') ?>"); - location.reload(true); + location.reload(); } } }); @@ -365,13 +372,13 @@ success: function(data){ if(data==='completed'){ alert("lang->line('bank_assigned') ?>"); - location.reload(true); + location.reload(); }else if(data==='existe'){ alert('Ce réseau a déjà été assigné à certains des pays sélectionnés'); - location.reload(true); + location.reload(); }else{ alert("lang->line('error_message') ?>"); - location.reload(true); + location.reload(); alert(data); } } @@ -390,10 +397,10 @@ success: function(data){ if(data==='completed'){ alert("lang->line('bank_added') ?>"); - location.reload(true); + location.reload(); }else{ alert("lang->line('error_message') ?>"); - location.reload(true); + location.reload(); } } }); @@ -403,18 +410,19 @@ $("#update-form").submit(function(event){ const name = $("#update-form #name").val(); const address = $("#update-form #address").val(); + const code = $("#update-form #code").val(); $.ajax({ url:'', 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', success: function(data){ if(data==='completed'){ alert("lang->line('bank_modified') ?>"); - location.reload(true); + location.reload(); }else{ alert("lang->line('error_message') ?>"); - location.reload(true); + location.reload(); } } }); diff --git a/application/views/gestion_banques_hyp.php b/application/views/gestion_banques_hyp.php index 6638b0f6..81fc9825 100755 --- a/application/views/gestion_banques_hyp.php +++ b/application/views/gestion_banques_hyp.php @@ -59,6 +59,7 @@ N° lang->line('Pays'); ?> lang->line('Nom'); ?> + lang->line('bank_code'); ?> lang->line('Adresse'); ?> lang->line('Statut'); ?> lang->line('Activer/Désactiver'); ?> @@ -74,6 +75,7 @@ $num $row->country $row->bank_name + $row->bank_code $row->bank_address"; ?> lang->line('export_transaction_history') ?>
- num_rows(); - $num = 0; - if ($numrows > 0) { - $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL ); - ?> @@ -152,84 +144,11 @@ function toLocateDate($date , $timezone){ - - - session->userdata('category') != 'super') { ?> - - - - - - - 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 " - - - - - - - - - - - - - - - - - - - - "; - ?> - session->userdata('category') != 'super') { ?> - -id_transaction ?> -canceled) echo "disabled" ?> -lang->line('cancel') ?> - - - - - - - - - lang->line('Aucune transaction'); - } - }else { - echo $this->lang->line('Aucune transaction'); - } - ?> - + + + +
lang->line('Commission de l\'agent') ?> lang->line('agent_name') ?> lang->line('issuer_id') ?>lang->line('recipient_id')?>Date
$row->id_transaction" . strtoupper($row->acteur) . ' - ' .($this->session->userdata('site_lang') === 'french' ? $row->operation_fr : $row->operation_en). "" . join(" ", str_split($row->numero_carte, 4)) . "" . $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', $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,$context)->formatTo('fr_FR')."".Money::of(round($row->taxe, 2),$row->init_currency,$context)->formatTo('fr_FR')."".Money::of(round($row->commission_banque ? $row->commission_banque : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."".Money::of(round($row->commission_hyp ? $row->commission_hyp : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."".Money::of(round($row->commission_sup ? $row->commission_sup : 0 , 2),$row->init_currency,$context)->formatTo('fr_FR')."".Money::of(round($row->commission_ag ? $row->commission_ag : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."".$agent."".$emetteur."".$destinataire."".toLocateDate($row->date,$this->session->userdata('timezone'))."
lang->line('recipient_id')?>Date
-
@@ -274,17 +193,35 @@ function toLocateDate($date , $timezone){ const lang = $('#picker').data('lang'); const format = lang === 'french' ? 'fr' : 'en'; moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date + 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": "", + "data":{ + "startDate" : "", + "endDate" : "", + "id_network" : + }, + "type": "POST" + }, "aaSorting": [[19, "desc"]], "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) }], dom: 'Bfrtip', "buttons": [ 'pageLength', { - extend: 'excelHtml5', + "extend": 'excelHtml5', title: "lang->line('Historique des transactions') ?>", // exportOptions: { // 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', @@ -310,7 +248,8 @@ function toLocateDate($date , $timezone){ exportOptions: { 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', @@ -320,7 +259,8 @@ function toLocateDate($date , $timezone){ exportOptions: { 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' ] @@ -328,6 +268,48 @@ function toLocateDate($date , $timezone){ table.buttons().container() .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(); + } });