numChars = "0123456789"; // ***** // ** FONCTIONS DE LA VERSION 1.1.2 // ***** // ***************************************************************************** // ** // ** Crée le 01/03/02 par SRO // ** Modifiée le par // ** Reste à faire : // ** // ****************************************************************************** function verif_textarea(cible, message, taille_max){ var texte = cible.value; var mess_alerte = message; if (taille_max == 0) { taille_max = 10000000; } if(texte.length > taille_max) { // On coupe la chaîne alert(mess_alerte); cible.value = texte.substring(0,taille_max); } } // ***************************************************************************** // ** // ** // ** Crée le par LBH // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function retirerCandidature(retour, chemin, id, type_user, idoffre, page, mess_conf) { if( confirm(mess_conf) ) { location.href = chemin+"/perso/x_enleveannonce.php?id="+id+"&idAnnonce="+idoffre+"&type_user="+type_user + "&page="+page+"&retour="+retour; } } // ***************************************************************************** // ** // ** // ** Crée le par LBH // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function envoyerMail( id, idCabinet, idAnnonce ) { MM_openBrWindow('./frm_mailcabinet2.php?id=' + id + '&idCabinet=' + idCabinet +'&idAnnonce=' + idAnnonce,'window',CentrageFenetre(500,500)+',resizable=yes,scrollbars=yes'); } // ***************************************************************************** // ** // ** // ** Crée le par LBH // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function contacterCabinet(retour, chemin, id, type_user, idDest ) { MM_openBrWindow(chemin+'/messages/frm_contacter.php?id=' + id + '&type_user=' + type_user + '&idDest=' + idDest+'&retour='+retour,'window',CentrageFenetre(500,500)+',resizable=yes,scrollbars=yes' ); } // ***************************************************************************** // ** // ** Idem à "contacterCabinet" mais avec l'identifiant de l'annonce en plus // ** Crée le par SRO // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function contacterCabinetAvecAnnonce( id, type_user, idDest , idAnnonce) { MM_openBrWindow('./frm_contacter.php?id=' + id + '&type_user=' + type_user + '&idDest=' + idDest + '&idAnnonce=' + idAnnonce, 'window',CentrageFenetre(500,500)+',resizable=yes,scrollbars=yes' ); } // ***************************************************************************** // ** // ** // ** Crée le par LBH // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function detailCabinet( id, idCabinet ) { MM_openBrWindow('./frm_saisieademuser.php?id=' +id + '&idCabinet=' + idCabinet +'&modif=pasok', 'detailCabinet', CentrageFenetre(500, 250)+',resizable=yes,scrollbars=yes'); } // ***************************************************************************** // ** // ** // ** Crée le par LBH // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function afficherCVComplet(id, cpersonne) { MM_openBrWindow('./frm_cvcomplet.php?id=' + id + '&cpersonne=' + cpersonne, 'detailCabinet' ,CentrageFenetre(500,500)+',resizable=yes,scrollbars=yes'); } // ***************************************************************************** // ** // ** // ** Crée le par DPY // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function afficherDetailsCabinets(id, idCabinet) { MM_openBrWindow('./frm_saisiecabinet.php?id=' + id + '&idCabinet=' + idCabinet + 'modif=pasok', 'detailCabinet' ,CentrageFenetre(500,500)+',resizable=yes,scrollbars=yes'); } // ***************************************************************************** // ** // ** // ** Crée le par DPY // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function AfficherDetailOffre(retour, chemin, id, type_user, idAnnonce, poserCV) { MM_openBrWindow(chemin +'/consultOffres/frm_DetailOffre2.php?id=' + id + '&type_user=' + type_user + '&idAnnonce=' +idAnnonce + '&PoserCV=' + poserCV+'&retour='+retour,'window',CentrageFenetre(500,500)+',resizable=yes,scrollbars=yes'); //MM_openBrWindow('./frm_DetailOffre2.php?MONid=' + id + '&idAnnonce=' +idAnnonce + '&PoserCV=' + poserCV,'window',CentrageFenetre(500,500)+',resizable=yes,scrollbars=yes'); } // ***************************************************************************** // ** // ** // ** Crée le par DPY // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function ajouterAnnonce(retour, chemin, id) { MM_openBrWindow(chemin +'/vosAnnonces/frm_majannonce.php?id=' + id + '&idAnnonce=new&modif=ok&retour='+retour,'window',CentrageFenetre(650,620)+',resizable=yes,scrollbars=yes'); } // ***************************************************************************** // ** // ** // ** Crée le par DPY // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function modifierAnnonce(retour, chemin, id, idAnnonce) { MM_openBrWindow(chemin +'/vosAnnonces/frm_majannonce.php?id=' + id + '&idAnnonce=' + idAnnonce+'&retour='+retour,'window',CentrageFenetre(650,620)+',resizable=yes,scrollbars=yes'); } // ***************************************************************************** // ** // ** // ** Crée le par LBH // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function detailProfil(retour, chemin, id, type_user, idAnnonce) { MM_openBrWindow(chemin +'/mesCv/frm_creer_profil.php?id=' + id + '&type_user=' + type_user + '&idAnnonce=' + idAnnonce + '&modif=pasok&retour='+retour,'window',CentrageFenetre(500,500)+',resizable=yes,scrollbars=yes'); } // ***************************************************************************** // ** // ** // ** Crée le par LBH // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function ajouterProfil(retour, chemin, id, type_user) { MM_openBrWindow(chemin +'/mesCv/frm_creer_profil.php?id=' + id + '&type_user=' + type_user + '&idAnnonce=new&modif=ok&retour='+retour,'window',CentrageFenetre(500,500)+',resizable=yes,scrollbars=yes'); } // ***************************************************************************** // ** // ** // ** Crée le par DPY // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function proposerCV(id, idCVS) { MM_openBrWindow('./x_proposition.php?id=' + id +'&idcvs=' + idCVS,'window',CentrageFenetre(1, 1)+',resizable=yes,scrollbars=yes'); } // ***************************************************************************** // ** // ** // ** Crée le par DPY // ** Modifiée le par // ** Reste à faire : // ** // ** // ****************************************************************************** function modifierProfil(retour, chemin, id, type_user, idAnnonce) { MM_openBrWindow(chemin +'/mesCv/frm_creer_profil.php?id=' + id + '&type_user=' + type_user + '&idAnnonce=' + idAnnonce + '&modif=ok&retour='+retour,'window',CentrageFenetre(500,500)+',resizable=yes,scrollbars=yes'); } // **************************************************************************** // **************************************************************************** function appelerAncreSvg(ancre) //============================================================================= // Pour IExplorer, replace la fenêtre de gauche dans la section présélectionnée //============================================================================= { if (ancre == '') ancre = top.HAUT.document.forms[0].IPT_ANCRE.value; if ( ancre != '') if (navigator.appName != 'Netscape') parent.frames[0].location.hash = ancre; else parent.frames[0].location = parent.frames[0].location+'#'+ancre; } function rechargerFrameSvg(code, id, ancre) //============================================================================= // Replace la fenêtre de gauche dans la section présélectionnée //============================================================================= { if (ancre != '') ancre2 = '#'+ancre; //alert('./modifier-fiche2A.php?code='+code+'&id='+id+ancre); if (navigator.appName != 'Netscape') { parent.frames[0].location.reload(true); parent.frames[0].location = './modifier-fiche2A.php?code='+code+'&id='+id+ancre2; } else { //parent.frames[0].location.reload(true); parent.frames[0].location = './modifier-fiche2A.php'+ancre2+'?code='+code+'&id='+id; //parent.frames[0].location.reload(true); parent.frames[0].location.hash = ancre; } } function appelerAncre(ancre) //============================================================================= // Replace la fenêtre de gauche dans la section présélectionnée //============================================================================= { parent.frames[0].document.forms[0].ancre.value = ancre; parent.frames[0].document.forms[0].fermeture_suite_modif.value = 'YES'; parent.frames[0].document.forms[0].submit(); } function ramenerPays(code, libelle ) //============================================================================= // Ecrit le code pays choisit dans le champ IPT_PAYS du formulaire // parent et ferme la fenêtre de sélection. //============================================================================= { window.opener.document.forms[0].IPT_PAYS.value = code; window.opener.document.forms[0].IPT_LIB_PAYS.value = libelle; self.close (); } function ramenerFonction(code, lib ) //============================================================================= // Ecrit le code fonction choisit dans le champ IPT_FONCTION du formulaire // parent et ferme la fenêtre de sélection. //============================================================================= { window.opener.document.forms[0].IPT_FONCTION.value = code; window.opener.document.forms[0].IPT_LIB_FONCTION.value = lib; self.close (); } function ramenerDiplome(code,lib) //============================================================================= // Ecrit le code fonction choisit dans le champ IPT_FONCTION du formulaire // parent et ferme la fenêtre de sélection. //============================================================================= { window.opener.document.forms[0].IPT_DIPLOME.value = code; window.opener.document.forms[0].IPT_LIB_DIPLOME.value = lib; self.close (); } function ramenerPromotion(code,lib) //============================================================================= // Ecrit le code fonction choisit dans le champ IPT_FONCTION du formulaire // parent et ferme la fenêtre de sélection. //============================================================================= { window.opener.document.forms[0].IPT_PROMO.value = code; window.opener.document.forms[0].IPT_LIB_PROMO.value = lib; self.close (); } function ramenerGroupeAPE(code) //============================================================================= // Ecrit le code groupe APE choisit dans le champ IPT_GROUPE_APE du formulaire // parent et ferme la fenêtre de sélection. //============================================================================= { window.opener.document.forms[0].IPT_GROUPE_APE.value = code; self.close (); } function ramenerCodeAPE(code) //============================================================================= // Ecrit le code groupe APE choisit dans le champ IPT_GROUPE_APE du formulaire // parent et ferme la fenêtre de sélection. //============================================================================= { window.opener.document.forms[0].COD_APE.value = code; self.close (); } function choisirPromotion_CKBOX(chemin) //============================================================================= // Ouvre la fenêtre de sélection d'un pays //============================================================================= { MM_openBrWindow(chemin+'/reference/liste-promotion_CKBOX.php?IPT_DEFAULT='+document.forms[0].IPT_FONCTION.value,'window',CentrageFenetre(350,500)+',resizable=yes,scrollbars=yes'); } function choisirPays_CKBOX(chemin) //============================================================================= // Ouvre la fenêtre de sélection d'un pays //============================================================================= { MM_openBrWindow(chemin+'/reference/liste-pays_CKBOX.php?IPT_DEFAULT='+document.forms[0].IPT_FONCTION.value,'window',CentrageFenetre(350,500)+',resizable=yes,scrollbars=yes'); } function choisirFonction(chemin) //============================================================================= // Ouvre la fenêtre de sélection d'un code fonction //============================================================================= { MM_openBrWindow(chemin+'/reference/liste-fonction.php?IPT_DEFAULT='+document.forms[0].IPT_FONCTION.value,'window',CentrageFenetre(350,500)+',resizable=yes,scrollbars=yes'); } function choisirFonction_CKBOX(chemin) //============================================================================= // Ouvre la fenêtre de sélection d'un code fonction //============================================================================= { MM_openBrWindow(chemin+'/reference/liste-fonction_CKBOX.php?IPT_DEFAULT='+document.forms[0].IPT_FONCTION.value,'window',CentrageFenetre(350,500)+',resizable=yes,scrollbars=yes'); } function choisirGroupeAPE(chemin) //============================================================================= // Ouvre la fenêtre de sélection d'un groupe APE //============================================================================= { MM_openBrWindow(chemin+'/reference/liste-groupeAPE.php?IPT_DEFAULT='+document.forms[0].IPT_GROUPE_APE.value,'window',CentrageFenetre(350,500)+',resizable=yes,scrollbars=yes'); MM_openBrWindow(chemin+'/reference/liste-groupeAPE.php?IPT_DEFAULT='+document.forms[0].IPT_GROUPE_APE.value,'window',CentrageFenetre(350,500)+',resizable=yes,scrollbars=yes'); } function choisirDiplome(chemin) //============================================================================= // Ouvre la fenêtre de sélection des diplomes //============================================================================= { MM_openBrWindow(chemin+'/reference/liste-diplome_CKBOX.php?IPT_DEFAULT='+document.forms[0].IPT_GROUPE_APE.value,'windowCodeAPE',CentrageFenetre(350,500)+',resizable=yes,scrollbars=yes'); } function choisirCodeAPE_CKBOX(chemin) //============================================================================= // Ouvre la fenêtre de sélection d'un groupe APE //============================================================================= { MM_openBrWindow(chemin+'/reference/liste-codeAPE_CKBOX.php?IPT_DEFAULT='+document.forms[0].IPT_GROUPE_APE.value,'windowCodeAPE',CentrageFenetre(350,500)+',resizable=yes,scrollbars=yes'); } function choisirCodeAPE() //============================================================================= // Ouvre la fenêtre de sélection d'un groupe APE //============================================================================= { MM_openBrWindow('../../reference/liste-codeAPE.php?IPT_DEFAULT='+document.forms[0].COD_APE.value,'windowAPE',CentrageFenetre(350,500)+',resizable=yes,scrollbars=yes'); } function modifierFiche(chemin, code,id) //============================================================================= // Ouvre la fiche personne en modification dans une nouvelle fenêtre centrée //============================================================================= { MM_openBrWindow(chemin +'/palette02/modifier-fiche.php?code='+code+'&id='+id,'window',CentrageFenetre(675,550)+',resizable=yes,scrollbars=yes') } function modifierFiche2(code,id) //============================================================================= // Ouvre la fiche personne en modification dans une nouvelle fenêtre centrée //============================================================================= { MM_openBrWindow('../../annuaire/palette02/modifier-fiche.php?code='+code+'&id='+id,'window',CentrageFenetre(675,550)+',resizable=yes,scrollbars=yes') } function modifierFicheAValider(chemin, code,id) //============================================================================= // Ouvre la fiche personne en modification dans une nouvelle fenêtre centrée //============================================================================= { MM_openBrWindow(chemin +'/palette02/modifier-fiche.php?code='+code+'&id='+id+'&valider=OK','window',CentrageFenetre(675,550)+',resizable=yes,scrollbars=yes') } function modifierFicheLBH(code,id) //============================================================================= // Ouvre la fiche personne en modification dans une nouvelle fenêtre centrée //============================================================================= { MM_openBrWindow('../annuaire/palette02B/modifier-fiche.php?code='+code+'&id='+id,'window',CentrageFenetre(675,550)+',resizable=yes,scrollbars=yes') } function consulterFiche(chemin, code,id) //============================================================================= // Ouvre la fiche personne en consultation dans une nouvelle fenêtre centrée //============================================================================= { MM_openBrWindow(chemin +'/palette01/consulter-fiche.php?code='+code+'&id='+id,'window',CentrageFenetre(441,350)+',resizable=yes,scrollbars=yes') } function reouvrirFiche( url ) //============================================================================= // Ouvre la fiche personne en consultation dans une nouvelle fenêtre centrée //============================================================================= { MM_openBrWindow(url,'window2',CentrageFenetre(441,350)+',resizable=yes,scrollbars=yes') } function consulterFiche2(code,id) //============================================================================= // Ouvre la fiche personne en consultation dans une nouvelle fenêtre centrée //============================================================================= { MM_openBrWindow('../palette01/consulter-fiche.php?code='+code+'&id='+id+'&resumeModif=1','window3',CentrageFenetre(441,350)+',resizable=yes,scrollbars=yes') } function MM_openBrWindow(theURL,winName,features) //============================================================================= // Ouvre une nouvelle fenêtre //============================================================================= { window.open(theURL,winName,features); } function GoBack() //============================================================================= // Retour à la page précédente //============================================================================= { history.back(); } function CentrageFenetre( w, h ) //============================================================================= // Permet de formater le paramètre optionsFenêtre de la fonction // open(URL, nomFenêtre [, optionsFenêtre]) pour que la fenêtre // apparaisse centrée sur l'écran. //============================================================================= { var winl; var wint; winl = (screen.width - w) / 2; wint = (screen.height - h) / 2; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl; return( winprops ); } function defaultFocus (fieldname) //============================================================================= // Place le focus sur le champ indiqué. // Fonction à appeler dans l'évènement onload du tag html BODY. //============================================================================= { form = document.forms[0]; if (form) { for (var i=0 ; i tailleMax ) { alert( Msg ); return( 0 ); } return( 1 ); } function fnFormatageDate(strDateEntree,message) { var intlongueurdate; var boolDateOK; var dtDateCourante = new Date(); var intAnneeCourante; var intPositionSep; var intPositionLastSep; var strDate; var strJour; var strMois; var i; var strCarac; var annee; var intAnnee; intlongueurdate=strDateEntree.length; for (i=1;i<=intlongueurdate;i++) { strCarac=strDateEntree.substring(i-1,i); if ((isNaN(parseInt(strCarac))==true)&&(strCarac!="/")) { return(-1); } } if (intlongueurdate==1) { strJour="0"+strDateEntree; strMois=dtDateCourante.getMonth()+1; if (strMois < 10) { strMois="0"+strMois; } if (dtDateCourante.getYear()<=1000) { intAnneeCourante=1900+dtDateCourante.getYear() } else { intAnneeCourante=dtDateCourante.getYear() } strDate = strJour+"/"+strMois+"/"+intAnneeCourante; return(strDate); } if (intlongueurdate==2) { intPositionSep=strDateEntree.indexOf("/",1); if (intPositionSep =! -1) { return(-1); } else { strJour=strDateEntree.substring(0,2); strMois=dtDateCourante.getMonth()+1; if (strMois < 10) { strMois="0"+strMois; } if (dtDateCourante.getYear()<=1000) { intAnneeCourante=1900+dtDateCourante.getYear() } else { intAnneeCourante=dtDateCourante.getYear() } strDate = strJour+"/"+strMois+"/"+intAnneeCourante; return(strDate); } return(-1); } if (intlongueurdate==3) { intPositionSep=strDateEntree.indexOf("/",1); if (intPositionSep == -1) { strJour=strDateEntree.substring(0,2); strMois="0"+strDateEntree.substring(2,3); if (dtDateCourante.getYear()<=1000) { intAnneeCourante=1900+dtDateCourante.getYear() } else { intAnneeCourante=dtDateCourante.getYear() } strDate=strJour+"/"+strMois+"/"+intAnneeCourante; return(strDate); } if (intPositionSep == 1) { if (strDateEntree.substring(2,3)=="/") { return(-1); } else { strJour="0"+strDateEntree.substring(0,1); strMois="0"+strDateEntree.substring(2,3); intAnneeCourante=1900+dtDateCourante.getYear(); strDate = strJour+"/"+strMois+"/"+intAnneeCourante; return(strDate); } } return(-1); } if (intlongueurdate==4) { intPositionSep=strDateEntree.indexOf("/",1); if (intPositionSep == -1) { strJour=strDateEntree.substring(0,2); strMois=strDateEntree.substring(2,4); if (dtDateCourante.getYear()<=1000) { intAnneeCourante=1900+dtDateCourante.getYear() } else { intAnneeCourante=dtDateCourante.getYear() } strDate =strJour+"/"+strMois+"/"+intAnneeCourante; return(strDate); } if (intPositionSep == 1) { strJour="0"+strDateEntree.substring(0,1); strMois=strDateEntree.substring(2,4); if (dtDateCourante.getYear()<=1000) { intAnneeCourante=1900+dtDateCourante.getYear() } else { intAnneeCourante=dtDateCourante.getYear() } strDate =strJour+"/"+strMois+"/"+intAnneeCourante; return(strDate); } if (intPositionSep == 2) { strJour=strDateEntree.substring(0,2); strMois="0"+strDateEntree.substring(3,4); if (dtDateCourante.getYear()<=1000) { intAnneeCourante=1900+dtDateCourante.getYear() } else { intAnneeCourante=dtDateCourante.getYear() } strDate =strJour+"/"+strMois+"/"+intAnneeCourante; return(strDate); } return(-1); } if (intlongueurdate==5) { intPositionSep=strDateEntree.indexOf("/",1); if (intPositionSep == 2) { if ((strDateEntree.substring(3,4)=="/")||((strDateEntree.substring(4,5)=="/"))) { return(-1); } else { strJour=strDateEntree.substring(0,2); strMois=strDateEntree.substring(3,5); if (dtDateCourante.getYear()<=1000) { intAnneeCourante=1900+dtDateCourante.getYear() } else { intAnneeCourante=dtDateCourante.getYear() } strDate =strJour+"/"+strMois+"/"+intAnneeCourante; return(strDate); } } if (intPositionSep == -1) { strJour=strDateEntree.substring(0,2); strMois="0"+strDateEntree.substring(2,3); strAnnee=strDateEntree.substring(3,5); intAnnee=parseInt(strAnnee); if (intAnnee>=30) { strAnnee="19"+strAnnee; } else { strAnnee="20"+strAnnee; } strDate =strJour+"/"+strMois+"/"+strAnnee; return(strDate); } return(-1); } if (intlongueurdate==6) { intPositionSep=strDateEntree.indexOf("/",1); if (intPositionSep == 1) { intPositionLastSep=strDateEntree.lastIndexOf("/",5); if (intPositionLastSep==3) { strJour="0"+strDateEntree.substring(0,1); strMois="0"+strDateEntree.substring(2,3); annee = strDateEntree.substring(4,6); intAnnee=parseInt(annee); if (intAnnee>=30) { strAnnee="19"+annee; } else { strAnnee="20"+annee; } strDate =strJour+"/"+strMois+"/"+strAnnee; return(strDate); } else { return(-1); } } if (intPositionSep == -1) { strJour=strDateEntree.substring(0,2); strMois=strDateEntree.substring(2,4); annee = strDateEntree.substring(4,6); intAnnee=parseInt(annee); if (intAnnee>=30) { strAnnee="19"+annee; } else { strAnnee="20"+annee; } strDate =strJour+"/"+strMois+"/"+strAnnee; return(strDate); } return(-1); } if (intlongueurdate==7) { intPositionSep=strDateEntree.indexOf("/",1); if (intPositionSep == 1) { intPositionLastSep=strDateEntree.lastIndexOf("/",6); if (intPositionLastSep==4) { strJour="0"+strDateEntree.substring(0,1); strMois=strDateEntree.substring(2,4); annee=strDateEntree.substring(5,7); intAnnee=parseInt(annee); if (intAnnee>=30) { strAnnee="19"+annee; } else { strAnnee="20"+annee; } strDate =strJour+"/"+strMois+"/"+strAnnee; return(strDate); } else { return(-1); } } if (intPositionSep == 2) { intPositionLastSep=strDateEntree.lastIndexOf("/",6); if (intPositionLastSep==4) { strJour=strDateEntree.substring(0,2); strMois="0"+strDateEntree.substring(3,4); annee=strDateEntree.substring(5,7); intAnnee=parseInt(annee); if (intAnnee>=30) { strAnnee="19"+annee; } else { strAnnee="20"+annee; } strDate =strJour+"/"+strMois+"/"+strAnnee; return(strDate); } else { return(-1); } } return(-1); } if (intlongueurdate==8) { intPositionSep=strDateEntree.indexOf("/",1); if (intPositionSep == 1) { intPositionLastSep=strDateEntree.lastIndexOf("/",7); if (intPositionLastSep==3) { strJour="0"+strDateEntree.substring(0,1); strMois="0"+strDateEntree.substring(2,3); strAnnee=strDateEntree.substring(4,8); strDate =strJour+"/"+strMois+"/"+strAnnee; return(strDate); } else { return(-1); } } if (intPositionSep == 2) { intPositionLastSep=strDateEntree.lastIndexOf("/",7); if (intPositionLastSep==5) { strJour=strDateEntree.substring(0,2); strMois=strDateEntree.substring(3,5); annee=strDateEntree.substring(6,8); intAnnee=parseInt(annee); if (intAnnee>=30) { strAnnee="19"+annee; } else { strAnnee="20"+annee; } strDate =strJour+"/"+strMois+"/"+strAnnee; return(strDate); } else { return(-1); } } if (intPositionSep == -1) { strJour=strDateEntree.substring(0,2); strMois=strDateEntree.substring(2,4); strAnnee=strDateEntree.substring(4,8); strDate =strJour+"/"+strMois+"/"+strAnnee; return(strDate); } return(-1); } if (intlongueurdate==9) { intPositionSep=strDateEntree.indexOf("/",1); if (intPositionSep == 1) { intPositionLastSep=strDateEntree.lastIndexOf("/",8); if (intPositionLastSep==4) { strJour="0"+strDateEntree.substring(0,1); strMois=strDateEntree.substring(2,4); strAnnee=strDateEntree.substring(5,9); strDate =strJour+"/"+strMois+"/"+strAnnee; return(strDate); } else { return(-1); } } if (intPositionSep ==2) { intPositionLastSep=strDateEntree.lastIndexOf("/",8); if (intPositionLastSep==4) { strJour=strDateEntree.substring(0,2); strMois="0"+strDateEntree.substring(3,4); strAnnee=strDateEntree.substring(5,9); strDate =strJour+"/"+strMois+"/"+strAnnee; return(strDate); } else { return(-1); } } return(-1); } if (intlongueurdate==10) { intPositionSep=strDateEntree.indexOf("/",1); intPositionLastSep=strDateEntree.lastIndexOf("/",9); if ((intPositionSep == 2 ) && (intPositionLastSep == 5)) { return(strDateEntree); } else { return (-1); } return(-1); } return(-1); } //******************************************************************** // Fonction : TestDate // Description : test la date entree comme parametre et renvoie le message d'erreur // message si la date est non valide // Paramètres : strDate : date a formater // message : message à afficher si le controle est vide // Retour : vrai ou faux // Auteur : OMT // Date de creation : 06.11.99 // Modifie le : 10.02.99 //******************************************************************** function fnTestDate(strDate,message) { var intReste; var intTestJour; var intTestMois; var intTestAnnee; var intTestAnnee2; var dtMaDate; intTestJour=strDate.substring(0,2); intTestMois=strDate.substring(3,5); intTestAnnee=strDate.substring(6,10); strDateATester=intTestMois+"/"+intTestJour+"/"+intTestAnnee dtMaDate = new Date(strDateATester); if (intTestJour!=dtMaDate.getDate()) { return(false); } if (intTestMois!=(dtMaDate.getMonth()+1)) { return(false); } intTestAnnee2=parseInt(dtMaDate.getYear()) if (intTestAnnee2 < 1900 ) //a mettre une constante { intTestAnnee2=intTestAnnee2+1900 } if (intTestAnnee!=intTestAnnee2) { return(false); } return(true); } //******************************************************************* // Fonction : CompareDate // Description : compare les date entrees comme parametre sans controle de coherence // Retour : vrai ou faux // Auteur : OMT // Date de creation : 06.11.99 // Modifie le : 10.02.99 //******************************************************************* function fnCompareDate(strDate1,strDate2) { var strAnnee1; var strAnnee2; var strMois1; var strMois2; var strJour1; var strJour2; var boolDateValide; strAnnee1=strDate1.substring(6,10); strMois1=strDate1.substring(3,5); strJour1=strDate1.substring(0,2); strAnnee2=strDate2.substring(6,10); strMois2=strDate2.substring(3,5); strJour2=strDate2.substring(0,2); boolDateValide=true; if (parseInt(strAnnee1)>parseInt(strAnnee2)) { boolDateValide=false; } if (parseInt(strAnnee1) == parseInt(strAnnee2)) { if ((strMois1.indexOf("0",0) != -1) && (strMois1.indexOf("0",0) != 1)) { strMois1=strMois1.substring(1,2); } if ((strMois2.indexOf("0",0) != -1) && (strMois2.indexOf("0",0) != 1)) { strMois2=strMois2.substring(1,2); } if (parseInt(strMois1)>parseInt(strMois2)) { boolDateValide=false; } if (parseInt(strMois1) == parseInt(strMois2)) { if ((strJour1.indexOf("0",0) != -1)&&(strJour1.indexOf("0",0) != 1)) { strJour1=strJour1.substring(1,2); } if ((strJour2.indexOf("0",0) != -1) && (strJour2.indexOf("0",0) != 1)) { strJour2=strJour2.substring(1,2); } if (parseInt(strJour1)>parseInt(strJour2)) { boolDateValide=false; } } } return(boolDateValide); } function fnTestDateSimple(strDate) { var intReste; var intTestJour; var intTestMois; var intTestAnnee; var intTestAnnee2; var dtMaDate; if (strDate.length != 10) { return(false); } else { intTestJour=strDate.substring(0,2); intTestMois=strDate.substring(3,5); intTestAnnee=strDate.substring(6,10); strDateATester=intTestMois+"/"+intTestJour+"/"+intTestAnnee dtMaDate = new Date(strDateATester); if (intTestJour!=dtMaDate.getDate()) { return(false); } if (intTestMois!=(dtMaDate.getMonth()+1)) { return(false); } intTestAnnee2=parseInt(dtMaDate.getYear()) if (intTestAnnee2 < 1900 ) { intTestAnnee2=intTestAnnee2+1900 } if (intTestAnnee!=intTestAnnee2) { return(false); } return(true); } } //============================================================================= // Fonction : fnFormatTelFax // Description : Verifie si la valeur du controle est de type alpha // Parametres : pChamp : nom du controle a verifier //============================================================================= function fnFormatTelFax(pChamp) { var intLongueurChamp; var strCar; var strGoodChars; var intCptCar; var strRetour strRetour=""; strGoodChars="0123456789() "; intLongueurChamp = pChamp.value.length; for (intCptCar=1;intCptCar<=intLongueurChamp;intCptCar++) { strCar=pChamp.value.substring(intCptCar-1,intCptCar); if (strGoodChars.indexOf(strCar,0) == -1) strRetour=strRetour+" "; else strRetour=strRetour+strCar; } return(strRetour); } function affiche_fichier_lie(fichier_lie) { window.open("./../../cv/" + fichier_lie, "Information", "width=800,height=500,top=120,left=120,resizable=yes,scrollbars=yes"); }