diff --git a/application/views/demande_credit.php b/application/views/demande_credit.php
index 0bc1e021..a7b2c571 100755
--- a/application/views/demande_credit.php
+++ b/application/views/demande_credit.php
@@ -10,73 +10,6 @@
// use Carbon\Carbon;
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
- function duree($time)
- {
- $tabTemps = array("jours" => 86400,
- "h" => 3600,
- "m" => 60,
- "s" => 1);
- $result = "";
-
- foreach ($tabTemps as $uniteTemps => $nombreSecondesDansUnite) {
-
- $$uniteTemps = floor($time / $nombreSecondesDansUnite);
-
- $time = $time % $nombreSecondesDansUnite;
-
- if ($$uniteTemps > 0 || !empty($result)) {
-
- $result .= $$uniteTemps . " $uniteTemps ";
- }
- }
-
- return $result;
-
- }
-
- function dateDiff($date1, $date2,$class = null)
- {
- $diff = abs($date1 - $date2); // abs pour avoir la valeur absolute, ainsi éviter d'avoir une différence négative
- $retour = array();
-
- $tmp = $diff;
- $second = $tmp % 60;
-
- $tmp = floor(($tmp - $second) / 60);
- $minute = $tmp % 60;
-
- $tmp = floor(($tmp - $minute) / 60);
- $heure = $tmp % 24;
-
- $tmp = floor(($tmp - $heure) / 24);
- $jour = $tmp;
-
- return $class->lang->line('since').' ' . $jour . ' '.$class->lang->line('days').' ' . $heure . ' '.$class->lang->line('hours').' ' . $minute . ' '.$class->lang->line('minutes').' ' . $second . ' '.$class->lang->line('seconds');
- }
-
- function traitementTemps($time, $dateAjout , $class = null)
- {
- if ($time == null) {
- $now = time();
- $date2 = strtotime($dateAjout);
-
- return dateDiff($now, $date2,$class);
- } else {
- return duree($time);
- }
- }
-
- function getDelayOfTreatmentInSeconds($time, $dateAjout){
- if ($time == null) {
- $now = time();
- $date2 = strtotime($dateAjout);
- return abs($now - $date2);
- }else{
- return $time ;
- }
-
- }
-
// function toLocateDate($date , $timezone){
// if($date){
// $carbon = Carbon::createFromFormat('Y-m-d H:i:s', $date, 'UTC');
diff --git a/application/views/demande_credit_annulation.php b/application/views/demande_credit_annulation.php
index 30266967..e6089fe7 100755
--- a/application/views/demande_credit_annulation.php
+++ b/application/views/demande_credit_annulation.php
@@ -5,87 +5,6 @@
- 86400,
- "h" => 3600,
- "m" => 60,
- "s" => 1);
- $result = "";
-
- foreach ($tabTemps as $uniteTemps => $nombreSecondesDansUnite) {
-
- $$uniteTemps = floor($time / $nombreSecondesDansUnite);
-
- $time = $time % $nombreSecondesDansUnite;
-
- if ($$uniteTemps > 0 || !empty($result)) {
-
- $result .= $$uniteTemps . " $uniteTemps ";
- }
- }
-
- return $result;
-
- }
-
- function dateDiff($date1, $date2,$class = null)
- {
- $diff = abs($date1 - $date2); // abs pour avoir la valeur absolute, ainsi éviter d'avoir une différence négative
- $retour = array();
-
- $tmp = $diff;
- $second = $tmp % 60;
-
- $tmp = floor(($tmp - $second) / 60);
- $minute = $tmp % 60;
-
- $tmp = floor(($tmp - $minute) / 60);
- $heure = $tmp % 24;
-
- $tmp = floor(($tmp - $heure) / 24);
- $jour = $tmp;
-
- return $class->lang->line('since').' ' . $jour . ' '.$class->lang->line('days').' ' . $heure . ' '.$class->lang->line('hours').' ' . $minute . ' '.$class->lang->line('minutes').' ' . $second . ' '.$class->lang->line('seconds');
- }
-
- function traitementTemps($time, $dateAjout , $class = null)
- {
- if ($time == null) {
- $now = time();
- $date2 = strtotime($dateAjout);
-
- return dateDiff($now, $date2,$class);
- } else {
- return duree($time);
- }
- }
-
- function getDelayOfTreatmentInSeconds($time, $dateAjout){
- if ($time == null) {
- $now = time();
- $date2 = strtotime($dateAjout);
- return abs($now - $date2);
- }else{
- return $time ;
- }
-
- }
-
-// 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;
-// }
-
- ?>
- num_rows();
- $num = 0;
- if ($numrows > 0) {
-
- ?>
-
-
+ ID |
" . $this->lang->line('Emetteur') . " |
" . $this->lang->line('receiver'). " |
" . $this->lang->line('Montant') . " |
@@ -204,46 +113,6 @@
?>
-
-
- result() as $row) {
- $num++;
- $origin = $row->agent." | ".$row->phone;
- $destination = $row->name_parrain." | ".$row->phone_parrain;
- if ($row->codeMembre == $this->session->userdata('member_code')) {
- $origin = $this->lang->line('Vous');
- }
- if ($row->codeParrain == $this->session->userdata('member_code')) {
- $destination = $this->lang->line('Vous');
- }
-
- echo "
- ".$origin." |
- $destination |
- ". $fmt->format($row->montant)." |
- " . $row->dateAjout . " |
- " . $row->dateModif . " |
- " . traitementTemps($row->temps, $row->dateAjout,$this) . " | "; ?>
- = getDelayOfTreatmentInSeconds($row->temps, $row->dateAjout)/60 ?> |
- |
-
-
-
-
-
-
- lang->line('Aucune demande');
- }
- } else {
- echo $this->lang->line('Aucune demande');
- }
-
-
- ?>
@@ -293,14 +162,66 @@
const format = lang === 'french' ? 'fr' : 'en';
moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date
- $('#listeMembres1').DataTable({
- "aaSorting": [[3, "desc"]],
- "columnDefs": [{
- targets: [3, 4],
- render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format),
+ //$('#listeMembres1').DataTable({
+ // "aaSorting": [[4, "desc"]],
+ // "columnDefs": [{
+ // targets: [4, 5],
+ // render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format),
+ // },
+ // {
+ // "targets": [ 7 ],
+ // "visible": false
+ // }
+ // ],
+ // dom: 'Bfrtip',
+ // "buttons": [
+ // 'pageLength',
+ // {
+ // extend: 'excelHtml5',
+ // title: "//=$this->lang->line('incoming_credits_requests_accepted')?>//"
+ // },
+ // {
+ // extend: 'csvHtml5',
+ // title: "//=$this->lang->line('incoming_credits_requests_accepted')?>//"
+ // },
+ // {
+ // extend: 'pdfHtml5',
+ // orientation: 'landscape',
+ // pageSize: 'LEGAL',
+ // title: "//=$this->lang->line('incoming_credits_requests_accepted')?>//"
+ // }
+ // ]
+ //});
+
+ var table = $('#listeMembres1').DataTable({
+ // Processing indicator
+ "processing": true,
+ "language": {
+ "processing": "= $this->lang->line('loading') ?>"
},
+ // DataTables server-side processing mode
+ "serverSide": true,
+ // Initial no order.
+ "order": [],
+ // Load data from an Ajax source
+ "ajax": {
+ "url": "",
+ "data":{
+ "startDate" : "= $startDate?>",
+ "endDate" : "= $endDate?>",
+ "id_network" : = $id_network ?>
+ },
+ "type": "POST"
+ },
+ "aaSorting": [[4, "desc"]],
+ "columnDefs": [{
+ "targets": [4, 5],
+ // "orderable": false,
+ render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
+ },
+ { "orderable": false, "targets": 8 },
{
- "targets": [ 6 ],
+ "targets": [ 7 ],
"visible": false
}
],
@@ -308,22 +229,73 @@
"buttons": [
'pageLength',
{
- extend: 'excelHtml5',
- title: "=$this->lang->line('incoming_credits_requests_accepted')?>"
+ "extend": 'excelHtml5',
+ title: "= $this->lang->line('incoming_credits_requests_accepted') ?>",
+ trim: false,
+ "action": newexportaction
},
{
extend: 'csvHtml5',
- title: "=$this->lang->line('incoming_credits_requests_accepted')?>"
+ title: "= $this->lang->line('incoming_credits_requests_accepted') ?>",
+ trim: false,
+ "action": newexportaction
},
{
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'LEGAL',
- title: "=$this->lang->line('incoming_credits_requests_accepted')?>"
- }
+ title: "= $this->lang->line('incoming_credits_requests_accepted') ?>",
+ trim: false,
+ "action": newexportaction
+ },
+ // 'colvis'
]
});
+ 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();
+ }
});
diff --git a/application/views/historique_demande_credit_annulation.php b/application/views/historique_demande_credit_annulation.php
index 96c9aed1..8b11a33c 100755
--- a/application/views/historique_demande_credit_annulation.php
+++ b/application/views/historique_demande_credit_annulation.php
@@ -9,62 +9,6 @@
// use Carbon\Carbon;
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
- function duree($time)
- {
- $tabTemps = array("jours" => 86400,
- "h" => 3600,
- "m" => 60,
- "s" => 1);
- $result = "";
-
- foreach ($tabTemps as $uniteTemps => $nombreSecondesDansUnite) {
-
- $$uniteTemps = floor($time / $nombreSecondesDansUnite);
-
- $time = $time % $nombreSecondesDansUnite;
-
- if ($$uniteTemps > 0 || !empty($result)) {
-
- $result .= $$uniteTemps . " $uniteTemps ";
- }
- }
-
- return $result;
-
- }
-
- function dateDiff($date1, $date2,$class = null)
- {
- $diff = abs($date1 - $date2); // abs pour avoir la valeur absolute, ainsi éviter d'avoir une différence négative
- $retour = array();
-
- $tmp = $diff;
- $second = $tmp % 60;
-
- $tmp = floor(($tmp - $second) / 60);
- $minute = $tmp % 60;
-
- $tmp = floor(($tmp - $minute) / 60);
- $heure = $tmp % 24;
-
- $tmp = floor(($tmp - $heure) / 24);
- $jour = $tmp;
-
- return $class->lang->line('since').' ' . $jour . ' '.$class->lang->line('days').' ' . $heure . ' '.$class->lang->line('hours').' ' . $minute . ' '.$class->lang->line('minutes').' ' . $second . ' '.$class->lang->line('seconds');
- }
-
- function traitementTemps($time, $dateAjout , $class = null)
- {
- if ($time == null) {
- $now = time();
- $date2 = strtotime($dateAjout);
-
- return dateDiff($now, $date2,$class);
- } else {
- return duree($time);
- }
- }
-
?>