fixed bug #0000004 : Contrôle valeur des dates de jugement et cessation de paiement
This commit is contained in:
parent
755232edd8
commit
5803a1cfde
@ -7,10 +7,18 @@ $(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 ()
|
||||
{
|
||||
displayFormSource();
|
||||
@ -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(){
|
||||
@ -67,7 +123,7 @@ function dateNow(){
|
||||
month=''+month;
|
||||
if (month.length==1){month='0'+month;}
|
||||
var year=currentTime.getFullYear();
|
||||
return day+'/'+month+'/'+year;
|
||||
return day+'/'+month+'/'+year;
|
||||
}
|
||||
|
||||
|
||||
|
@ -161,7 +161,7 @@ if ($message<>'') {
|
||||
<img src="./img/rub_identite<?if ($etab['Siege']==0) echo '_etab';?>.png" width="577" height="36">
|
||||
<label>Numéro identifiant, Siret</label>
|
||||
<span class="left">
|
||||
<?=substr($etab['Siren'],0,3).' '.substr($etab['Siren'],3,3).' '.substr($etab['Siren'],6,3).' <i>'.substr($etab['Siret'],9,5)?></i>
|
||||
<?=substr($etab['Siren'],0,3).' '.substr($etab['Siren'],3,3).' '.substr($etab['Siren'],6,3).' <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>
|
||||
|
@ -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>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
include_once(realpath(dirname(__FILE__).'/constantes.php'));
|
||||
header('Content-Type: text/html; charset=ISO-8859-1');
|
||||
session_start();
|
||||
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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ôture</label>
|
||||
<input type="text" name="jugement[datePaie]" size="10" maxlength="10" value="" /><span class="left">(Format JJ/MM/AAAA)</span>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user