| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | <!-- DataTables --> | 
					
						
							|  |  |  |  | <link rel="stylesheet" | 
					
						
							|  |  |  |  | 	  href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>"> | 
					
						
							|  |  |  |  | <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <div class="content-wrapper"> | 
					
						
							| 
									
										
										
										
											2020-05-06 23:36:01 +00:00
										 |  |  |  | <?php | 
					
						
							|  |  |  |  | 	use Carbon\Carbon; | 
					
						
							|  |  |  |  | 	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; | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | ?>
 | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 	<!-- Content Header (Page header) --> | 
					
						
							|  |  |  |  | 	<section class="content-header"> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		<h1> | 
					
						
							| 
									
										
										
										
											2020-05-05 08:25:12 +00:00
										 |  |  |  | 			<?php echo isset($category) ? 'Wallet' :  $this->lang->line('Gestion des wallets') ; echo ' '.$network.' - '.$country; ?>
 | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | <!--			<input type="button" class="btn btn-primary pull-right" id="Bactiver"--> | 
					
						
							|  |  |  |  | <!--				   value="Activer/Désactiver le(s) réseau(x)" />--> | 
					
						
							|  |  |  |  | 		</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-md-4 col-sm-6 col-xs-12"> | 
					
						
							|  |  |  |  | 				<div class="info-box"> | 
					
						
							| 
									
										
										
										
											2020-05-01 09:30:08 +00:00
										 |  |  |  | 					<span class="info-box-icon bg-aqua"><i class="ion ion-android-time"></i></span> | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 					<div class="info-box-content"> | 
					
						
							| 
									
										
										
										
											2020-05-01 09:30:08 +00:00
										 |  |  |  | 						<span class="info-box-text"><?php echo $this->lang->line('Période') ?> </span>
 | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 						<span class="info-box-number"> | 
					
						
							| 
									
										
										
										
											2020-05-02 10:49:34 +00:00
										 |  |  |  |                                     <input id="picker" | 
					
						
							| 
									
										
										
										
											2020-05-05 08:25:12 +00:00
										 |  |  |  | 										style="background: #fff; cursor: pointer; padding: 1px 1px; border: 1px solid #ccc; width: 100%" data-category="<?php echo isset($category) ? $category : null ?>" | 
					
						
							| 
									
										
										
										
											2020-05-01 09:30:08 +00:00
										 |  |  |  | 										type="text" name="daterange" data-lang="<?php echo $this->session->userdata('site_lang') ?>" | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 										value="<?php echo ($startDate!=null & $endDate != null) ?  $startDate. ' - '.$endDate : ''?>"/> | 
					
						
							|  |  |  |  |                                      | 
					
						
							|  |  |  |  | 						</span> | 
					
						
							| 
									
										
										
										
											2020-05-02 10:49:34 +00:00
										 |  |  |  | 						<span> Format : <?php echo $this->session->userdata('site_lang') === 'french' ? 'Jour - Mois - Année ' : 'Year - Month - Day'?> </span>
 | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 					</div> | 
					
						
							|  |  |  |  | 				</div> | 
					
						
							|  |  |  |  | 			</div> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		</div> | 
					
						
							|  |  |  |  | 		<div class="row"> | 
					
						
							|  |  |  |  | 			<div class="col-xs-12"> | 
					
						
							|  |  |  |  | 				<div class="box"> | 
					
						
							|  |  |  |  | 					<div class="box-header"> | 
					
						
							| 
									
										
										
										
											2020-05-01 09:30:08 +00:00
										 |  |  |  | 						<h3 class="box-title"><?php echo $this->lang->line('Historique des transactions') ?></h3>
 | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 					</div> | 
					
						
							|  |  |  |  | 					<div class="box-body"> | 
					
						
							|  |  |  |  | 						<?php | 
					
						
							| 
									
										
										
										
											2020-04-28 22:23:15 +00:00
										 |  |  |  | 						if($transactions){ | 
					
						
							|  |  |  |  | 							$numrows = $transactions->num_rows(); | 
					
						
							|  |  |  |  | 							$num = 0; | 
					
						
							|  |  |  |  | 							if ($numrows > 0) { | 
					
						
							|  |  |  |  | 							$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL ); | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 							?>
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-28 22:23:15 +00:00
										 |  |  |  | 							<table id="transactions" class="table table-bordered table-striped"> | 
					
						
							|  |  |  |  | 								<thead> | 
					
						
							|  |  |  |  | 								<tr> | 
					
						
							|  |  |  |  | 									<th align='center'>ID</th> | 
					
						
							| 
									
										
										
										
											2020-05-02 10:49:34 +00:00
										 |  |  |  | 									<th align='center'>Type</th> | 
					
						
							| 
									
										
										
										
											2020-05-22 14:46:39 +00:00
										 |  |  |  | 									<th><?php echo $this->lang->line('cart_number') ?></th>
 | 
					
						
							|  |  |  |  | 									<th><?php echo $this->lang->line('customer_net_amount') ?></th>
 | 
					
						
							|  |  |  |  | 									<th><?php echo $this->lang->line('bank_deposit_amount') ?></th>
 | 
					
						
							| 
									
										
										
										
											2020-05-02 10:49:34 +00:00
										 |  |  |  | 									<th><?php echo $this->lang->line('Commission de la banque') ?></th>
 | 
					
						
							|  |  |  |  | 									<th><?php echo $this->lang->line('Commission de l\'hyperviseur') ?></th>
 | 
					
						
							|  |  |  |  | 									<th><?php echo $this->lang->line('Commission du superviseur') ?></th>
 | 
					
						
							|  |  |  |  | 									<th><?php echo $this->lang->line('Commission de l\'agent') ?></th>
 | 
					
						
							| 
									
										
										
										
											2020-04-28 22:23:15 +00:00
										 |  |  |  | 									<th align='center'>Date</th> | 
					
						
							|  |  |  |  | 								</tr> | 
					
						
							|  |  |  |  | 								</thead> | 
					
						
							|  |  |  |  | 								<tbody> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 								<?php | 
					
						
							| 
									
										
										
										
											2020-05-22 14:46:39 +00:00
										 |  |  |  | 									$config = $configWallet->first_row(); | 
					
						
							| 
									
										
										
										
											2020-04-28 22:23:15 +00:00
										 |  |  |  | 								foreach ($transactions->result() as $row) { | 
					
						
							|  |  |  |  | 									$num++; | 
					
						
							| 
									
										
										
										
											2020-05-02 10:49:34 +00:00
										 |  |  |  | 									$type = $row->type_transac == 'credit' ? $this->lang->line('DEPOT')  : $this->lang->line('RETRAIT'); | 
					
						
							| 
									
										
										
										
											2020-05-22 14:46:39 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 									$net = 0; | 
					
						
							|  |  |  |  | 									$banque = 0; | 
					
						
							|  |  |  |  | 									if($row->type_transac == 'credit'){ | 
					
						
							|  |  |  |  | 										$commission = ( $row->montant * $config->taux_com_client_depot / 100 ) + $config->frais_min_banque_depot; | 
					
						
							|  |  |  |  | 										$net = $row->montant - $commission; | 
					
						
							| 
									
										
										
										
											2020-06-01 11:21:06 +00:00
										 |  |  |  | 										$banque = $row->montant * (1 - ($config->taux_com_client_depot / 100)); | 
					
						
							| 
									
										
										
										
											2020-05-22 14:46:39 +00:00
										 |  |  |  | 									}else{ | 
					
						
							|  |  |  |  | 										$net = $row->montant ; | 
					
						
							|  |  |  |  | 									} | 
					
						
							| 
									
										
										
										
											2020-04-28 22:23:15 +00:00
										 |  |  |  | 									echo "<tr>
 | 
					
						
							|  |  |  |  | 											<td align='center' >$row->id</td> | 
					
						
							|  |  |  |  | 											<td>".strtoupper($type)."</td> | 
					
						
							| 
									
										
										
										
											2020-05-22 14:46:39 +00:00
										 |  |  |  | 											<td>".join(" ", str_split($row->numCarte, 4))."</td> | 
					
						
							|  |  |  |  | 											<td>".$fmt->format($net)."</td> | 
					
						
							|  |  |  |  | 											<td>".($row->type_transac == 'credit' ? $fmt->format($banque) : "")."</td> | 
					
						
							| 
									
										
										
										
											2020-04-28 22:23:15 +00:00
										 |  |  |  | 											<td>".$fmt->format( $row->commission_banque)."</td> | 
					
						
							|  |  |  |  | 											<td>".$fmt->format( $row->commission_hyp)."</td> | 
					
						
							|  |  |  |  | 											<td>".$fmt->format( $row->commission_sup)."</td> | 
					
						
							|  |  |  |  | 											<td>".$fmt->format( $row->commission_ag)."</td> | 
					
						
							| 
									
										
										
										
											2020-05-06 23:36:01 +00:00
										 |  |  |  | 											<td>".toLocateDate($row->date_created,$this->session->userdata('timezone'))."</td> | 
					
						
							| 
									
										
										
										
											2020-04-28 22:23:15 +00:00
										 |  |  |  | 											 </tr>";
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 								} | 
					
						
							|  |  |  |  | 								?>
 | 
					
						
							|  |  |  |  | 								</tbody> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 								<?php | 
					
						
							|  |  |  |  | 								} else { | 
					
						
							|  |  |  |  | 									echo $this->lang->line('Aucune transaction'); | 
					
						
							|  |  |  |  | 								} | 
					
						
							|  |  |  |  | 						}else { | 
					
						
							|  |  |  |  | 							 echo $this->lang->line('Aucune transaction'); | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 							} | 
					
						
							| 
									
										
										
										
											2020-04-28 22:23:15 +00:00
										 |  |  |  | 						?>
 | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 						</table> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 					</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> | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-02 10:49:34 +00:00
										 |  |  |  | <script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment-with-locales.min.js"></script> | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script> | 
					
						
							| 
									
										
										
										
											2020-05-02 10:49:34 +00:00
										 |  |  |  | <script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.19/sorting/datetime-moment.js"></script> | 
					
						
							|  |  |  |  | <script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.20/dataRender/datetime.js"></script> | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <script> | 
					
						
							|  |  |  |  | 	$(function () { | 
					
						
							| 
									
										
										
										
											2020-05-02 10:49:34 +00:00
										 |  |  |  | 		const lang =  $('#picker').data('lang'); | 
					
						
							|  |  |  |  | 		const format = lang === 'french' ? 'fr' : 'en'; | 
					
						
							|  |  |  |  | 		moment.updateLocale(moment.locale(format), { invalidDate: "" }); // Blank text when is invalid date
 | 
					
						
							| 
									
										
										
										
											2020-05-01 09:30:08 +00:00
										 |  |  |  | 		$('#transactions').DataTable({ | 
					
						
							| 
									
										
										
										
											2020-05-02 10:49:34 +00:00
										 |  |  |  | 			"aaSorting": [[ 0, "desc" ]], | 
					
						
							|  |  |  |  | 			"columnDefs": [ { | 
					
						
							| 
									
										
										
										
											2020-05-22 14:46:39 +00:00
										 |  |  |  | 				targets: 9, | 
					
						
							| 
									
										
										
										
											2020-05-02 10:49:34 +00:00
										 |  |  |  | 				render: $.fn.dataTable.render.moment( 'YYYY-MM-DD HH:mm:ss' , 'D MMMM YYYY HH:mm:ss', format) | 
					
						
							|  |  |  |  | 			}] | 
					
						
							| 
									
										
										
										
											2020-05-01 09:30:08 +00:00
										 |  |  |  | 		}); | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 	}); | 
					
						
							|  |  |  |  | </script> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <script type="text/javascript"> | 
					
						
							|  |  |  |  | 	var startDate; | 
					
						
							|  |  |  |  | 	var endDate; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	$(function () { | 
					
						
							| 
									
										
										
										
											2020-05-01 09:30:08 +00:00
										 |  |  |  | 		const lang =  $('#picker').data('lang'); | 
					
						
							| 
									
										
										
										
											2020-05-05 08:25:12 +00:00
										 |  |  |  | 		const category =  $('#picker').data('category'); | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 		$('input[name="daterange"]').daterangepicker({ | 
					
						
							|  |  |  |  | 			opens: 'left', | 
					
						
							|  |  |  |  | 			autoUpdateInput: false, | 
					
						
							|  |  |  |  | 			locale: { | 
					
						
							| 
									
										
										
										
											2020-05-01 09:30:08 +00:00
										 |  |  |  | 				format: lang === 'french' ? 'DD-MM-YYYY' : 'YYYY-MM-DD', | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 				cancelLabel: 'Clear' | 
					
						
							|  |  |  |  | 			} | 
					
						
							|  |  |  |  | 		}, function (start, end, label) { | 
					
						
							| 
									
										
										
										
											2020-04-28 22:23:15 +00:00
										 |  |  |  | 			const debut = start.format('YYYY-MM-DD'); | 
					
						
							|  |  |  |  | 			const fin = end.format('YYYY-MM-DD'); | 
					
						
							| 
									
										
										
										
											2020-05-05 08:25:12 +00:00
										 |  |  |  | 			if(category) | 
					
						
							|  |  |  |  | 				window.location = "<?php echo current_url()?>" + "?history=transaction" + "&d=" + debut + "&f=" + fin; | 
					
						
							|  |  |  |  | 			else | 
					
						
							|  |  |  |  | 				window.location = "<?php echo current_url()?>" + "?id=118&history=transaction" + "&d=" + debut + "&f=" + fin; | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 		}); | 
					
						
							| 
									
										
										
										
											2020-05-02 10:49:34 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 		$('input[name="daterange"]').on('cancel.daterangepicker', function(ev, picker) { | 
					
						
							|  |  |  |  | 			//do something, like clearing an input
 | 
					
						
							|  |  |  |  | 			$('#daterange').val(''); | 
					
						
							| 
									
										
										
										
											2020-05-05 08:25:12 +00:00
										 |  |  |  | 			if(category) | 
					
						
							|  |  |  |  | 				window.location = "<?php echo current_url()?>" + "?history=transaction"; | 
					
						
							|  |  |  |  | 			else | 
					
						
							|  |  |  |  | 				window.location = "<?php echo current_url()?>" + "?id=118&history=transaction"; | 
					
						
							| 
									
										
										
										
											2020-05-02 10:49:34 +00:00
										 |  |  |  | 		}); | 
					
						
							| 
									
										
										
										
											2020-04-24 10:40:34 +00:00
										 |  |  |  | 	}); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | </script> | 
					
						
							|  |  |  |  | 
 |