backoffice/application/views/gestion_recherche.php

887 lines
35 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<link rel="stylesheet"
href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
<link rel="stylesheet"
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css">
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<style>
.name-link {
color: white;
text-decoration: none;
}
.form-style {
display: block;
width: 50%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
}
.form-group-style {
margin-bottom: 15px;
width: 50%;
}
.img-style {
width: 20%;
margin: 5%;
}
.conteneur-img {
text-align: center;
}
.label-radio {
font-style: bold;
margin-right: 30px;
color: #444;
font-weight: 700;
}
img {
max-width: 100%;
max-height: 100%;
}
.portrait {
height: 80px;
width: 30px;
}
.landscape {
height: 30px;
width: 80px;
}
.square {
height: 75px;
width: 75px;
}
</style>
<section class="content-header">
<h1>
<?php echo $this->lang->line('Rechercher un utilisateur'); ?>
</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">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="box box-primary">
<div class="box-header with-border">
</div>
<div class="box-body">
<?php
if(isset($category)){
$url = $category == 'hyper' ? 'Hyperviseur_dash/get_user' : 'Superviseur_dash/get_user';
}else{
$url = 'Gestion/get_user';
}
?>
<form name="form_login" action="<?php echo base_url($url) ?>" method="post">
<div class="row">
<div class="col-sm-3">
<div class="form-group">
<label><?= $this->lang->line('phone_number')?></label>
<div class="input-group date">
<div class="input-group-addon">
<i class="glyphicon glyphicon-earphone"></i>
</div>
<input type="text" class="form-control pull-right" id="phone" name="phone"
value="<?php echo $default_phone ?>">
</div>
</div>
</div>
<div class='col-sm-3'>
<div class="form-group">
<label><?= $this->lang->line('Numéro de transaction') ?></label>
<div class="input-group date">
<div class="input-group-addon">
<i class="glyphicon glyphicon-usd"></i>
</div>
<input type="text" class="form-control pull-right" id="transac" name="transac"
value="<?php echo $default_transac ?>">
</div>
</div>
</div>
<div class='col-sm-3'>
<div class="form-group">
<label><?= $this->lang->line('code membre') ?></label>
<div class="input-group date">
<div class="input-group-addon">
<i class="glyphicon glyphicon-user"></i>
</div>
<input type="text" class="form-control pull-right" id="code" name="code"
value="<?php echo $default_code ?>">
</div>
</div>
</div>
<div class='col-sm-3'>
<div class="form-group">
<label><?= $this->lang->line('Nom') ?></label>
<div class="input-group date">
<div class="input-group-addon">
<i class="glyphicon glyphicon-user"></i>
</div>
<input type="text" class="form-control pull-right" id="nom" name="nom"
value="<?php echo $default_nom ?>">
</div>
</div>
</div>
<div class="col-sm-4 col-sm-offset-4">
<input class="btn btn-primary btn-block" id='search' disabled='disabled' name='b'
type='submit' value='<?php echo $this->lang->line('Rechercher'); ?>'/>
</div>
</div>
</form>
</div>
</div>
<div class="box box-primary">
<div class="box-header with-border">
<?php if ($result_search == 1) { ?>
<h3 class="box-title"><?= $num_res.' '.$this->lang->line($num_res == 1 ? 'utilisateur trouvé' : 'users_found') ?></h3>
<div class="box-body">
<div class="row">
<?php $users = $res_users;
if ($users != false) {
$numrows = $users->num_rows();
$num = 0;
if ($numrows > 0) {
foreach ($users->result() as $row) {
$num++;
?>
<div class="col-md-3">
<!-- Profile Image -->
<div class="box box-primary">
<div class="box-body box-profile">
<img class="profile-user-img img-responsive img-circle"
src="<?= base_url('dist/img/user-g.png')?>" alt="User profile picture">
<h3 class="profile-username text-center"><?php echo $row->lastname ?></h3>
<p class="text-muted text-center"><?php echo $row->category ?></p>
<ul class="list-group list-group-unbordered">
<li class="list-group-item">
<b><?php echo $this->lang->line('Reseau'); ?></b> <a
class="pull-right"><?php echo $row->network_name ?></a>
</li>
<li class="list-group-item">
<b><?php echo $this->lang->line('code membre'); ?></b> <a
class="pull-right"><?php echo $row->code ?></a>
</li>
<li class="list-group-item">
<b><?php echo $this->lang->line('Ville'); ?></b> <a
class="pull-right"><?php echo $row->town_name ?></a>
</li>
<li class="list-group-item">
<b><?php echo $this->lang->line('Contact'); ?></b> <a
class="pull-right"><?php echo $row->phone ?></a>
</li>
</ul>
<a href="#" class="btn btn-primary btn-block" data-toggle="modal"
data-target="#infos<?php echo $num; ?>"><b><?php echo $this->lang->line('Voir plus...'); ?></b></a>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<div class="modal fade" id="infos<?php echo $num; ?>" tabindex="-1"
role="dialog" aria-labelledby="infosModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"><?php echo $this->lang->line('Informations de l utilisateur'); ?></h3>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="nom"
class="col-form-label"><?php echo $this->lang->line('Nom'); ?></label>
<input type="text" class="form-control"
id="nom-g<?php echo $num; ?>" name="nom"
value="<?php echo $row->lastname ?>">
</div>
<div class="form-group">
<label for="adresse"
class="col-form-label"><?php echo $this->lang->line('Adresse'); ?></label>
<input class="form-control"
id="adresse-g<?php echo $num; ?>"
name="adresse-g"
value="<?php echo $row->adresse ?>">
</div>
<div class="form-group">
<label for="email"
class="col-form-label"><?php echo $this->lang->line('Email'); ?></label>
<input class="form-control"
id="email-g<?php echo $num; ?>" name="email-g"
value="<?php echo $row->email ?>">
</div>
<div class="form-group col-sm-6">
<label for="m-phone"
class="col-form-label"><?php echo $this->lang->line('Contact'); ?></label>
<input class="form-control"
id="phone-g<?php echo $num; ?>" name="phone-g"
value="<?php echo $row->phone ?>">
</div>
<div class="form-group col-sm-6">
<label for="m-transac"
class="col-form-label"><?php echo $this->lang->line('Numéro de transaction'); ?></label>
<input class="form-control"
id="transac-g<?php echo $num; ?>"
name="transac-g"
value="<?php echo $row->transac ?>">
</div>
<div class="form-group col-sm-6">
<label for="code-m"
class="col-form-label"><?php echo $this->lang->line('code membre'); ?></label>
<input class="form-control" disabled id="code-m"
name="code-m" value="<?php echo $row->code ?>">
</div>
<div class="form-group col-sm-6">
<label for="code-p"
class="col-form-label"><?php echo $this->lang->line('Code parrain'); ?></label>
<input class="form-control" disabled id="code-p"
name="code-p"
value="<?php echo $row->parrain ?>">
</div>
<div class="form-group col-sm-6">
<label for="category"
class="col-form-label"><?php echo $this->lang->line('Catégorie'); ?></label>
<input class="form-control" disabled id="category"
name="category"
value="<?php echo $row->category ?>">
</div>
<div class="form-group col-sm-6">
<label for="date-ins"
class="col-form-label"><?php echo $this->lang->line('Date inscription'); ?></label>
<input class="form-control" disabled id="date-ins"
name="date-ins"
value="<?php echo $row->date_created ?>">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
<button type="button" class="btn btn-primary valid-infos-g"
data-num="<?php echo $num; ?>"
data-idnetworkAgent="<?php echo $row->networkAgent_id ?>"
data-idUser="<?php echo $row->userID ?>"><?php echo $this->lang->line('Valider'); ?></button>
</div>
</div>
</div>
</div>
<?php
}
}
}
?>
<?php $simple_users = $res_simple_users;
if ($simple_users != null) {
$numrows = $simple_users->num_rows();
$num = 0;
if ($numrows > 0) {
foreach ($simple_users->result() as $row) {
$num++;
?>
<div class="col-md-3">
<!-- Profile Image -->
<div class="box box-success">
<div class="box-body box-profile">
<img class="profile-user-img img-responsive img-circle"
src="<?= base_url('dist/img/user-s.png')?>" alt="User profile picture">
<h3 class="profile-username text-center"><?php echo $row->lastname ?></h3>
<p class="text-muted text-center"><?php echo $this->lang->line('Utilisateur simple'); ?></p>
<ul class="list-group list-group-unbordered">
<li class="list-group-item">
<b><?php echo $this->lang->line('Reseau'); ?></b> <a
class="pull-right"><?php echo $row->network ?></a>
</li>
<li class="list-group-item">
<b><?php echo $this->lang->line('Pays'); ?></b> <a
class="pull-right"><?php echo $row->country ?></a>
</li>
<li class="list-group-item">
<b><?php echo $this->lang->line('Contact'); ?></b> <a
class="pull-right"><?php echo $row->phone ?></a>
</li>
<li class="list-group-item">
<b><?php echo $this->lang->line('Date inscription'); ?></b>
<a class="pull-right"><?php echo $row->date_created ?></a>
</li>
<li class="list-group-item">
<b><?php echo $this->lang->line('identified'); ?></b> <a
class="pull-right"><?= $row->status ? $this->lang->line('Oui') : $this->lang->line('Non') ?></a>
</li>
</ul>
<a href="#" class="btn btn-success btn-block" data-toggle="modal"
data-target="#infos-s"><b><?php echo $this->lang->line('Voir plus...'); ?></b></a>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<div class="modal fade" id="infos-s" data-id="<?php echo $row->id_user; ?>"
tabindex="-1" role="dialog" aria-labelledby="infos-s-ModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"><?php echo $this->lang->line('Informations de l utilisateur'); ?></h3>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="nom"
class="col-form-label"><?php echo $this->lang->line('Nom'); ?></label>
<input type="text" class="form-control" id="nom-s"
name="nom" value="<?php echo $row->lastname ?>">
</div>
<div class="form-group">
<label for="adresse"
class="col-form-label"><?php echo $this->lang->line('Adresse'); ?></label>
<input class="form-control" id="adresse-s"
name="adresse"
value="<?php echo $row->adresse ?>">
</div>
<div class="form-group">
<label for="email"
class="col-form-label"><?php echo $this->lang->line('Email'); ?></label>
<input class="form-control" id="email-s" name="email"
value="<?php echo $row->email ?>">
</div>
<div class="form-group">
<label for="m-phone"
class="col-form-label"><?php echo $this->lang->line('Contact'); ?></label>
<input class="form-control" id="phone-s" name="m-phone"
value="<?php echo $row->phone ?>">
</div>
<?php if ($row->status) {
$user_image = WALLET_SERVICE_URL . '/photos/'.$row->user_image;
$user_image_file = @fopen($user_image ,'r');
$document_front = WALLET_SERVICE_URL . '/documents/'.$row->document_image_front;
$document_front_file = @fopen($document_front ,'r');
$document_back = WALLET_SERVICE_URL . '/documents/'.$row->document_image_back;
$document_back_file = @fopen($document_back ,'r');
?>
<label class="text-center text-muted" style="padding: 10px"> Identification </label>
<div class="row">
<div class="form-group col-sm-6">
<label
class="col-form-label"><?php echo $this->lang->line('Nom'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->id_firstname ?>">
</div>
<div class="form-group col-sm-6">
<label
class="col-form-label"><?php echo $this->lang->line('Prénom'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->id_lastname ?>">
</div>
</div>
<div class="row">
<div class="form-group col-sm-4">
<label
class="col-form-label"><?php echo $this->lang->line('birth_date'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->birth_date ?>">
</div>
<div class="form-group col-sm-4">
<label
class="col-form-label"><?php echo $this->lang->line('Ville'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->id_town ?>">
</div>
<div class="form-group col-sm-4">
<label
class="col-form-label"><?php echo $this->lang->line('Pays'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->id_country?>">
</div>
</div>
<div class="row">
<div class="form-group col-sm-4">
<label
class="col-form-label"><?php echo $this->lang->line('identity_document'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->identity_document ?>">
</div>
<div class="form-group col-sm-4">
<label
class="col-form-label"><?php echo $this->lang->line('id_identity_document'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->id_identity_document ?>">
</div>
<div class="form-group col-sm-4">
<label
class="col-form-label"><?php echo $this->lang->line('expiry_date_document'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->expiry_date_document ?>">
</div>
</div>
<div class="row text-center">
<div class="col-12">
<label><?= $this->lang->line('user_image') ?></label>
<div>
<img src="<?= $user_image_file ? $user_image : '../../images/broken.png' ?>"
alt="user_image"/>
</div>
</div>
</div>
<div class="row" style="margin-top: 10px">
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('document_image_front') ?></label>
<img src="<?= $document_front_file ? $document_front : '../../images/broken.png' ?>"
alt="document_front"/>
</div>
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('document_image_back') ?></label>
<img src="<?= $document_back_file ? $document_back : '../../images/broken.png'?>"
alt="document_back"/>
</div>
</div>
<?php } ?>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
<?php if(!isset($category)) { ?>
<button type="button" id="valid-infos-s"
class="btn btn-primary"><?php echo $this->lang->line('Valider'); ?></button>
<?php } ?>
</div>
</div>
</div>
</div>
<?php
}
}
}
?>
</div>
</div>
<?php } elseif ($result_search == 2) { ?>
<?php $simple_users = $res_simple_users;
if ($simple_users != null) {
?>
<h3 class="box-title"><?= $simple_users->num_rows().' '.$this->lang->line($simple_users->num_rows() == 1 ? 'utilisateur trouvé' : 'users_found') ?></h3>
<div class="box-body">
<div class="row">
<?php
$numrows = $simple_users->num_rows();
$num = 0;
if ($numrows > 0) {
foreach ($simple_users->result() as $row) {
$num++;
?>
<div class="col-md-3">
<!-- Profile Image -->
<div class="box box-success">
<div class="box-body box-profile">
<img class="profile-user-img img-responsive img-circle"
src="<?= base_url('dist/img/user-s.png')?>" alt="User profile picture">
<h3 class="profile-username text-center"><?php echo $row->lastname ?></h3>
<p class="text-muted text-center"><?php echo $this->lang->line('Utilisateur simple'); ?></p>
<ul class="list-group list-group-unbordered">
<li class="list-group-item">
<b><?php echo $this->lang->line('Reseau'); ?></b> <a
class="pull-right"><?php echo $row->network ?></a>
</li>
<li class="list-group-item">
<b><?php echo $this->lang->line('Pays'); ?></b> <a
class="pull-right"><?php echo $row->country ?></a>
</li>
<li class="list-group-item">
<b><?php echo $this->lang->line('Contact'); ?></b> <a
class="pull-right"><?php echo $row->phone ?></a>
</li>
<li class="list-group-item">
<b><?php echo $this->lang->line('Date inscription'); ?></b>
<a class="pull-right"><?php echo $row->date_created ?></a>
</li>
<li class="list-group-item">
<b><?php echo $this->lang->line('identified'); ?></b> <a
class="pull-right"><?= $row->status ? $this->lang->line('Oui') : $this->lang->line('Non') ?></a>
</li>
</ul>
<a href="#" class="btn btn-success btn-block" data-toggle="modal"
data-target="#infos-s"><b><?php echo $this->lang->line('Voir plus...'); ?></b></a>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<div class="modal fade" id="infos-s" data-id="<?php echo $row->id_user; ?>"
tabindex="-1" role="dialog" aria-labelledby="infos-s-ModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"><?php echo $this->lang->line('Informations de l utilisateur'); ?></h3>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="nom"
class="col-form-label"><?php echo $this->lang->line('Nom'); ?></label>
<input type="text" class="form-control" id="nom-s"
name="nom" value="<?php echo $row->lastname ?>">
</div>
<div class="form-group">
<label for="adresse"
class="col-form-label"><?php echo $this->lang->line('Adresse'); ?></label>
<input class="form-control" id="adresse-s"
name="adresse"
value="<?php echo $row->adresse ?>">
</div>
<div class="form-group">
<label for="email"
class="col-form-label"><?php echo $this->lang->line('Email'); ?></label>
<input class="form-control" id="email-s" name="email"
value="<?php echo $row->email ?>">
</div>
<div class="form-group">
<label for="m-phone"
class="col-form-label"><?php echo $this->lang->line('Contact'); ?></label>
<input class="form-control" id="phone-s" name="m-phone"
value="<?php echo $row->phone ?>">
</div>
<?php if ($row->status) {
$user_image = WALLET_SERVICE_URL . '/photos/'.$row->user_image;
$user_image_file = @fopen($user_image ,'r');
$document_front = WALLET_SERVICE_URL . '/documents/'.$row->document_image_front;
$document_front_file = @fopen($document_front ,'r');
$document_back = WALLET_SERVICE_URL . '/documents/'.$row->document_image_back;
$document_back_file = @fopen($document_back ,'r');
?>
<label class="text-center text-muted" style="padding: 10px"> Identification </label>
<div class="row">
<div class="form-group col-sm-6">
<label
class="col-form-label"><?php echo $this->lang->line('Nom'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->id_firstname ?>">
</div>
<div class="form-group col-sm-6">
<label
class="col-form-label"><?php echo $this->lang->line('Prénom'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->id_lastname ?>">
</div>
</div>
<div class="row">
<div class="form-group col-sm-4">
<label
class="col-form-label"><?php echo $this->lang->line('birth_date'); ?></label>
<input class="form-control" readonly name="code-p"
value="<?php echo $row->birth_date ?>">
</div>
<div class="form-group col-sm-4">
<label
class="col-form-label"><?php echo $this->lang->line('Ville'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->id_town ?>">
</div>
<div class="form-group col-sm-4">
<label
class="col-form-label"><?php echo $this->lang->line('Pays'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->id_country?>">
</div>
</div>
<div class="row">
<div class="form-group col-sm-4">
<label
class="col-form-label"><?php echo $this->lang->line('identity_document'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->identity_document ?>">
</div>
<div class="form-group col-sm-4">
<label
class="col-form-label"><?php echo $this->lang->line('id_identity_document'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->id_identity_document ?>">
</div>
<div class="form-group col-sm-4">
<label
class="col-form-label"><?php echo $this->lang->line('expiry_date_document'); ?></label>
<input class="form-control" readonly
value="<?php echo $row->expiry_date_document ?>">
</div>
</div>
<div class="row text-center">
<div class="col-12">
<label><?= $this->lang->line('user_image') ?></label>
<div>
<img src="<?= $user_image_file ? $user_image : '../../images/broken.png' ?>"
alt="user_image"/>
</div>
</div>
</div>
<div class="row" style="margin-top: 10px">
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('document_image_front') ?></label>
<img src="<?= $document_front_file ? $document_front : '../../images/broken.png' ?>"
alt="document_front"/>
</div>
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('document_image_back') ?></label>
<img src="<?= $document_back_file ? $document_back : '../../images/broken.png'?>"
alt="document_back"/>
</div>
</div>
<?php } ?>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
<?php if(!isset($category)) { ?>
<button type="button" id="valid-infos-s"
class="btn btn-primary"><?php echo $this->lang->line('Valider'); ?></button>
<?php } ?>
</div>
</div>
</div>
</div>
<?php
}
}
?>
</div>
</div>
<?php
} else {
?>
<h3 class="box-title"><?php echo $this->lang->line('Aucun utilisateur trouvé'); ?></h3>
<?php
}
?>
<?php } elseif ($result_search == 0) { ?>
<div class="conteneur-img">
<img class="img-style" src="<?= base_url('dist/img/search.png')?>" alt="icon search">
</div>
<?php } ?>
</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>
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
<script type="text/javascript">
//Date picker
//$('#date-debut').datepicker({autoclose: true,format: 'yyyy-mm-dd'});
$("#date-debut").datetimepicker({
format: 'YYYY-MM-DD HH:mm:ss',
locale: moment.locale('fr')
});
$('#date-fin').datetimepicker({
format: 'YYYY-MM-DD HH:mm:ss'
});
</script>
<script>
toastr.options.closeButton = true;
toastr.options.closeMethod = 'fadeOut';
toastr.options.closeDuration = 5000;
toastr.options.closeEasing = 'swing';
$('#phone').on('input', function () {
if ($(this).val() !== '') {
$('#search').prop('disabled', false);
} else {
if ($('#transac').val() == '' && $('#code').val() == '' && $('#nom').val() == '') {
$('#search').prop('disabled', true);
}
}
});
$('#nom').on('input', function () {
if ($(this).val() !== '') {
$('#search').prop('disabled', false);
} else {
if ($('#transac').val() == '' && $('#code').val() == '' && $('#phone').val() == '') {
$('#search').prop('disabled', true);
}
}
});
$('#transac').on('input', function () {
if ($(this).val() !== '') {
$('#search').prop('disabled', false);
} else {
if ($('#phone').val() == '' && $('#code').val() == '' && $('#nom').val() == '') {
$('#search').prop('disabled', true);
}
}
});
$('#code').on('input', function () {
if ($(this).val() !== '') {
$('#search').prop('disabled', false);
} else {
if ($('#transac').val() == '' && $('#phone').val() == '' && $('#nom').val() == '') {
$('#search').prop('disabled', true);
}
}
});
$('#valid-infos-s').click(function () {
var user_id = $('#infos-s').data('id');
var nom = $('#nom-s').val();
var adresse = $('#adresse-s').val();
var contact = $('#phone-s').val();
var email = $('#email-s').val();
$.ajax({
url: '<?php echo base_url('Gestion/update_info_user')?>',
type: 'POST',
dataType: 'json',
data: {"user_id": user_id, "nom": nom, "adresse": adresse, "contact": contact, "email": email},
success: function (data, statut) {
if (data == '200') {
alert("Les informations ont été mises à jour.") ? "" : location.reload(true);
} else {
alert("Une erreur s'est produite.");
}
},
error: function (resultat, statut, erreur) {
console.log(resultat + " " + erreur);
}
});
});
$('.valid-infos-g').click(function () {
var num = $(this).attr('data-num');
var user_id = $(this).attr('data-idUser');
var net_ag_id = $(this).attr('data-idnetworkAgent');
var nom = $('#nom-g' + num).val();
var adresse = $('#adresse-g' + num).val();
var email = $('#email-g' + num).val();
var contact = $('#phone-g' + num).val();
var transac = $('#transac-g' + num).val();
$.ajax({
url: '<?php echo base_url('Gestion/update_info_geolocated')?>',
type: 'POST',
dataType: 'json',
data: {
"user_id": user_id,
"id_netAg": net_ag_id,
"nom": nom,
"adresse": adresse,
"contact": contact,
"transac": transac,
"email": email
},
success: function (data, statut) {
if (data == '200') {
alert("Les informations ont été mises à jour.") ? "" : location.reload(true);
} else if (data == '400') {
toastr.error("<?php echo $this->lang->line('phone_already_exists')?>", "<?php echo $this->lang->line('request_error')?>");
}else{
alert("Une erreur s'est produite.");
}
},
error: function (resultat, statut, erreur) {
console.log(resultat + " " + erreur);
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
}
});
});
</script>