+ Add detect timezone for client browser

This commit is contained in:
DJERY-TOM 2020-05-07 00:36:01 +01:00
parent eb893a50fd
commit 2ad9e3d20d
12 changed files with 795 additions and 815 deletions

View File

@ -9,6 +9,7 @@ class Gestion extends CI_Controller
{ {
parent::_contruct(); parent::_contruct();
$this->load->model('user_model'); $this->load->model('user_model');
date_default_timezone_set ($this->session->userdata('timezone'));
} }
public function index() public function index()

View File

@ -13,6 +13,7 @@ class Hyperviseur_dash extends CI_Controller
{ {
parent::_contruct(); parent::_contruct();
$this->load->model('user_model'); $this->load->model('user_model');
date_default_timezone_set ($this->session->userdata('timezone'));
} }
public function index() public function index()

View File

@ -8,6 +8,7 @@ class Superviseur_dash extends CI_Controller
parent::__construct(); parent::__construct();
$this->load->model('Users_simple'); $this->load->model('Users_simple');
$this->load->model('User_model'); $this->load->model('User_model');
date_default_timezone_set ($this->session->userdata('timezone'));
} }
public function index() public function index()

View File

@ -77,6 +77,8 @@
$data = $this->user_model->login_user($user_login['user_email'], $user_login['user_password'], $user_login['user_role']); $data = $this->user_model->login_user($user_login['user_email'], $user_login['user_password'], $user_login['user_role']);
if ($data) { if ($data) {
$this->session->set_userdata('timezone' ,$this->input->post('timezone') );
date_default_timezone_set ($this->session->userdata('timezone'));
$hyper = "hyper"; $hyper = "hyper";
$super = "super"; $super = "super";

View File

@ -1,267 +1,278 @@
<!-- DataTables --> <!-- DataTables -->
<link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css"> <link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
<div class="content-wrapper"> <div class="content-wrapper">
<div class="content-header"> <div class="content-header">
<?php <?php
if($alert=="ok") { use Carbon\Carbon;
if(!$success=="ok"){ function toLocateDate($date , $timezone){
?> if($date){
<div class='alert alert-danger alert-dismissible'> $carbon = Carbon::createFromFormat('Y-m-d H:i:s', $date, 'UTC');
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button> $carbon->setTimezone($timezone);
<h4><i class='icon fa fa-ban'></i> Error!</h4> return $carbon->toDateTimeString();
<?php echo $message; ?> }
</div> return $date;
}
<?php ?>
} else { <?php
?> if($alert=="ok") {
<div class="alert alert-success alert-dismissible"> if(!$success=="ok"){
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> ?>
<h4><i class="icon fa fa-check"></i> Success!</h4> <div class='alert alert-danger alert-dismissible'>
<?php echo $message; ?> <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
</div> <h4><i class='icon fa fa-ban'></i> Error!</h4>
<?php echo $message; ?>
<?php </div>
}
} <?php
?> } else {
<h1><?php echo $this->lang->line('Codes générés'); ?></h1> ?>
</div> <div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<section class="content"> <h4><i class="icon fa fa-check"></i> Success!</h4>
<div class="box box-danger"> <?php echo $message; ?>
<div class="box-header with-border"> </div>
<h3 class="box-title"><?php echo $this->lang->line('Générateur de codes'); ?></h3>
</div> <?php
<div class="box-body"> }
<form name="form_login" action="<?php echo base_url('index.php/Gestion/generateCode') ?>" method="post"> }
<div class="row"> ?>
<div class="col-xs-3"> <h1><?php echo $this->lang->line('Codes générés'); ?></h1>
<input class="form-control" placeholder="<?php echo $this->lang->line('Entrez le nombre de codes'); ?>" type='number' name='c' min="1"/> </div>
</div>
<div class="col-xs-4"> <section class="content">
<input class="form-control" placeholder="Entrez le code membre" type='text' value="HYPER" readonly name='a'/> <div class="box box-danger">
</div> <div class="box-header with-border">
<div class="col-xs-5"> <h3 class="box-title"><?php echo $this->lang->line('Générateur de codes'); ?></h3>
<input class="btn btn-block btn-danger" name='b' type='submit' value='Generate'/> </div>
</div> <div class="box-body">
</div> <form name="form_login" action="<?php echo base_url('index.php/Gestion/generateCode') ?>" method="post">
</form> <div class="row">
</div> <div class="col-xs-3">
</div> <input class="form-control" placeholder="<?php echo $this->lang->line('Entrez le nombre de codes'); ?>" type='number' name='c' min="1"/>
<div class="box"> </div>
<div class="box-header"> <div class="col-xs-4">
<h3 class="box-title"><?php echo $this->lang->line('Tous les codes générés'); ?></h3> <input class="form-control" placeholder="Entrez le code membre" type='text' value="HYPER" readonly name='a'/>
</div> </div>
<div class="box-body"> <div class="col-xs-5">
<input class="btn btn-block btn-danger" name='b' type='submit' value='Generate'/>
<?php </div>
</div>
$sql1 = $list; </form>
if($sql1!=false){ </div>
$numrows=$sql1->num_rows(); </div>
$num=0; <div class="box">
<div class="box-header">
if ($numrows > 0) { <h3 class="box-title"><?php echo $this->lang->line('Tous les codes générés'); ?></h3>
</div>
<div class="box-body">
?>
<?php
<table id="codesGenerated" class="table table-bordered table-striped" >
<thead> $sql1 = $list;
<tr class='label-primary'> if($sql1!=false){
<th></th> $numrows=$sql1->num_rows();
<th><?php echo $this->lang->line('Code'); ?></th> $num=0;
<th><?php echo $this->lang->line('Catégorie'); ?></th>
<th><?php echo $this->lang->line('Créer le'); ?></th> if ($numrows > 0) {
<th><?php echo $this->lang->line('Statut'); ?></th>
<th><?php echo $this->lang->line('Supprimer'); ?></th>
</tr> ?>
</thead>
<tbody> <table id="codesGenerated" class="table table-bordered table-striped" >
<?php <thead>
<tr class='label-primary'>
// output data of each row <th></th>
foreach($sql1->result() as $row) { <th><?php echo $this->lang->line('Code'); ?></th>
$num ++; <th><?php echo $this->lang->line('Catégorie'); ?></th>
$statut = $this->lang->line('Non attribué'); <th><?php echo $this->lang->line('Créer le'); ?></th>
if($row->etat==1){ <th><?php echo $this->lang->line('Statut'); ?></th>
$statut = $this->lang->line('Attribué'); <th><?php echo $this->lang->line('Supprimer'); ?></th>
} </tr>
</thead>
<tbody>
<?php
echo "<tr>
// output data of each row
<td>$num</td> foreach($sql1->result() as $row) {
<td> $row->code_membre </td> $num ++;
<td >$row->category</td> $statut = $this->lang->line('Non attribué');
<td>$row->date_creation</td> if($row->etat==1){
<td>$statut</td> $statut = $this->lang->line('Attribué');
<td> }
<a href='#myModal-2".$num."' role='button' data-toggle='modal'><i class='fa fa-remove'></i></a>
<div class='modal small hide fade' id='myModal-2".$num."' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal' aria-hidden='true'>&#10007;</button> echo "<tr>
<h3 id='myModalLabel'>".$this->lang->line('Confirmer la suppression')."</h3>
</div> <td>$num</td>
<div class='modal-body'> <td> $row->code_membre </td>
<p class='error-text'><i class='icon-warning-sign modal-icon'></i>Voulez vous vraiment effacer</p> <td >$row->category</td>
</div> <td>".toLocateDate($row->date_creation,$this->session->userdata('timezone'))."</td>
<div class='modal-footer'> <td>$statut</td>
<button class='btn' data-dismiss='modal' aria-hidden='true'>Annuler</button> <td>
<a href='CodesG/suppr/?recordId=$row->id' role='button' class='btn btn-danger'> <a href='#myModal-2".$num."' role='button' data-toggle='modal'><i class='fa fa-remove'></i></a>
".$this->lang->line('Supprimer')."</a> <div class='modal small hide fade' id='myModal-2".$num."' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
</div> <div class='modal-header'>
</div> <button type='button' class='close' data-dismiss='modal' aria-hidden='true'>&#10007;</button>
</td> <h3 id='myModalLabel'>".$this->lang->line('Confirmer la suppression')."</h3>
</div>
</tr> "; <div class='modal-body'>
<p class='error-text'><i class='icon-warning-sign modal-icon'></i>Voulez vous vraiment effacer</p>
} </div>
<div class='modal-footer'>
?> <button class='btn' data-dismiss='modal' aria-hidden='true'>Annuler</button>
<a href='CodesG/suppr/?recordId=$row->id' role='button' class='btn btn-danger'>
<?php ".$this->lang->line('Supprimer')."</a>
} else { </div>
echo "No Datas generated"; </div>
} </td>
}else{
echo "No Datas generated"; </tr> ";
}
$this->db->close(); }
?> ?>
</tbody>
</table> <?php
</div> } else {
echo "No Datas generated";
</section> }
</div> }else{
<!-- jQuery 3 --> echo "No Datas generated";
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script> }
<!-- Bootstrap 3.3.7 --> $this->db->close();
<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> </tbody>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script> </table>
<!-- SlimScroll --> </div>
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick --> </section>
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script> </div>
<!-- AdminLTE App --> <!-- jQuery 3 -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script> <script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- AdminLTE for demo purposes --> <!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script> <script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script> <script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
$(function () { <script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
$('#codesGenerated').DataTable(); <!-- SlimScroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
}); <!-- FastClick -->
</script> <script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script type='text/javascript'> <script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
$(document).ready(function(){ <!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
$('#pays').change(function(){
var pays = $(this).val(); <script>
$.ajax({ $(function () {
url:'<?php echo base_url('index.php/Admin/getHypByPays')?>', $('#codesGenerated').DataTable();
type: 'post',
data: {pays: pays}, });
dataType: 'json', </script>
success: function(data){
var len = data.length; <script type='text/javascript'>
$(document).ready(function(){
if(len > 0){
$('#pays').change(function(){
var select = document.getElementById('hyper'); var pays = $(this).val();
$(select).empty(); $.ajax({
url:'<?php echo base_url('index.php/Admin/getHypByPays')?>',
for (var i in data) { type: 'post',
$(select).append('<option value=' + data[i].member_code + '>' + data[i].lastname +'-' + data[i].network + ' ('+ data[i].member_code +')</option>'); data: {pays: pays},
} dataType: 'json',
$(select).append("<option value='all' >Voir tout --</option>"); success: function(data){
var len = data.length;
var code = data[0].member_code;
if(len > 0){
$.ajax({
url:'<?php echo base_url('index.php/Admin/getVilleByHyp')?>', var select = document.getElementById('hyper');
type: 'post', $(select).empty();
data: {code: code,pays:pays},
dataType: 'json', for (var i in data) {
success: function(list){ $(select).append('<option value=' + data[i].member_code + '>' + data[i].lastname +'-' + data[i].network + ' ('+ data[i].member_code +')</option>');
var len = list.length; }
$(select).append("<option value='all' >Voir tout --</option>");
if(len > 0){
var code = data[0].member_code;
var select = document.getElementById('ville');
$(select).empty(); $.ajax({
url:'<?php echo base_url('index.php/Admin/getVilleByHyp')?>',
for (var i in list) { type: 'post',
$(select).append('<option value=' + list[i].ville + '>' + list[i].ville +'</option>'); data: {code: code,pays:pays},
} dataType: 'json',
$(select).append("<option value='all' >Voir tout --</option>"); success: function(list){
var len = list.length;
}else{ if(len > 0){
var select = document.getElementById('ville'); var select = document.getElementById('ville');
$(select).empty(); $(select).empty();
$(select).append("<option value='all' >Voir tout --</option>");
for (var i in list) {
} $(select).append('<option value=' + list[i].ville + '>' + list[i].ville +'</option>');
}
} $(select).append("<option value='all' >Voir tout --</option>");
});
}else{
}else{
var select = document.getElementById('ville');
var select = document.getElementById('hyper'); $(select).empty();
$(select).empty(); $(select).append("<option value='all' >Voir tout --</option>");
$(select).append("<option value='all' >Voir tout --</option>");
}
var select2 = document.getElementById('ville');
$(select2).empty(); }
$(select2).append("<option value='all' >Voir tout --</option>"); });
}
} }else{
});
}); var select = document.getElementById('hyper');
$(select).empty();
$('#hyper').change(function(){ $(select).append("<option value='all' >Voir tout --</option>");
var code = $(this).val();
$.ajax({ var select2 = document.getElementById('ville');
url:'<?php echo base_url('index.php/Admin/getVilleByHyp')?>', $(select2).empty();
type: 'post', $(select2).append("<option value='all' >Voir tout --</option>");
data: {code: code}, }
dataType: 'json',
success: function(list){ }
var len = list.length; });
});
if(len > 0){
$('#hyper').change(function(){
var select = document.getElementById('ville'); var code = $(this).val();
$(select).empty(); $.ajax({
url:'<?php echo base_url('index.php/Admin/getVilleByHyp')?>',
for (var i in list) { type: 'post',
$(select).append('<option value=' + list[i].ville + '>' + list[i].ville +'</option>'); data: {code: code},
} dataType: 'json',
$(select).append("<option value='all' >Voir tout --</option>"); success: function(list){
var len = list.length;
}else{
if(len > 0){
var select = document.getElementById('ville');
$(select).empty(); var select = document.getElementById('ville');
$(select).append("<option value='all' >Voir tout --</option>"); $(select).empty();
} for (var i in list) {
$(select).append('<option value=' + list[i].ville + '>' + list[i].ville +'</option>');
} }
}); $(select).append("<option value='all' >Voir tout --</option>");
});
}); }else{
</script>
var select = document.getElementById('ville');
$(select).empty();
$(select).append("<option value='all' >Voir tout --</option>");
}
}
});
});
});
</script>

View File

@ -5,6 +5,7 @@
<div class="content-wrapper"> <div class="content-wrapper">
<?php <?php
use Carbon\Carbon;
function duree($time) { function duree($time) {
$tabTemps = array("jours" => 86400, $tabTemps = array("jours" => 86400,
"h" => 3600, "h" => 3600,
@ -58,6 +59,14 @@
return duree($time); return duree($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;
}
?> ?>
<section class="content"> <section class="content">
@ -88,12 +97,12 @@
<div class="info-box"> <div class="info-box">
<span class="info-box-icon bg-aqua"><i class="ion ion-android-time"></i></span> <span class="info-box-icon bg-aqua"><i class="ion ion-android-time"></i></span>
<div class="info-box-content"> <div class="info-box-content">
<?php <!-- --><?php
if($this->session->userdata('category') == "super"){ // if($this->session->userdata('category') == "super"){
if(isset($nameOfcurentGeolocatedUser)) // if(isset($nameOfcurentGeolocatedUser))
echo "<span class='info-box-number'>".$nameOfcurentGeolocatedUser."</span>"; // echo "<span class='info-box-number'>".$nameOfcurentGeolocatedUser."</span>";
} // }
?> // ?>
<span class="info-box-text"> <?php echo $this->lang->line('Période') ?> </span> <span class="info-box-text"> <?php echo $this->lang->line('Période') ?> </span>
<span class="info-box-number"> <span class="info-box-number">
<input id="picker" style="background: #fff; cursor: pointer; padding: 1px 1px; border: 1px solid #ccc; width: 100%" type="text" name="daterange" data-lang="<?php echo $this->session->userdata('site_lang') ?>" <input id="picker" style="background: #fff; cursor: pointer; padding: 1px 1px; border: 1px solid #ccc; width: 100%" type="text" name="daterange" data-lang="<?php echo $this->session->userdata('site_lang') ?>"
@ -162,8 +171,8 @@
<td> $row->phone </td> <td> $row->phone </td>
<td >Super </td> <td >Super </td>
<td>$row->code_membre</td> <td>$row->code_membre</td>
<td>$row->date_creation </td> <td>".toLocateDate($row->date_creation,$this->session->userdata('timezone'))."</td>
<td > $row->date_modified</td> <td > ".toLocateDate($row->date_modified,$this->session->userdata('timezone'))."</td>
<td>$etat</td> <td>$etat</td>
<td>".traitementTemps($row->temps,$row->date_creation)."</td> <td>".traitementTemps($row->temps,$row->date_creation)."</td>
@ -237,8 +246,8 @@
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$superviseur</td> <td>$superviseur</td>
<td>$row->dateA</td> <td>".toLocateDate($row->dateA,$this->session->userdata('timezone'))."</td>
<td>$row->dateM</td> <td > ".toLocateDate($row->dateM,$this->session->userdata('timezone'))."</td>
<td>".duree($row->temps)."</td> <td>".duree($row->temps)."</td>
</tr>"; </tr>";
@ -305,29 +314,16 @@
if($row->superviseur==$this->session->userdata('member_code')){ if($row->superviseur==$this->session->userdata('member_code')){
$superviseur = $this->lang->line('Vous'); $superviseur = $this->lang->line('Vous');
} }
if($type==$this->lang->line('Adhésion')){
echo "<tr> echo "<tr>
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$superviseur</td> <td>$superviseur</td>
<td>$row->dateA</td> <td>".toLocateDate($row->dateA,$this->session->userdata('timezone'))."</td>
<td>$row->dateM</td> <td> ".toLocateDate($row->dateM,$this->session->userdata('timezone'))."</td>
<td>".duree($row->temps)."</td>
</tr>";}else{
echo "<tr>
<td>$num</td>
<td>$row->emetteur</td>
<td>$superviseur</td>
<td>$row->montant</td>
<td>$row->dateA</td>
<td>$row->dateM</td>
<td>".duree($row->temps)."</td> <td>".duree($row->temps)."</td>
</tr>"; </tr>";
}
} }
?> ?>
</tbody> </tbody>

View File

@ -5,6 +5,7 @@
<div class="content-wrapper"> <div class="content-wrapper">
<?php <?php
use Carbon\Carbon;
function duree($time) function duree($time)
{ {
$tabTemps = array("jours" => 86400, $tabTemps = array("jours" => 86400,
@ -61,6 +62,15 @@
} }
} }
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;
}
?> ?>
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
@ -216,26 +226,6 @@
// output data of each row // output data of each row
foreach ($result->result() as $row) { foreach ($result->result() as $row) {
$num++; $num++;
if ($type == $this->lang->line('Adhésion')) {
$etat = $this->lang->line("Non traitée");
if ($row->etat == 1) {
$etat = $this->lang->line("traitée");
}
$code = $row->code_membre;
if ($row->code_membre == $this->session->userdata('member_code')) {
$code = $this->lang->line('Vous');
}
echo "<tr>
<td> $row->phone </td>
<td>$code</td>
<td>$row->dateAjout </td>
<td > $row->dateModif</td>
<td>$etat</td>
<td>" . traitementTemps($row->temps, $row->dateAjout) . "</td>
</tr>";
} else {
$etat = $this->lang->line("Non traitée"); $etat = $this->lang->line("Non traitée");
if ($row->statut == 1) { if ($row->statut == 1) {
$etat = $this->lang->line("Acceptée"); $etat = $this->lang->line("Acceptée");
@ -251,17 +241,16 @@
$destination = $this->lang->line('Vous'); $destination = $this->lang->line('Vous');
} }
echo "<tr> echo "<tr>
<td> $row->phone</td> <td> $row->phone</td>
<td >$origin </td> <td >$origin </td>
<td > $row->montant</td> <td > $row->montant</td>
<td>$row->dateAjout </td> <td>".toLocateDate($row->dateAjout,$this->session->userdata('timezone'))."</td>
<td > $row->dateModif</td> <td > ".toLocateDate($row->dateModif,$this->session->userdata('timezone'))."</td>
<td>$etat</td> <td>$etat</td>
<td>" . traitementTemps($row->temps, $row->dateAjout) . "</td> <td>" . traitementTemps($row->temps, $row->dateAjout) . "</td>
</tr>"; </tr>";
}
} }
?> ?>
</tbody> </tbody>
@ -325,27 +314,7 @@
// output data of each row // output data of each row
foreach ($result->result() as $row) { foreach ($result->result() as $row) {
$num++; $num++;
if ($type == $this->lang->line('Adhésion')) {
$etat = $this->lang->line("Non traitée");
if ($row->etat == 1) {
$etat = $this->lang->line("traitée");
}
$code = $row->code;
if ($row->code == $this->session->userdata('member_code')) {
$code = $this->lang->line('Vous');
}
echo "<tr>
<td> $row->phone </td>
<td >$row->categorie </td>
<td>$code</td>
<td>$row->dateAjout </td>
<td > $row->dateModif</td>
<td>$etat</td>
<td>" . traitementTemps($row->temps, $row->dateAjout) . "</td>
</tr>";
} else {
$etat = $this->lang->line("Non traitée"); $etat = $this->lang->line("Non traitée");
if ($row->statut == 1) { if ($row->statut == 1) {
$etat = $this->lang->line("Acceptée"); $etat = $this->lang->line("Acceptée");
@ -363,13 +332,13 @@
echo "<tr> echo "<tr>
<td > $row->montant</td> <td > $row->montant</td>
<td>$row->dateAjout </td> <td>".toLocateDate($row->dateAjout,$this->session->userdata('timezone'))."</td>
<td > $row->dateModif</td> <td > ".toLocateDate($row->dateModif,$this->session->userdata('timezone'))."</td>
<td>$etat</td> <td>$etat</td>
<td>" . traitementTemps($row->temps, $row->dateAjout) . "</td> <td>" . traitementTemps($row->temps, $row->dateAjout) . "</td>
</tr>"; </tr>";
}
} }
?> ?>
</tbody> </tbody>
@ -439,35 +408,19 @@
if ($row->superviseur == $this->session->userdata('member_code')) { if ($row->superviseur == $this->session->userdata('member_code')) {
$superviseur = $this->lang->line('Vous'); $superviseur = $this->lang->line('Vous');
} }
if ($type == $this->lang->line('Adhésion')) {
$etat = $this->lang->line("Non traitée");
if ($row->etat == 1) {
$etat = $this->lang->line("traitée");
}
echo "<tr> echo "<tr>
<td>$num</td>
<td>$row->emetteur</td>
<td>$superviseur</td>
<td>$row->dateA</td>
<td>$row->dateM</td>
<td>" . duree($row->temps) . "</td>
</tr>";
} else {
echo "<tr>
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$superviseur</td> <td>$superviseur</td>
<td>$row->montant</td> <td>$row->montant</td>
<td>$row->dateA</td> <td>".toLocateDate($row->dateA,$this->session->userdata('timezone'))."</td>
<td>$row->dateM</td> <td > ".toLocateDate($row->dateM,$this->session->userdata('timezone'))."</td>
<td>" . duree($row->temps) . "</td> <td>" . duree($row->temps) . "</td>
</tr>"; </tr>";
}
} }
?> ?>
</tbody> </tbody>
@ -535,31 +488,19 @@
if ($row->superviseur == $this->session->userdata('member_code')) { if ($row->superviseur == $this->session->userdata('member_code')) {
$superviseur = $this->lang->line('Vous'); $superviseur = $this->lang->line('Vous');
} }
if ($type == $this->lang->line('Adhésion')) {
echo "<tr> echo "<tr>
<td>$num</td>
<td>$row->emetteur</td>
<td>$superviseur</td>
<td>$row->dateA</td>
<td>$row->dateM</td>
<td>" . duree($row->temps) . "</td>
</tr>";
} else {
echo "<tr>
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$superviseur</td> <td>$superviseur</td>
<td>$row->montant</td> <td>$row->montant</td>
<td>$row->dateA</td> <td>".toLocateDate($row->dateA,$this->session->userdata('timezone'))."</td>
<td>$row->dateM</td> <td> ".toLocateDate($row->dateM,$this->session->userdata('timezone'))."</td>
<td>" . duree($row->temps) . "</td> <td>" . duree($row->temps) . "</td>
</tr>"; </tr>";
}
} }
?> ?>
</tbody> </tbody>
@ -629,30 +570,19 @@
if ($row->superviseur == $this->session->userdata('member_code')) { if ($row->superviseur == $this->session->userdata('member_code')) {
$superviseur = $this->lang->line('Vous'); $superviseur = $this->lang->line('Vous');
} }
if ($type == $this->lang->line('Adhésion')) {
echo "<tr>
<td>$num</td>
<td>$row->emetteur</td>
<td>$superviseur</td>
<td>$row->dateA</td>
<td>$row->dateM</td>
<td>" . duree($row->temps) . "</td>
</tr>";
} else {
echo "<tr> echo "<tr>
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$superviseur</td> <td>$superviseur</td>
<td>$row->montant</td> <td>$row->montant</td>
<td>$row->dateA</td> <td>".toLocateDate($row->dateA,$this->session->userdata('timezone'))."</td>
<td>$row->dateM</td> <td> ".toLocateDate($row->dateM,$this->session->userdata('timezone'))."</td>
<td>" . duree($row->temps) . "</td> <td>" . duree($row->temps) . "</td>
</tr>"; </tr>";
}
} }
?> ?>
</tbody> </tbody>
@ -732,30 +662,19 @@
if ($row->superviseur == $this->session->userdata('member_code')) { if ($row->superviseur == $this->session->userdata('member_code')) {
$superviseur = $this->lang->line('Vous'); $superviseur = $this->lang->line('Vous');
} }
if ($type == $this->lang->line('Adhésion')) {
echo "<tr>
<td>$num</td>
<td>$row->emetteur</td>
<td>$superviseur</td>
<td>$row->dateA</td>
<td>$row->dateM</td>
<td>" . duree($row->temps) . "</td>
</tr>";
} else {
echo "<tr> echo "<tr>
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$superviseur</td> <td>$superviseur</td>
<td>$row->montant</td> <td>$row->montant</td>
<td>$row->dateA</td> <td>".toLocateDate($row->dateA,$this->session->userdata('timezone'))."</td>
<td>$row->dateM</td> <td> ".toLocateDate($row->dateM,$this->session->userdata('timezone'))."</td>
<td>" . duree($row->temps) . "</td> <td>" . duree($row->temps) . "</td>
</tr>"; </tr>";
}
} }
?> ?>
</tbody> </tbody>
@ -843,8 +762,8 @@
<td >$origin </td> <td >$origin </td>
<td>$destination</td> <td>$destination</td>
<td > $row->montant</td> <td > $row->montant</td>
<td>$row->dateAjout </td> <td>".toLocateDate($row->dateAjout,$this->session->userdata('timezone'))."</td>
<td > $row->dateModif</td> <td> ".toLocateDate($row->dateModif,$this->session->userdata('timezone'))."</td>
<td>$etat</td> <td>$etat</td>
<td>" . traitementTemps($row->temps, $row->dateAjout) . "</td> <td>" . traitementTemps($row->temps, $row->dateAjout) . "</td>
@ -923,8 +842,8 @@
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$superviseur</td> <td>$superviseur</td>
<td>$row->montant</td> <td>$row->montant</td>
<td>$row->dateA</td> <td>".toLocateDate($row->dateA,$this->session->userdata('timezone'))."</td>
<td>$row->dateM</td> <td> ".toLocateDate($row->dateM,$this->session->userdata('timezone'))."</td>
<td>" . duree($row->temps) . "</td> <td>" . duree($row->temps) . "</td>
</tr>"; </tr>";
@ -1001,8 +920,8 @@
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$superviseur</td> <td>$superviseur</td>
<td>$row->montant</td> <td>$row->montant</td>
<td>$row->dateA</td> <td>".toLocateDate($row->dateA,$this->session->userdata('timezone'))."</td>
<td>$row->dateM</td> <td> ".toLocateDate($row->dateM,$this->session->userdata('timezone'))."</td>
<td>" . duree($row->temps) . "</td> <td>" . duree($row->temps) . "</td>
</tr>"; </tr>";

