raspisms/templates/account/show.php

183 lines
8.2 KiB
PHP
Raw Permalink Normal View History

2019-10-29 14:57:13 +01:00
<?php
//Template dashboard
$this->render('incs/head', ['title' => 'Profile - Show'])
?>
<div id="wrapper">
<?php
$this->render('incs/nav', ['page' => 'Account - Show']);
?>
<div id="page-wrapper">
<div class="container-fluid">
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Dashboard <small>Profil</small>
</h1>
<ol class="breadcrumb">
<li>
2019-11-07 17:52:33 +01:00
<i class="fa fa-dashboard"></i> <a href="<?php echo \descartes\Router::url('Dashboard', 'show'); ?>">Dashboard</a>
2019-10-29 14:57:13 +01:00
</li>
<li class="active">
<i class="fa fa-user"></i> Profil
</li>
</ol>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-user fa-fw"></i> Mon profil</h3>
</div>
<div class="panel-body">
<div class="col-xs-12 col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-child fa-fw"></i> Mes données</h4>
</div>
<div class="panel-body">
<strong>Adresse e-mail :</strong> <?php $this->s($_SESSION['user']['email']); ?><br/>
<strong>Niveau administrateur :</strong> <?php echo $_SESSION['user']['admin'] ? 'Oui' : 'Non'; ?><br/>
2022-01-20 02:51:41 +01:00
<br/>
<div id="api-key-container" class="">
<strong>Clef API :</strong>
<span id="show-api-key-link" class="visible">
<a href="#">Cliquez pour afficher la clef API.</a><br/>
</span>
<span id="api-key" class="hidden">
<?php echo $_SESSION['user']['api_key']; ?><br/>
<div style="margin-top: 15px" id="api-key-qrcode"></div>
</span>
</div>
2019-10-29 14:57:13 +01:00
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-lock fa-fw"></i> Modifier mot de passe</h4>
2019-10-29 14:57:13 +01:00
</div>
<div class="panel-body">
<form action="<?php echo \descartes\Router::url('Account', 'update_password', ['csrf' => $_SESSION['csrf']]); ?>" method="POST">
2019-10-29 14:57:13 +01:00
<div class="form-group">
<label>Mot de passe :</label>
<input name="password" type="password" class="form-control" placeholder="Nouveau mot de passe" autocomplete="new-password" />
2019-10-29 14:57:13 +01:00
</div>
<div class="text-center">
<button class="btn btn-success">Mettre à jour les données</button>
</div>
</form>
</div>
</div>
<?php if (ENABLE_ACCOUNT_DELETION) { ?>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-trash-o fa-fw"></i> Supprimer ce compte</h4>
</div>
<div class="panel-body">
<form action="<?php echo \descartes\Router::url('Account', 'delete', ['csrf' => $_SESSION['csrf']]); ?>" method="POST">
<div class="checkbox">
<label>
<input name="delete_account" type="checkbox" value="1" /> Je suis totalement sûr de vouloir supprimer ce compte
</label>
</div>
<div class="text-center">
<button class="btn btn-danger">Supprimer ce compte</button>
</div>
</form>
</div>
</div>
<?php } ?>
2019-10-29 14:57:13 +01:00
</div>
<div class="col-xs-12 col-md-6">
<?php if ($quota) { ?>
<div class="panel panel-default">
<div class="panel-heading">
2021-06-14 20:21:06 +02:00
<h4 class="panel-title"><i class="fa fa-euro fa-fw"></i> Quota de SMS</h4>
</div>
<div class="panel-body">
<strong>Crédit de base :</strong> <?php $this->s($quota['credit']); ?><br/>
<strong>Crédit additionel :</strong> <?php $this->s($quota['additional']); ?><br/>
<strong>Crédit consommés :</strong> <?php $this->s($quota['consumed']); ?> (<?= $quota_percent * 100; ?>%)<br/>
<strong>Renouvellement automatique :</strong> <?php $this->s(($quota['auto_renew'] ? 'Oui, renouvellement le ' : 'Non, fin le ') . $quota['expiration_date']); ?><br/>
<strong>Report des crédits non utilisés :</strong> <?= $quota['report_unused'] ? 'Oui' : 'Non'; ?><br/>
<strong>Report des crédits additionels non utilisés :</strong> <?= $quota['report_unused_additional'] ? 'Oui' : 'Non'; ?><br/>
</div>
</div>
<?php } ?>
2019-10-29 14:57:13 +01:00
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-at fa-fw"></i> Modifier e-mail</h4>
</div>
<div class="panel-body">
<form action="<?php echo \descartes\Router::url('Account', 'update_email', ['csrf' => $_SESSION['csrf']]); ?>" method="POST">
2019-10-29 14:57:13 +01:00
<div class="form-group">
<label>Adresse e-mail :</label>
<input name="email" type="email" class="form-control" placeholder="Nouvelle adresse e-mail" />
</div>
<div class="text-center">
<button class="btn btn-success">Mettre à jour les données</button>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-key fa-fw"></i> Modifier clef API</h4>
</div>
<div class="panel-body">
<div class="text-center">
<div class="alert alert-warning text-left">Si vous générez une nouvelle clef API la clef actuelle sera supprimée. Pensez à mettre à jour toutes les callbacks chez les services externes.</div>
<a class="btn btn-success btn-confirm" href="<?= \descartes\Router::url('Account', 'update_api_key', ['csrf' => $_SESSION['csrf']]); ?>" data-confirm-text="<i class='fa fa-refresh'></i> Confirmer la mise à jour"><i class="fa fa-refresh"></i> Générer une nouvelle clef API</a>
</div>
</div>
</div>
2019-10-29 14:57:13 +01:00
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
jQuery(document).ready(function ()
{
jQuery('.action-dropdown a').on('click', function (e)
{
e.preventDefault();
var destination = jQuery(this).parents('.action-dropdown').attr('destination');
2019-10-29 14:57:13 +01:00
var url = jQuery(this).attr('href');
jQuery(destination).find('input:checked').each(function ()
2019-10-29 14:57:13 +01:00
{
url += '/' + jQuery(this).val();
});
window.location = url;
});
2022-01-20 02:51:41 +01:00
jQuery('#show-api-key-link').on('click', function (e)
{
e.preventDefault();
jQuery(this).toggleClass('visible').toggleClass('hidden');
jQuery('#api-key').toggleClass('visible').toggleClass('hidden');
});
var qrcode = new QRCode("api-key-qrcode", {
text: <?= json_encode($_SESSION['user']['api_key']); ?>,
width: 128,
height: 128,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
jQuery('')
2019-10-29 14:57:13 +01:00
});
</script>
<?php
$this->render('incs/footer');