2020-05-05 08:25:12 +00:00
|
|
|
|
<link rel="stylesheet"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
2020-05-05 08:25:12 +00:00
|
|
|
|
<link rel="stylesheet"
|
|
|
|
|
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
|
2020-05-04 13:18:44 +00:00
|
|
|
|
<div class="content-wrapper">
|
|
|
|
|
<!-- Content Header (Page header) -->
|
|
|
|
|
<section class="content-header">
|
|
|
|
|
|
|
|
|
|
<h1>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<?= $this->lang->line('header_wallet_password'); ?>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
</h1>
|
|
|
|
|
<?php
|
|
|
|
|
$site_url = base_url();
|
|
|
|
|
|
2020-05-05 08:25:12 +00:00
|
|
|
|
if ($alert == "ok") {
|
2020-05-04 13:18:44 +00:00
|
|
|
|
|
2020-05-05 08:25:12 +00:00
|
|
|
|
if (!$success == "ok") {
|
2020-05-04 13:18:44 +00:00
|
|
|
|
?>
|
|
|
|
|
<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>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<?= $message; ?>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
</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>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<?= $message; ?>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class="content">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-xs-12">
|
|
|
|
|
<div class="box">
|
2020-05-05 08:25:12 +00:00
|
|
|
|
<!-- <div class="box-header">-->
|
|
|
|
|
<!---->
|
|
|
|
|
<!-- </div>-->
|
2020-05-04 13:18:44 +00:00
|
|
|
|
<div class="box-body">
|
2020-05-05 08:25:12 +00:00
|
|
|
|
<div class="login-box">
|
|
|
|
|
<div class="login-box-body">
|
|
|
|
|
<?php
|
|
|
|
|
if(isset($walletPassword)){
|
|
|
|
|
?>
|
|
|
|
|
<!-- <p>-->
|
|
|
|
|
<!-- <span class="label label-success" style="width: 100% ; font-size: 100% ; display: block">--><?php //echo $this->lang->line('generated'); ?><!--</span>-->
|
|
|
|
|
<!-- </p>-->
|
|
|
|
|
|
|
|
|
|
<button type="button" data-toggle="modal" data-target="#generatePassword"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
data-country="<?= $country ?>"
|
|
|
|
|
data-network="<?= $network ?>"
|
|
|
|
|
data-wallet_password_id="<?= $walletPassword->id ?>"
|
|
|
|
|
class="btn btn-warning btn-block openModal"><?= $this->lang->line('reset'); ?></button>
|
2020-05-05 08:25:12 +00:00
|
|
|
|
<?php
|
|
|
|
|
}else{
|
|
|
|
|
?>
|
|
|
|
|
<!-- <p>-->
|
|
|
|
|
<!-- <span class="label label-danger" style="width: 100% ; font-size: 100% ; display: block">--><?php //echo $this->lang->line('not_generated'); ?><!--</span>-->
|
|
|
|
|
<!-- </p>-->
|
|
|
|
|
|
|
|
|
|
<button type="button" data-toggle="modal" data-target="#generatePassword"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
data-country="<?= $country ?>"
|
|
|
|
|
data-network="<?= $network ?>"
|
|
|
|
|
data-network-id="<?= $network_id?>"
|
|
|
|
|
class="btn btn-primary btn-block openModal"><?= $this->lang->line('generate'); ?></button>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
2020-05-05 08:25:12 +00:00
|
|
|
|
}
|
|
|
|
|
?>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
|
2020-05-05 08:25:12 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal fade" id="generatePassword" tabindex="-1" role="dialog" aria-hidden="true">
|
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<h3 class="modal-title"><?= $this->lang->line('generate_password'); ?></h3>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
<form id="walletPasswordForm">
|
|
|
|
|
<div class="form-group">
|
2020-05-05 08:25:12 +00:00
|
|
|
|
<label for="email"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
class="col-form-label"><?= $this->lang->line('email') ?></label>
|
2020-05-05 08:25:12 +00:00
|
|
|
|
<input type="email" min="0" required class="form-control" id="email" name="email">
|
2020-05-04 13:18:44 +00:00
|
|
|
|
</div>
|
2020-05-05 08:25:12 +00:00
|
|
|
|
<!-- <div class="form-group">-->
|
|
|
|
|
<!-- <label for="size" class="col-form-label">Nombre de caracteres</label>-->
|
|
|
|
|
<!-- <input type="number" min="1" required class="form-control" name="size" id="size">-->
|
|
|
|
|
<!-- </div>-->
|
2020-05-04 13:18:44 +00:00
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer">
|
2020-05-05 08:25:12 +00:00
|
|
|
|
<button type="button" class="btn btn-secondary"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
|
2020-05-05 08:25:12 +00:00
|
|
|
|
<button type="button" class="btn btn-primary"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
id="addWalletPassword"> <?= $this->lang->line('generate'); ?></button>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- jQuery 3 -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
<!-- Bootstrap 3.3.7 -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
<!-- DataTables -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
|
|
|
|
|
<script src="<?= base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
<!-- Slimscroll -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
<!-- FastClick -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
<!-- AdminLTE App -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
<!-- AdminLTE for demo purposes -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
|
|
|
|
|
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
|
|
|
|
|
<script src="<?= base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
|
|
|
|
|
<script src="<?= base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
|
2020-05-04 13:18:44 +00:00
|
|
|
|
|
|
|
|
|
<script>
|
2020-05-05 08:25:12 +00:00
|
|
|
|
$(function () {
|
2020-05-04 13:18:44 +00:00
|
|
|
|
$('#validated').DataTable();
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
toastr.options.closeButton = true;
|
|
|
|
|
toastr.options.closeMethod = 'fadeOut';
|
|
|
|
|
toastr.options.closeDuration = 5000;
|
|
|
|
|
toastr.options.closeEasing = 'swing';
|
|
|
|
|
|
|
|
|
|
var network_id = null;
|
|
|
|
|
var wallet_password_id = null;
|
|
|
|
|
var network = null;
|
|
|
|
|
var country = null;
|
|
|
|
|
|
|
|
|
|
$(document).on("click", ".openModal", function () {
|
|
|
|
|
network_id = $(this).data('network-id');
|
|
|
|
|
wallet_password_id = $(this).data('wallet_password_id');
|
|
|
|
|
network = $(this).data('network');
|
|
|
|
|
country = $(this).data('country');
|
|
|
|
|
});
|
|
|
|
|
|
2020-05-05 08:25:12 +00:00
|
|
|
|
$('#addWalletPassword').click(function () {
|
|
|
|
|
if ($('#walletPasswordForm')[0].checkValidity()) {
|
2020-05-04 13:18:44 +00:00
|
|
|
|
const email = $('#email').val();
|
|
|
|
|
// const size = parseInt($('#size').val());
|
|
|
|
|
|
2020-05-05 08:25:12 +00:00
|
|
|
|
$.ajax({
|
2022-04-18 11:39:19 +00:00
|
|
|
|
url: '<?= base_url('Hyperviseur_dash/generate_wallet_password')?>',
|
2020-05-05 08:25:12 +00:00
|
|
|
|
type: 'POST',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
data: {
|
|
|
|
|
"network_id": network_id,
|
|
|
|
|
"email": email,
|
|
|
|
|
"wallet_password_id": wallet_password_id,
|
|
|
|
|
"network": network,
|
|
|
|
|
"country": country
|
|
|
|
|
},
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data == '200') {
|
|
|
|
|
Swal.fire({
|
|
|
|
|
icon: 'success',
|
2022-04-18 11:39:19 +00:00
|
|
|
|
title: "<?= $this->lang->line('password_generated')?>",
|
|
|
|
|
text: "<?= $this->lang->line('informations_updated')?>",
|
2020-05-05 08:25:12 +00:00
|
|
|
|
timer: 3000
|
|
|
|
|
}).then(() => {
|
|
|
|
|
location.reload();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} else {
|
2022-04-18 11:39:19 +00:00
|
|
|
|
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
|
2020-05-04 13:18:44 +00:00
|
|
|
|
}
|
2020-05-05 08:25:12 +00:00
|
|
|
|
},
|
|
|
|
|
error: function (resultat, statut, error) {
|
|
|
|
|
console.log(resultat + " " + error);
|
2022-04-18 11:39:19 +00:00
|
|
|
|
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
|
2020-05-05 08:25:12 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} else {
|
2020-05-04 13:18:44 +00:00
|
|
|
|
$('#walletPasswordForm')[0].reportValidity();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|