View File

@ -4,7 +4,17 @@
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
<div class="content-wrapper"> <div class="content-wrapper">
<?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;
}
?>
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
@ -92,7 +102,7 @@
echo "<tr> echo "<tr>
<td align='center' >$num</td> <td align='center' >$num</td>
<td>".$fmt->format($row->montant)."</td> <td>".$fmt->format($row->montant)."</td>
<td> $row->date</td> <td>".toLocateDate($row->date,$this->session->userdata('timezone'))."</td>
</tr>"; </tr>";
} }
?> ?>

View File

@ -4,7 +4,17 @@
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
<div class="content-wrapper"> <div class="content-wrapper">
<?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;
}
?>
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
@ -103,7 +113,7 @@
<td>".$fmt->format( $row->commission_hyp)."</td> <td>".$fmt->format( $row->commission_hyp)."</td>
<td>".$fmt->format( $row->commission_sup)."</td> <td>".$fmt->format( $row->commission_sup)."</td>
<td>".$fmt->format( $row->commission_ag)."</td> <td>".$fmt->format( $row->commission_ag)."</td>
<td> $row->date_created</td> <td>".toLocateDate($row->date_created,$this->session->userdata('timezone'))."</td>
</tr>"; </tr>";
} }

View File

@ -60,7 +60,7 @@
} }
?> ?>
<form action="<?php echo base_url('index.php/login_user') ?>" method="post" class="bottom-75"> <form id="loginForm" action="<?php echo base_url('index.php/login_user') ?>" method="post" class="bottom-75">
<div class="table-form"> <div class="table-form">
<div class="form-groups"> <div class="form-groups">
<div class="input-group date" style="margin-bottom : 10px;"> <div class="input-group date" style="margin-bottom : 10px;">
@ -164,6 +164,22 @@
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script> <script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- iCheck --> <!-- iCheck -->
<script src="<?php echo base_url('plugins/iCheck/icheck.min.js') ?>"></script> <script src="<?php echo base_url('plugins/iCheck/icheck.min.js') ?>"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.7/jstz.min.js"></script>
<script>
$(document).ready(function(){
var tz = jstz.determine(); // Determines the time zone of the browser client
var timezone = tz.name(); //For e.g.:"Asia/Kolkata" for the Indian Time.
// Insert client timezone on login
$("#loginForm").submit( function(eventObj) {
$("<input />").attr("type", "hidden")
.attr("name", "timezone")
.attr("value", timezone)
.appendTo("#loginForm");
return true;
});
});
</script>
<script> <script>
$(function () { $(function () {
$('input').iCheck({ $('input').iCheck({

View File

@ -1,399 +1,411 @@
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>"> <link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<div class="content-wrapper"> <div class="content-wrapper">
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
<?php <?php
$site_url = base_url(); use Carbon\Carbon;
function toLocateDate($date , $timezone){
if($alert=="ok") { if($date){
$carbon = Carbon::createFromFormat('Y-m-d H:i:s', $date, 'UTC');
if(!$success=="ok"){ $carbon->setTimezone($timezone);
?> return $carbon->toDateTimeString();
<div class='alert alert-danger alert-dismissible'> }
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button> return $date;
<h4><i class='icon fa fa-ban'></i> Error!</h4> }
<?php echo $message; ?> ?>
</div>
<?php
<?php $site_url = base_url();
} else {
?> if($alert=="ok") {
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> if(!$success=="ok"){
<h4><i class="icon fa fa-check"></i> Success!</h4> ?>
<?php echo $message; ?> <div class='alert alert-danger alert-dismissible'>
</div> <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Error!</h4>
<?php <?php echo $message; ?>
} </div>
}
?> <?php
<h1> } else {
<?php echo $this->lang->line("Demandes d'adhésions et codes valides"); ?> ?>
</h1> <div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
</section> <h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
<!-- Main content --> </div>
<section class="content">
<div class="row"> <?php
<div class="col-xs-6"> }
}
?>
<div class="box"> <h1>
<div class="box-header"> <?php echo $this->lang->line("Demandes d'adhésions et codes valides"); ?>
<h3 class="box-title"><?php echo $this->lang->line("Demandes adhésion"); ?></h3> </h1>
</div>
<!-- /.box-header --> </section>
<div class="box-body">
<?php <!-- Main content -->
<section class="content">
$sql2 = $list_dem; <div class="row">
if($sql2!=false){ <div class="col-xs-6">
$numrows=$sql2->num_rows();
$num = 3000;
if ($numrows > 0) { <div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line("Demandes adhésion"); ?></h3>
</div>
?> <!-- /.box-header -->
<table id="validated" class="table table-bordered table-striped"> <div class="box-body">
<thead> <?php
<tr>
<th><?php echo $this->lang->line("Téléphone"); ?></th> $sql2 = $list_dem;
<th><?php echo $this->lang->line("Parrain"); ?></th> if($sql2!=false){
<th><?php echo $this->lang->line("Reseau"); ?></th> $numrows=$sql2->num_rows();
<th><?php echo $this->lang->line("Statut"); ?></th> $num = 3000;
<th><?php echo $this->lang->line("Date de la demande"); ?></th> if ($numrows > 0) {
<th><?php echo $this->lang->line("Supprimer"); ?></th>
</tr>
</thead>
<tbody> ?>
<table id="validated" class="table table-bordered table-striped">
<thead>
<?php <tr>
<th><?php echo $this->lang->line("Téléphone"); ?></th>
// output data of each row <th><?php echo $this->lang->line("Parrain"); ?></th>
foreach($sql2->result() as $row) { <th><?php echo $this->lang->line("Reseau"); ?></th>
$etat = $this->lang->line("Non traitée"); <th><?php echo $this->lang->line("Statut"); ?></th>
if($row->etat==1){ <th><?php echo $this->lang->line("Date de la demande"); ?></th>
$etat = $this->lang->line("traitée"); <th><?php echo $this->lang->line("Supprimer"); ?></th>
} </tr>
$num ++; </thead>
//$member_code = randomString1(10); <tbody>
echo "<tr>
<td> $row->phone</td>
<td >$row->code_membre </td> <?php
<td>$row->network</td>
<td>$etat</td> // output data of each row
<td >$row->date_creation</td>"; foreach($sql2->result() as $row) {
if($row->etat==0){ $etat = $this->lang->line("Non traitée");
echo " if($row->etat==1){
<td> $etat = $this->lang->line("traitée");
<a href='#myModal-1".$num."' role='button' class='btn btn-block btn-danger' data-toggle='modal'><i class='fa fa-remove'></i></a> }
<div class='modal fade' id='myModal-1".$num."' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'> $num ++;
<div class='modal-dialog'> //$member_code = randomString1(10);
<div class='modal-content'> echo "<tr>
<div class='modal-header'> <td> $row->phone</td>
<button type='button' class='close' data-dismiss='modal' aria-label='Close'> <td >$row->code_membre </td>
<span aria-hidden='true'>&times;</span></button> <td>$row->network</td>
<h4 class='modal-title'>".$this->lang->line('Confirmer la suppression')."</h4> <td>$etat</td>
</div> <td >".toLocateDate($row->date_creation,$this->session->userdata('timezone'))."</td>";
<div class='modal-body'> if($row->etat==0){
<p class='error-text'><i class='icon-warning-sign modal-icon'></i>".$this->lang->line('Message suppression')." ". $row->phone."?</p> echo "
</div> <td>
<div class='modal-footer'> <a href='#myModal-1".$num."' role='button' class='btn btn-block btn-danger' data-toggle='modal'><i class='fa fa-remove'></i></a>
<button type='button' class='btn btn-default pull-left' data-dismiss='modal'>".$this->lang->line('Fermer')."</button> <div class='modal fade' id='myModal-1".$num."' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<a href='".$site_url."Member_code_admin/delete/?recordId=".$row->phone."' role='button' class='btn btn-danger'> <div class='modal-dialog'>
".$this->lang->line('Supprimer')."</a> <div class='modal-content'>
</div> <div class='modal-header'>
</div> <button type='button' class='close' data-dismiss='modal' aria-label='Close'>
<!-- /.modal-content --> <span aria-hidden='true'>&times;</span></button>
</div> <h4 class='modal-title'>".$this->lang->line('Confirmer la suppression')."</h4>
<!-- /.modal-dialog --> </div>
</div> <div class='modal-body'>
</td>"; <p class='error-text'><i class='icon-warning-sign modal-icon'></i>".$this->lang->line('Message suppression')." ". $row->phone."?</p>
} </div>
echo "</tr>"; <div class='modal-footer'>
<button type='button' class='btn btn-default pull-left' data-dismiss='modal'>".$this->lang->line('Fermer')."</button>
} <a href='".$site_url."Member_code_admin/delete/?recordId=".$row->phone."' role='button' class='btn btn-danger'>
".$this->lang->line('Supprimer')."</a>
?> </div>
</tbody> </div>
</table> <!-- /.modal-content -->
</div>
<?php <!-- /.modal-dialog -->
</div>
} </td>";
}
else { echo "</tr>";
echo $this->lang->line('Aucune demande');
} }
}
?> ?>
</tbody>
</table>
<?php
</div>
<!-- /.box-body --> }
</div>
<!-- /.box --> else {
</div> echo $this->lang->line('Aucune demande');
<div class="col-xs-6"> }
}
?>
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line("Codes valides"); ?></h3>
</div>
<!-- /.box-header --> </div>
<div class="box-body"> <!-- /.box-body -->
<?php </div>
<!-- /.box -->
$sql1 = $list_codes; </div>
if($sql1!=false){ <div class="col-xs-6">
$numrows=$sql1->num_rows();
$num = 0;
<div class="box">
if ($numrows > 0) { <div class="box-header">
?> <h3 class="box-title"><?php echo $this->lang->line("Codes valides"); ?></h3>
</div>
<table id="unvalidated" class="table table-bordered table-striped"> <!-- /.box-header -->
<thead> <div class="box-body">
<tr> <?php
<th><?php echo $this->lang->line("Code"); ?></th>
<th><?php echo $this->lang->line("Catégorie"); ?></th> $sql1 = $list_codes;
<th><?php echo $this->lang->line("Statut"); ?></th> if($sql1!=false){
<th><?php echo $this->lang->line("Créer le"); ?></th> $numrows=$sql1->num_rows();
<th><?php echo $this->lang->line("Parrain"); ?></th> $num = 0;
<th><?php echo $this->lang->line("Supprimer"); ?></th>
</tr> if ($numrows > 0) {
</thead> ?>
<tbody>
<table id="unvalidated" class="table table-bordered table-striped">
<?php <thead>
<tr>
// output data of each row <th><?php echo $this->lang->line("Code"); ?></th>
foreach($sql1->result() as $row) { <th><?php echo $this->lang->line("Catégorie"); ?></th>
$etat = $this->lang->line("Non assigné"); <th><?php echo $this->lang->line("Statut"); ?></th>
if($row->etat==1){ <th><?php echo $this->lang->line("Créer le"); ?></th>
$etat = $this->lang->line("assigné"); <th><?php echo $this->lang->line("Parrain"); ?></th>
} <th><?php echo $this->lang->line("Supprimer"); ?></th>
</tr>
$num ++; </thead>
echo "<tr> <tbody>
<td> $row->code_membre</td>
<td>$row->category </td> <?php
<td>$etat</td>
<td>$row->date_creation</td> // output data of each row
<td>$row->code_parrain</td> foreach($sql1->result() as $row) {
<td>"; $etat = $this->lang->line("Non assigné");
if($row->etat==0){ if($row->etat==1){
echo " $etat = $this->lang->line("assigné");
<a href='#myModal-2".$num."' role='button' class='btn btn-block btn-danger' data-toggle='modal'><i class='fa fa-remove'></i></a> }
<div class='modal smallfade' id='myModal-2".$num."' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog'> $num ++;
<div class='modal-content'> echo "<tr>
<div class='modal-header'> <td> $row->code_membre</td>
<button type='button' class='close' data-dismiss='modal' aria-label='Close'> <td>$row->category </td>
<span aria-hidden='true'>&times;</span></button> <td>$etat</td>
<h4 class='modal-title'>".$this->lang->line('Confirmer la suppression')."</h4> <td >".toLocateDate($row->date_creation,$this->session->userdata('timezone'))."</td>
</div> <td>$row->code_parrain</td>
<div class='modal-body'> <td>";
<p class='error-text'><i class='icon-warning-sign modal-icon'></i>".$this->lang->line('Message suppression code')." ".$row->code_membre."?</p> if($row->etat==0){
</div> echo "
<div class='modal-footer'> <a href='#myModal-2".$num."' role='button' class='btn btn-block btn-danger' data-toggle='modal'><i class='fa fa-remove'></i></a>
<button type='button' class='btn btn-default pull-left' data-dismiss='modal'>".$this->lang->line('Fermer')."</button> <div class='modal smallfade' id='myModal-2".$num."' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<a href='".$site_url."index.php/Member_code_admin/suppress/?recordId=".$row->code_membre."' role='button' class='btn btn-danger' id='delete'> <div class='modal-dialog'>
".$this->lang->line('Supprimer')."</a> <div class='modal-content'>
</div> <div class='modal-header'>
</div> <button type='button' class='close' data-dismiss='modal' aria-label='Close'>
<!-- /.modal-content --> <span aria-hidden='true'>&times;</span></button>
</div> <h4 class='modal-title'>".$this->lang->line('Confirmer la suppression')."</h4>
</div> </div>
</td>"; <div class='modal-body'>
<p class='error-text'><i class='icon-warning-sign modal-icon'></i>".$this->lang->line('Message suppression code')." ".$row->code_membre."?</p>
} </div>
<div class='modal-footer'>
echo "</tr> "; <button type='button' class='btn btn-default pull-left' data-dismiss='modal'>".$this->lang->line('Fermer')."</button>
} <a href='".$site_url."index.php/Member_code_admin/suppress/?recordId=".$row->code_membre."' role='button' class='btn btn-danger' id='delete'>
".$this->lang->line('Supprimer')."</a>
?> </div>
</div>
</tbody> <!-- /.modal-content -->
</table> </div>
</div>
</td>";
</div>
</div> }
</div>
echo "</tr> ";
<?php }
?>
}
</tbody>
else { </table>
echo $this->lang->line("Aucun membre validé");
}
} </div>
</div>
$this->db->close(); </div>
?> <?php
}
else {
</div> echo $this->lang->line("Aucun membre validé");
<!-- /.box-body --> }
</div> }
<!-- /.box -->
</div> $this->db->close();
<!-- /.col -->
</div> ?>
<!-- /.row -->
</section>
<!-- /.content -->
</div> </div>
<!-- /.box-body -->
<!-- jQuery 3 --> </div>
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script> <!-- /.box -->
<!-- Bootstrap 3.3.7 --> </div>
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script> <!-- /.col -->
<!-- DataTables --> </div>
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script> <!-- /.row -->
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script> </section>
<!-- Slimscroll --> <!-- /.content -->
<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> </div>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script> <!-- jQuery 3 -->
<!-- AdminLTE for demo purposes --> <script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script> <!-- Bootstrap 3.3.7 -->
<script> <script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
$(function() { <!-- DataTables -->
$('#unvalidated').DataTable() <script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
$('#validated').DataTable() <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> <script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script type='text/javascript'> <script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
$(document).ready(function(){ <!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
$('#pays').change(function(){ <script>
var pays = $(this).val(); $(function() {
$.ajax({ $('#unvalidated').DataTable()
url:'<?php echo base_url('index.php/Admin/getHypByPays')?>', $('#validated').DataTable()
type: 'post',
data: {pays: pays}, })
dataType: 'json',
success: function(data){ </script>
var len = data.length;
<script type='text/javascript'>
$(document).ready(function(){
if(len > 0){
$('#pays').change(function(){
var select = document.getElementById('hyper'); var pays = $(this).val();
if(select===null){ $.ajax({
var grpPays = document.getElementById('grp-pays'); url:'<?php echo base_url('index.php/Admin/getHypByPays')?>',
$(grpPays).empty(); type: 'post',
$(grpPays).append("<select class='form-control input-lg' name='hyper' required id='hyper'></select>"); data: {pays: pays},
select = document.getElementById('hyper'); dataType: 'json',
} success: function(data){
$(select).empty(); var len = data.length;
for (var i in data) {
$(select).append('<option value=' + data[i].code_membre + '>' + data[i].lastname +'-' + data[i].network + ' ('+ data[i].code_membre +')</option>'); if(len > 0){
}
var select = document.getElementById('hyper');
var code = data[0].code_membre; if(select===null){
var grpPays = document.getElementById('grp-pays');
$.ajax({ $(grpPays).empty();
url:'<?php echo base_url('index.php/Admin/getVilleByHyp')?>', $(grpPays).append("<select class='form-control input-lg' name='hyper' required id='hyper'></select>");
type: 'post', select = document.getElementById('hyper');
data: {code: code,pays:pays}, }
dataType: 'json', $(select).empty();
success: function(list){
var len = list.length; for (var i in data) {
$(select).append('<option value=' + data[i].code_membre + '>' + data[i].lastname +'-' + data[i].network + ' ('+ data[i].code_membre +')</option>');
if(len > 0){ }
var select = document.getElementById('ville'); var code = data[0].code_membre;
if(select===null){
var grpVille = document.getElementById('grp-ville'); $.ajax({
$(grpVille).empty(); url:'<?php echo base_url('index.php/Admin/getVilleByHyp')?>',
$(grpVille).append("<select class='form-control input-lg' name='ville' required id='ville'></select>"); type: 'post',
select = document.getElementById('ville'); data: {code: code,pays:pays},
} dataType: 'json',
$(select).empty(); success: function(list){
var len = list.length;
for (var i in list) {
$(select).append('<option value=' + list[i].town_id + '>' + list[i].town +'</option>'); if(len > 0){
}
var select = document.getElementById('ville');
if(select===null){
}else{ var grpVille = document.getElementById('grp-ville');
$(grpVille).empty();
var select = document.getElementById('ville'); $(grpVille).append("<select class='form-control input-lg' name='ville' required id='ville'></select>");
$(select).empty(); select = document.getElementById('ville');
}
} $(select).empty();
} for (var i in list) {
}); $(select).append('<option value=' + list[i].town_id + '>' + list[i].town +'</option>');
}
}else{
}else{
var select = document.getElementById('hyper');
$(select).empty(); var select = document.getElementById('ville');
$(select).empty();
var select2 = document.getElementById('ville');
$(select2).empty(); }
}
}
} });
});
});
}else{
$('#hyper').change(function(){
var code = $(this).val(); var select = document.getElementById('hyper');
$.ajax({ $(select).empty();
url:'<?php echo base_url('index.php/Admin/getVilleByHyp')?>',
type: 'post', var select2 = document.getElementById('ville');
data: {code: code}, $(select2).empty();
dataType: 'json', }
success: function(list){
var len = list.length; }
});
if(len > 0){ });
var select = document.getElementById('ville'); $('#hyper').change(function(){
$(select).empty(); var code = $(this).val();
$.ajax({
for (var i in list) { url:'<?php echo base_url('index.php/Admin/getVilleByHyp')?>',
$(select).append('<option value=' + list[i].town_id + '>' + list[i].town +'</option>'); type: 'post',
} data: {code: code},
dataType: 'json',
}else{ success: function(list){
var len = list.length;
var select = document.getElementById('ville');
$(select).empty(); if(len > 0){
} var select = document.getElementById('ville');
$(select).empty();
}
}); for (var i in list) {
}); $(select).append('<option value=' + list[i].town_id + '>' + list[i].town +'</option>');
}
}); }else{
</script>
var select = document.getElementById('ville');
$(select).empty();
}
}
});
});
});
</script>

View File

@ -12,7 +12,8 @@
}, },
"require": { "require": {
"php": ">=5.4", "php": ">=5.4",
"spatie/async": "^1.4" "spatie/async": "^1.4",
"nesbot/carbon": "^2.33"
}, },
"suggest": { "suggest": {
"paragonie/random_compat": "Provides better randomness in PHP 5.x" "paragonie/random_compat": "Provides better randomness in PHP 5.x"