Issue #0001636: Front-end part
This commit is contained in:
parent
3e6e60f922
commit
44532bfd59
134
application/views/default/scripts/user/motpasse.phtml
Normal file
134
application/views/default/scripts/user/motpasse.phtml
Normal file
@ -0,0 +1,134 @@
|
||||
<?php if ($this->href) {?>
|
||||
|
||||
<a class="dlg" title="<?=$this->name?>" href="<?=$this->href?>"><?=$this->name?></a>
|
||||
<script>
|
||||
$('a.dlg').on('click', function(e){
|
||||
e.preventDefault();
|
||||
var title = $(this).attr('title');
|
||||
var href = $(this).attr('href');
|
||||
var dlgOpts = {
|
||||
bgiframe: true,
|
||||
title: title,
|
||||
width: 710,
|
||||
height: 530,
|
||||
modal: true,
|
||||
open: function(event, ui) {
|
||||
$(this).html('Chargement...');
|
||||
$(this).load(href);
|
||||
},
|
||||
buttons: {'Fermer': function() { $(this).dialog('close'); }},
|
||||
close: function() { $('#dialog').remove(); }};
|
||||
$('<div id="dlg"></div>').dialog(dlgOpts);
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<style>
|
||||
pre {
|
||||
font-family: arial;
|
||||
}
|
||||
label#dlg {
|
||||
clear: both;
|
||||
float: left;
|
||||
width: 20em;
|
||||
margin-right: 1em;
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
}
|
||||
input#dlg {
|
||||
width: 28em;
|
||||
}
|
||||
.brsr {
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
border-color:red;
|
||||
}
|
||||
.loading
|
||||
{
|
||||
background-color: silver;
|
||||
height: 450px;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
position: absolute;
|
||||
width: 720px;
|
||||
opacity: 0.3;
|
||||
display:none;
|
||||
z-index: 1;
|
||||
}
|
||||
.message {
|
||||
font-size: 10px;
|
||||
width: 98%;
|
||||
background-color: #FFFFDD;
|
||||
border: 1px solid #FCEFA1;
|
||||
border-radius: 4px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
#stl {
|
||||
height:25px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<?php if ($this->message!='') {?>
|
||||
<div class='message'><p><?=$this->message; ?></p></div>
|
||||
<?php }?>
|
||||
<?php
|
||||
$params = $this->params;
|
||||
?>
|
||||
|
||||
<div>
|
||||
<pre>Cher client,
|
||||
|
||||
Pour recevoir votre mot de passe ou votre identifiant oubliés, nous vous invitons à saisir les informations ci-dessous et cliquer sur valider.
|
||||
A réception de ces données, nous vous informerons par e-mail.
|
||||
|
||||
Tous les champs (*) sont obligatoires : en cas de données manquantes ou erronées , votre demande ne pourra pas être prise en compte par nos services. * = champ obligatoire.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<form>
|
||||
<div id='stl'>
|
||||
<label id='dlg'>Votre Identifiant :</label>
|
||||
<input id='dlg' type="text" name="identifiant" value="<?=$params['identifiant']; ?>"/>
|
||||
</div>
|
||||
<div id='stl'>
|
||||
<label id='dlg'>Votre Adresse email* :</label>
|
||||
<input id='dlg' type="email" name="email" value="<?=$params['email']; ?>" required />
|
||||
</div>
|
||||
<div id='stl'>
|
||||
<label id='dlg'>Votre Numéro de téléphone direct* :</label>
|
||||
<input id='dlg' type="text" name="telephone" value="<?=$params['telephone']; ?>" required/>
|
||||
</div>
|
||||
<div id='stl'>
|
||||
<label id='dlg'>Votre Nom* :</label>
|
||||
<input id='dlg' type="text" name="nom" value="<?=$params['nom']; ?>" required/>
|
||||
</div>
|
||||
<div id='stl'>
|
||||
<label id='dlg'>Votre Prénom* :</label>
|
||||
<input id='dlg' type="text" name="prenom" value="<?=$params['prenom']; ?>" required/>
|
||||
</div>
|
||||
<div id='stl'>
|
||||
<label id='dlg'>Votre Fonction* :</label>
|
||||
<input id='dlg' type="text" name="fonction" value="<?=$params['fonction']; ?>" required/>
|
||||
</div>
|
||||
<div id='stl'>
|
||||
<label id='dlg'>Raison Sociale* :</label>
|
||||
<input id='dlg' type="text" name="rsociale" value="<?=$params['rsociale']; ?>" required/>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<pre>
|
||||
Les informations que vous nous communiquez dans ce formulaire seront utilisées exclusivement par nos services internes pour le traitement de votre demande et pour personnaliser la communication.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="loading"><center><img style="padding-top:25%" src="/themes/default/images/giant/19-1.gif" /></center></div>
|
||||
|
||||
<script type="text/javascript" src="/themes/default/scripts/motpasse.js" />
|
||||
<?php }?>
|
51
public/themes/default/scripts/motpasse.js
Normal file
51
public/themes/default/scripts/motpasse.js
Normal file
@ -0,0 +1,51 @@
|
||||
function validate() {
|
||||
var allvals = true;
|
||||
$("[required]").each(function() {
|
||||
if(!$(this).val()) {
|
||||
allvals = false;
|
||||
$(this).addClass('brsr');
|
||||
}
|
||||
else { $(this).removeClass('brsr'); }
|
||||
});
|
||||
return allvals;
|
||||
}
|
||||
|
||||
function isEmail(email) {
|
||||
var emailval = true;
|
||||
var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
||||
if (!regex.test(email.val())) {
|
||||
emailval = false;
|
||||
$(email).addClass('brsr');
|
||||
}
|
||||
else {
|
||||
$(email).removeClass('brsr');
|
||||
}
|
||||
return emailval;
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
validate();
|
||||
isEmail($('[name=email]'));
|
||||
});
|
||||
|
||||
$('[required]').blur(function(){
|
||||
validate();
|
||||
});
|
||||
|
||||
$('#dlg').dialog({ buttons: [
|
||||
{ text: "Valider", click: function() {
|
||||
var values = $(this).find('form').serialize();
|
||||
if (validate() && isEmail($('[name=email]'))) {
|
||||
if ($('.loading').css('display')=='none') {
|
||||
$('.loading').css('display', 'block');
|
||||
$('.ui-dialog-content').css('overflow','hidden');
|
||||
$(".ui-dialog-buttonpane button:contains('Valider')").button("disable");
|
||||
}
|
||||
else { $('.loading').css('display', 'none');}
|
||||
$.post('/user/motpasse', values, function(data) {
|
||||
$('#dlg').html(data);
|
||||
});
|
||||
}
|
||||
}},
|
||||
{ text: "Annuler", click: function() { $(this).dialog('close'); }}
|
||||
] });
|
Loading…
Reference in New Issue
Block a user