fixed bug #0000004 : Contrôle valeur des dates de jugement et cessation de paiement

This commit is contained in:
Michael RICOIS 2009-03-17 14:16:38 +00:00
parent 755232edd8
commit 5803a1cfde
16 changed files with 76 additions and 23 deletions

View File

@ -7,9 +7,17 @@ $(document).ready(function(){
});
$(".date").blur(function() {
//Test du format date
$(this).val(dateInputFormat($(this).val()));
});
//Test spécifique
if( $(this).attr('name')=='jugement[dateJuge]' ){
if (ctrlDateJugement($(this).val())==false){ $(this).val(''); }
}
if( $(this).attr('name')=='jugement[datePaie]' ){
if (ctrlDatePaiement($(this).val())==false){ $(this).val(''); }
}
});
$("[name=jugement[source]]").change(function ()
{
@ -47,7 +55,7 @@ function loadFormSaisie(eventValue, params){
function dateInputFormat(value){
var returnDate='';
/*Check si on a tapé au moins 8 caractères*/
/*Check si on a tapé 8 caractères*/
if (value.length==8 && value.charAt(3)!='/'){
returnDate=value.substring(0,2)+'/'+value.substring(2,4)+'/'+value.substring(4,8);
}else{
@ -56,8 +64,56 @@ function dateInputFormat(value){
return returnDate;
}
function cmpDate(date,dateRef){
function ctrlDateJugement(value){
/*Check si on a tapé 10 caractères*/
if (value.length==10 && value.charAt(3)!='/'){
var currentTime=new Date();
var day = value.substring(0,2);
var month = value.substring(2,4);
var year = value.substring(4,8);
if(year>currentTime.getFullYear()){
alert("Vérifier votre date");
return false;
}else{
if(month>currentTime.getMonth()+1){
alert("Vérifier votre date");
return false;
}else{
if(day>currentTime.getDate()){
alert("Vérifier votre date");
return false;
}
}
}
return true;
}
}
function ctrlDatePaiement(value){
/*Check si on a tapé 10 caractères*/
if (value.length==10 && value.charAt(3)!='/'){
var currentTime=new Date();
var day = value.substring(0,2);
var month = value.substring(2,4);
var year = value.substring(4,8);
if(year>currentTime.getFullYear() || year<currentTime.getFullYear()-10){
alert("Vérifier votre date");
return false;
}else{
if(month>currentTime.getMonth()+1){
alert("Vérifier votre date");
return false;
}else{
if(day>currentTime.getDate()){
alert("Vérifier votre date");
return false;
}
}
}
return true;
}
}
function dateNow(){

View File

@ -161,7 +161,7 @@ if ($message<>'') {
<img src="./img/rub_identite<?if ($etab['Siege']==0) echo '_etab';?>.png" width="577" height="36">
<label>Num&eacute;ro identifiant, Siret</label>
<span class="left">
<?=substr($etab['Siren'],0,3).' '.substr($etab['Siren'],3,3).' '.substr($etab['Siren'],6,3).'&nbsp; <i>'.substr($etab['Siret'],9,5)?></i>
<?=substr($etab['Siren'],0,3).' '.substr($etab['Siren'],3,3).' '.substr($etab['Siren'],6,3).'&nbsp; <i>'.substr($etab['Siret'],9,5).'</i>'?>
</span>
<label>Raison Sociale</label>
<span class="left"><?=$etab['Nom']; if ($etab['Nom2']<>'') echo '<br/>'.$etab['Nom2'];?></span>

View File

@ -6,7 +6,7 @@ session_start();
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -7,7 +7,7 @@ include('getmandataires.php');
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -7,7 +7,7 @@ include('getmandataires.php');
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -6,7 +6,7 @@ include('getmandataires.php');
?>
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -7,7 +7,7 @@ include('getmandataires.php');
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -7,7 +7,7 @@ include('getmandataires.php');
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -7,7 +7,7 @@ include('getmandataires.php');
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -7,7 +7,7 @@ include('getmandataires.php');
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -7,7 +7,7 @@ include('getmandataires.php');
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -7,7 +7,7 @@ include('getmandataires.php');
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -7,7 +7,7 @@ include('getmandataires.php');
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -7,7 +7,7 @@ include('getmandataires.php');
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -7,7 +7,7 @@ include('getmandataires.php');
<script type="text/javascript" src="./js/thickbox.js"></script>
<label>Date cessation de paiement </label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<input type="text" class="date" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Administrateur <font color="Red">*</font></label>

View File

@ -8,6 +8,3 @@ session_start();
<input class="date" type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Date nouv. cl&ocirc;ture</label>
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" /><span class="left">(Format JJ/MM/AAAA)</span>