Controle des emails

This commit is contained in:
Michael RICOIS 2010-01-29 17:34:24 +00:00
parent 03c2e101b6
commit 84ef417d4a

View File

@ -267,13 +267,26 @@ else
Siren : <?=substr($siren,0,3).' '.substr($siren,3,3).' '.substr($siren,6,3)?><br/>
Réference commande : G<?=$idCommande?><br/>
<br/>
<script type="text/javascript">
$(document).ready(function(){
$('form[name=commande]').submit(function(){
var eMail = $('input[name=emailCommande]').val();
var isMail = eMail.length;
var verif = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/
if(!isMail || verif.exec(eMail)==null){
alert('Veuillez saisir une adresse email.');
return false;
}
else { return true; }
});
});
</script>
<form name="commande" action="./?page=greffes&vue=<?=$vue?>&siret=<?=$siren?>" method="post">
<input type="hidden" name="action" value="sauvemail"/>
<label>Adresse email du destinataire</label>
<input name="emailCommande" type="text" value="<?=$_SESSION['tabInfo']['email']?>" size="40"/><br/>
<input name="emailCommande" type="text" value="<?php if ($_SESSION['tabInfo']['login']<>'testreunica' && $_SESSION['tabInfo']['login']<>'reunicacsf') echo $_SESSION['tabInfo']['email']?>" size="40"/><br/>
<br/>
<a href='#' id='TB_closeWindowButton' title='Close'>Fermer sans enregistrer</a>
&nbsp;&nbsp;&nbsp;<input type="submit" name="submit" value="Valider"/>
<input type="submit" name="submit" value="Valider"/>
</form>
<?php
}elseif(!$noemail && $dejaCommande && $sameLogin)
@ -501,11 +514,30 @@ if ( in_array($cj, $association_cj) )
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="2" class="StyleInfoData"><br/><br/>
<form action="./?page=greffes&action=commande&siret=<?=$siret?>&idEntreprise=<?=$idEntreprise?>" method="post">
<script type="text/javascript">
$(document).ready(function(){
$('form[name=commandeAsso]').submit(function(){
var eMail = $('input[name=email]').val();
var isMail = eMail.length;
var verif = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/
if(!isMail || verif.exec(eMail)==null){
alert('Veuillez saisir une adresse email.');
return false;
}
else { return true; }
});
});
</script>
<form name="commandeAsso" action="./?page=greffes&action=commande&siret=<?=$siret?>&idEntreprise=<?=$idEntreprise?>" method="post">
<p>Commander les statuts de l'association (d&eacute;lai approximatif de 15 jours)</p><br/>
<br/>Votre référence <input type="text" name="reference" value="" /><br/>
<br/>Votre téléphone <input type="text" name="tel" value="" maxlength="14" />
<br/>Adresse email du destinataire <input name="email" type="text" value="<?=$tabInfo['email']?>" size="20"/>
<br/>Adresse email du destinataire
<input name="email" type="text" value="
<?php
if ($_SESSION['tabInfo']['login']<>'testreunica' && $_SESSION['tabInfo']['login']<>'reunicacsf')
echo $_SESSION['tabInfo']['email']
?>"" size="20"/>
&nbsp;&nbsp;&nbsp;
<input
class="imgButton"