while not oRsTheme.EOF Set obj=createObject("Scripting.Dictionary") obj.Add "secId", cint(oRsTheme("sechospId")) obj.Add "secName", cstr(oRsTheme("Nom")) obj.Add "secNameFem", cstr(oRsTheme("NomFem")) set temp(i) = obj oRsTheme.moveNext i = i + 1 wend oRsTheme.close set oRsTheme=nothing APP_FiliereHosp = temp ' application.Lock ' application("filiereshosp") = temp ' application.unLock ' end if 'APP_FiliereHosp = application("filiereshosp") end function function APP_Region ' if isempty(application("region")) then dim oRsTheme Set oRsTheme = Server.CreateObject("ADODB.Recordset") oRsTheme.Open "SELECT * from typeRegion order by regNAme",oConn,3,3 dim temp(), temp2() redim preserve temp(oRsTheme.recordCount-1) dim i, obj i=0 while not oRsTheme.EOF Set obj=createObject("Scripting.Dictionary") obj.Add "id", cint(oRsTheme("regId")) obj.Add "name", cstr(oRsTheme("regName")) set temp(i) = obj oRsTheme.moveNext i = i + 1 wend oRsTheme.close set oRsTheme=nothing APP_Region = temp ' application.Lock ' application("region") = temp ' application.unLock ' end if ' APP_Region = application("region") end function function APP_Departement ' if isempty(application("departement")) then dim oRsTheme Set oRsTheme = Server.CreateObject("ADODB.Recordset") oRsTheme.Open "SELECT * from typeDepartement order by depId ASC",oConn,3,3 dim temp(), temp2() redim preserve temp(oRsTheme.recordCount-1) dim i, obj i=0 while not oRsTheme.EOF Set obj=createObject("Scripting.Dictionary") obj.Add "id", cstr(oRsTheme("depId")) obj.Add "name", cstr(oRsTheme("depName")) set temp(i) = obj oRsTheme.moveNext i = i + 1 wend oRsTheme.close set oRsTheme=nothing APP_Departement = temp ' application.Lock ' application("departement") = temp ' application.unLock ' end if ' APP_Departement = application("departement") end function function APP_call(pName) select case pName case "APP_region" APP_call = APP_region case "APP_departement" APP_call = APP_departement end select end function function getFamilleNames(List, famIds) if(isnull(famIds)) then exit function dim i, result , tab tab = split(famIds,",") result = "" for i =0 to ubound(tab) if(List(tab(i)) <> "") then if i > 0 then result = result & ", " result = result & List(tab(i)) end if next getFamilleNames = result end function function APP_FlashInfo_offers 'application("APP_FlashInfo_offers") = empty 'if isempty(application("APP_FlashInfo_offers")) then dim RsOffres, sql Set RsOffres = Server.CreateObject("ADODB.Recordset") sql = "SELECT top 5 offres.*, catname, secname, nom FROM offres " & _ " inner join recruteurs ON offres.recId = recruteurs.recId " & _ " inner join typeCategorie ON offres.catId = typeCategorie.catId " & _ " inner join typeSecteur ON offres.secId = typeSecteur.secId " & _ " inner join cadreemploi ON ','+offres.cadreids+',' LIKE '%,'+cast(cadreemploi.cadreId as nvarchar(10))+',%' " & _ " ORDER BY offid desc" RsOffres.Open sql,oConn,3,3 ' response.write sql dim temp, logo temp = "" while not RsOffres.EOF logo = "" if(not isnull(RsOffres("recLogo"))) then logo = replace(RsOffres("recLogo"), ".", "_small.") ' temp = temp & "" & _ ' ""&RsOffres("offTitre") & "" & _ ' "
" & RsOffres("recName") & "
" & _ ' RsOffres("secname")&" - "& getFamilleNames(APP_Famille, RsOffres("famIds"))& " - " & RsOffres("catname")& " - " & RsOffres("nom") &"" temp = temp & "" & _ "" & _ "" & _ " " & _ " " & _ "
" & _ "" & _ " " & _ "" & _ " " & _ " " & _ " " & _ " " & _ " " & _ "
" & _ "" & _ " " & _ " " & _ " " & _ "
" & _ " " & _ "
" & _ "
" & _ " " & _ " " & _ " " & _ " " & _ " " & _ " " & _ " " & _ " " & _ " " & _ " " & _ "
" & _ " "&RsOffres("offTitre") & _ "" & _ "
" & _ " " & _ " " & _ " " & _ " " & _ " " & _ "
" & _ " 22/08/15 " & _ " " & _ RsOffres("recName") & _ "
" & _ "
" & _ " Filière : "&RsOffres("secname")&" - Métier : "& getFamilleNames(APP_Famille, RsOffres("famIds"))& " - Cadre d'emploi : "& RsOffres("nom") &" - Catégorie : " & RsOffres("catname")& " .
" & _ "
" & _ "
" & _ " " RsOffres.moveNext wend temp = temp RsOffres.close set RsOffres=nothing APP_FlashInfo_offers = temp ' application.Lock ' application("APP_FlashInfo_offers") = temp ' application.unLock ' end if ' APP_FlashInfo_offers = application("APP_FlashInfo_offers") end function function APP_FlashInfo_FAQ 'application("APP_FlashInfo_FAQ") = empty ' if isempty(application("APP_FlashInfo_FAQ")) then dim oRSFAQ Set oRSFAQ = Server.CreateObject("ADODB.Recordset") oRSFAQ.Open "SELECT top 3 * from SuggestionInternaute "& _ " inner join cadreemploi on cadreemploi.cadreid = suggestioninternaute.cadreid " & _ " left join typeSuggestionQualification on typeSuggestionQualification.qualid = SuggestionInternaute.qualid" & _ " WHERE catid = 1 AND status = 1 and lastchildid is not null order by sugId desc",oConn,3,3 dim temp, goout, anscnt, timediff,fromDate,toDate, count temp = "" while not oRSFAQ.EOF ' temp = temp & ""&oRSFAQ("title")&"" & _ ' "
"&replace(replace(oRSFAQ("contenu"),vbcrlf," "),"?T","'") & "
" ' count = oconn.execute("Select count(*) as cnt from SuggestionInternaute where status = 1 and parent = "&oRSFAQ("sugId")) ' anscnt = count("cnt") ' if(anscnt>= 1) then ' if(anscnt>1) then ' temp = temp & ""&anscnt & " réponses - " ' else ' temp = temp &""&anscnt & " réponse - " ' end if ' end if ' temp = temp & ""&oRSFAQ("qualName") & " - " ' fromDate = cdate(oRSFAQ("dateCreation")) ' toDate = now ' if(DateDiff("h",fromDate,toDate)<2) then ' timediff = DateDiff("h",fromDate,toDate) & " heure" ' elseif (DateDiff("h",fromDate,toDate)<24) then ' timediff = DateDiff("h",fromDate,toDate) & " heures" ' elseif(DateDiff("d",fromDate,toDate)<2) then ' timediff = DateDiff("d",fromDate,toDate) & " jour" ' elseif(DateDiff("d",fromDate,toDate)<30) then ' timediff = DateDiff("d",fromDate,toDate) & " jours" ' elseif(DateDiff("m",fromDate,toDate)<12) then ' timediff = DateDiff("m",fromDate,toDate) & " mois" ' elseif DateDiff("yyyy",fromDate,toDate)<2 then ' timediff = DateDiff("yyyy",fromDate,toDate) & " année" ' else ' timediff = DateDiff("yyyy",fromDate,toDate) & " années" ' end if ' temp = temp & " il y a "& timediff temp = temp & " " & _ " " & _ " " & _ " " & _ " " & _ " " & _ "
" & _ " " & _ " " & _ " " & _ " " & _ " " & _ "
" & _ " " & _ " " & _ " " & _ " " & _ " " & _ "
" & _ " " & _ " " & _ " " & _ " " & _ " " & _ "
" & _ oRSFAQ("title") & _ "
" & _ replace(replace(oRSFAQ("contenu"),vbcrlf," "),"?T","'") & _ "
" & _ "
" & _ " " & _ " " & _ " " & _ " " & _ " " & _ "
" & _ " Voir la réponse " & _ "
" & _ " " & _ "
" & _ "
" & _ "
" & _ " " & _ "
" & _ " " oRSFAQ.moveNext wend temp = temp oRSFAQ.close set oRSFAQ=nothing APP_FlashInfo_FAQ = temp ' application.Lock ' application("APP_FlashInfo_FAQ") = temp ' application.unLock ' end if ' APP_FlashInfo_FAQ = application("APP_FlashInfo_FAQ") end function function APP_lastFAQLinks 'if isempty(application("lastFAQ")) then dim oRsTheme Set oRsTheme = Server.CreateObject("ADODB.Recordset") oRsTheme.Open "SELECT top 5 * from SuggestionInternaute inner join cadreemploi on cadreemploi.cadreid = suggestioninternaute.cadreid WHERE catid = 1 AND status = 1 and lastchildid is not null order by sugId desc",oConn,3,3 dim temp temp = "" while not oRsTheme.EOF temp = temp & ""&oRsTheme("title")&"
" oRsTheme.moveNext wend oRsTheme.close set oRsTheme=nothing APP_lastFAQLinks = temp ' application.Lock ' application("lastFAQ") = temp ' application.unLock ' end if ' APP_lastFAQLinks = application("lastFAQ") end function function APP_FlashInfo_articles ' application("APP_FlashInfo_articles") = empty ' if isempty(application("APP_FlashInfo_articles")) then dim oRsArt, sql Set oRsArt = Server.CreateObject("ADODB.Recordset") sql = "SELECT top 3 * from Debat WHERE debValidate = 1 AND debType = 'A' ORDER BY newid()" oRsArt.Open sql,oConn,3,3 ' response.write sql dim temp temp = "" temp = temp&" " & _ " " & _ " " & _ "
" & _ " " & _ " " & _ " " & _ "
" & _ " " & _ "
" & _ " " & _ " " & _ " " & _ " " & _ " " & _ "
" & _ " " & _ " " & _ " " & _ " " & _ " " & _ " " & _ "

"&oRsArt("debTitre")&"

" & _ "
" & _ " " & _ " " & _ " " & _ " " & _ " " & _ " " & _ "
" & _ " Lire l'article " & _ "
" & _ " " & _ "
" & _ "
" & _ "
" & _ "
" & _ " " temp = temp&" " & _ " " & _ " " & _ " " & _ "
" & _ " " oRsArt.moveNext while not oRsArt.EOF ' temp = temp & "" & _ ' "" temp = temp & " " & _ " " & _ " " oRsArt.moveNext wend temp = temp&"
"&oRsArt("debTitre") & "" & _ ' "
" & _ ' "
" & _ " " & _ " " & _ " " & _ " " & _ " " & _ " " & _ "
" & _ " " & _ "
" & _ "
" & _ "

"&oRsArt("debTitre") & "

" & _ "
" & _ "
" & _ "
" & _ "
" & _ "
" & _ "
" & _ "
" & _ " " & _ " " oRsArt.close set oRsArt=nothing APP_FlashInfo_articles = temp ' application.Lock ' application("APP_FlashInfo_articles") = temp ' application.unLock ' end if ' APP_FlashInfo_articles = application("APP_FlashInfo_articles") end function function APP_lastArticlesLinks ' if isempty(application("lastArticles")) then dim oRsTheme Set oRsTheme = Server.CreateObject("ADODB.Recordset") oRsTheme.Open "SELECT top 5 * from Debat WHERE debValidate = 1 ORDER BY newid()",oConn,3,3 dim temp temp = "" while not oRsTheme.EOF temp = temp & ""&oRsTheme("debTitre")&"
" oRsTheme.moveNext wend oRsTheme.close set oRsTheme=nothing APP_lastArticlesLinks = temp ' application.Lock ' application("lastArticles") = temp ' application.unLock ' end if ' APP_lastArticlesLinks = application("lastArticles") end function function APP_lastGILinks ' if isempty(application("lastGI")) then dim oRsTheme Set oRsTheme = Server.CreateObject("ADODB.Recordset") oRsTheme.Open "SELECT top 5 * from cadreEmploi WHERE etat = 1 or etat is null order by lastgridchange desc",oConn,3,3 dim temp temp = "" while not oRsTheme.EOF temp = temp & ""&oRsTheme("nom")&"
" oRsTheme.moveNext wend oRsTheme.close set oRsTheme=nothing APP_lastGILinks = temp ' application.Lock ' application("lastGI") = temp ' application.unLock ' end if ' APP_lastGILinks = application("lastGI") end function function MathMax(a,b) MathMax = a If b > a then MathMax = b end function function MathMin(a,b) MathMin = a If b < a then MathMin = b end function ''''Batches dim batcheID function Batches_launch (pType) batcheID = cstr(now()) response.write "batche launched : "&pType& " - " & batcheID & "
" oconn.execute ("INSERT INTO Batches_suivi (type, startDate, status) VALUES ('"&pType&"', '"&batcheID&"', 'LAUNCHED')") end function function Batches_done (pType) response.write "batche end : "&pType& " - " & batcheID & "-"&now()&"
" oconn.execute ("UPDATE Batches_suivi SET endDate = '"&cstr(now())&"', status = 'DONE' where startDate = '"&batcheID&"' AND type = '"&pType&"'") end function function Batches_lasttime(pType) oconn.execute ("UPDATE Batches_suivi SET lastDate = '"&cstr(now())&"' where startDate = '"&batcheID&"' AND type = '"&pType&"'") end function function Batches_info(pType, pInfo) oconn.execute ("UPDATE Batches_suivi SET lastDate = '"&cstr(now())&"', info = '"&pInfo&"' where startDate = '"&batcheID&"' AND type = '"&pType&"'") end function function Batches_logs(pType, pLogPath) oconn.execute ("UPDATE Batches_suivi SET logs = '"&pLogPath&"' where startDate = '"&batcheID&"' AND type = '"&pType&"'") end function Dim repEmail if request.ServerVariables("HTTP_HOST") = "91.121.69.48" OR instr(request.serverVariables("HTTP_HOST"),"developpement") >0 then repEmail = server.mappath("/email") Response.write "Développement
" else repEmail = server.mappath("/email") & "\" End if ' Définition de l'object pour la onnection a la bdd dim oConn, upl, upl2, oConnOld, Connexion2 set upl = nothing set upl2 = nothing set oConn = nothing set oConnOld = nothing ' Mail dim smtpHost smtpHost ="smtp.emploi-collectivites.fr" ' ----------------------------------------------------------------------------------- ' Sécurité injection SQL ' Auteur : Fabien LEYMONERIE ' Date : 29/09/2011 ' ----------------------------------------------------------------------------------- Dim increment, formItem if InStr(LCASE(request.ServerVariables("Script_Name")), "Captcha") < 1 and InStr(LCASE(request.ServerVariables("Script_Name")), "verifre") < 1 and InStr(LCASE(request.ServerVariables("Script_Name")), "tycotr") < 1 and (InStr(LCASE(Request.ServerVariables("Script_Name")),"friend")=0 and InStr(LCASE(Request.ServerVariables("Script_Name")),"upload")=0 and InStr(LCASE(Request.ServerVariables("Script_Name")),"postule")=0 and InStr(LCASE(Request.ServerVariables("Script_Name")),"depot_de_cv_update")=0 and InStr(LCASE(Request.ServerVariables("Script_Name")),"traite_faux_emails_tout_entite")=0 and InStr(LCASE(Request.ServerVariables("Script_Name")),"traite_red_emails")=0) then For Each formItem In Request.Form if formItem <> "g-recaptcha-response" then if (InStr(Trim(Request.Form(formItem)), "'") = 1) OR (InStr(Trim(Request.Form(formItem)), "--") > 0) OR (InStr(Trim(Request.Form(formItem)), " 0) then 'Response.write Request.Form(increment)&" --" 'Response.end Response.Redirect HTTP&"://www.emploi-collectivites.fr/badrequest.asp" end if end if Next end if for increment = 1 to Request.QueryString.Count if(InStr(Trim(Request.QueryString(increment)), "'") = 1) OR (InStr(Trim(Request.QueryString(increment)), "--") > 0) OR (InStr(Trim(Request.QueryString(increment)), " 0) then 'Response.write Request.Form(increment)&" --" 'Response.end Response.Redirect HTTP&"://www.emploi-collectivites.fr/badrequest.asp" end if next 'bracket methods function cleanBrackets(str) dim cnt cnt = countBrackets(str) if cnt > 0 then str = str & ")" if cnt < 0 then str = left(len(str)-1) cleanBrackets = str end function function countBrackets(str) dim cnt,i cnt = 0 For i = 1 To Len(str) if Mid(str, i, 1) = "(" then cnt = cnt + 1 if Mid(str, i, 1) = ")" then cnt = cnt - 1 Next countBrackets = cnt end function ' ----------------------------------------------------------------------------------- ' Add and Strip Slashes ' Auteur : Fabien LEYMONERIE ' Date : 08/10/2012 ' ----------------------------------------------------------------------------------- ' Returns a string with backslashes before characters that need to be quoted in database queries function addslashes(unsafeString) dim regEx set regEx = new RegExp with regEx .Global = true .IgnoreCase = true .Pattern = "([\000\010\011\012\015\032\042\047\134\140])" end with addslashes = regEx.replace(unsafeString, "\$1") set regEx = nothing end function function dateToStandard(pDate) if isnull(pDate) then dateToStandard = "" else dateToStandard = mid(pDate,7,4)&"-"&mid(pDate,4,2)&"-"&mid(pDate,1,2) end if end function ' Un-quote string quoted with addslashes() function stripslashes(safeString) dim regEx set regEx = new RegExp with regEx .Global = true .IgnoreCase = true .Pattern = "\\([\000\010\011\012\015\032\042\047\134\140])" end with stripslashes = regEx.replace(safeString, "$1") set regEx = nothing end function function getGoodDomain(email) dim gooddomain, orsdomain, domain,sql gooddomain = "0" ' 'response.Write email if instr(email,"@")>1 then domain = (split(email,"@"))(1) sql = "SELECT top 1 domain from domains where state2='GOOD' and domain='"& replace(domain,"'","''") &"'" set orsdomain = oconn.Execute(sql) gooddomain = "0" if orsdomain.EOF then 'response.write sql 'recherche du plus approchant orsdomain.close sql = "SELECT top 1 domain from domains where state2='GOOD' and (domain='"& domain &"'" dim i,j, tmp for i = 0 to len(domain) tmp = " OR domain like '" for j = 0 to len(domain) if j <> i then tmp = tmp & mid(domain,j+1,1) if j = i then tmp = tmp & "%" next tmp = tmp & "'" sql = sql&tmp next for i = 0 to len(domain) tmp = " OR domain like '" for j = 0 to len(domain) tmp = tmp & mid(domain,j+1,1) if j = i then tmp = tmp & "_" next tmp = tmp & "'" sql = sql&tmp next sql = sql&")" 'response.write sql on error resume next set orsdomain = oconn.Execute(sql) if err <> 0 then 'response.Write sql & " * " 'response.Write domain gooddomain = "0" else if not orsdomain.EOF then gooddomain = cstr(orsdomain("domain")) else gooddomain = "0" end if orsdomain.close end if on error goto 0 else orsdomain.close gooddomain = "0" end if 'response.write gooddomain end if if gooddomain <> "0" then getGoodDomain = replace(email, "@"&domain, "@"&gooddomain) else getGoodDomain = 0 end if end function ' ----------------------------------------------------------------------------------- ' URL rewriting ' Auteur : Fabien LEYMONERIE ' Date : 17/04/2012 ' ----------------------------------------------------------------------------------- Function RW_consultation_offres_emploi_view(offTitre, recName, offId, recCP) if not(isnull(recCP) OR len(recCP)<4 OR len(recCP)>5) then if(len(recCP)=4) then recCP ="0"&recCP recName= recName&"-"&left(recCP,2) end if RW_consultation_offres_emploi_view = HTTP&"://"&Request.ServerVariables("HTTP_HOST")&"/"&replace(replace(format_url(offTitre),"%",""),"_","-")&"/"&format_url(recName)&"/offre-emploi-territoriale/"&offId&".htm" End Function Function RW_consultation_offres_emploi_view_AT_ROOT(offTitre, recName, offId, recCP) RW_consultation_offres_emploi_view_AT_ROOT = replace(RW_consultation_offres_emploi_view(offTitre, recName, offId, recCP),HTTP&"://"&Request.ServerVariables("HTTP_HOST"),"") End Function Function RW_consultation_recherche_emploi_BY_REC(recName, recId) RW_consultation_recherche_emploi_BY_REC = HTTP&"://"&Request.ServerVariables("HTTP_HOST")&"/offre-emploi-territoriale-"&format_url(recName)&"/"&recId&".htm" End Function Function RW_debatpublic(debName, debId, debUrl) if(isNull(debUrl) or debUrl = "") then RW_debatpublic = HTTP&"://"&Request.ServerVariables("HTTP_HOST")&"/"&format_url(debName)&"-blog-territorial/"&debId&".htm" else RW_debatpublic = HTTP&"://"&Request.ServerVariables("HTTP_HOST")&"/"&debUrl&"-blog-territorial" end if End Function Function RW_annuaire_recruteur(recId,recName, RecCity, recDep, recReg) RW_annuaire_recruteur = HTTP&"://"&Request.ServerVariables("HTTP_HOST")&"/ville-mairie-"&format_url(recName)&"-"&format_url(recDep)&"-"&format_url(recReg)&"-rec"&recId End Function Function RW_annuaire_collectivite(SIREN, INSEE, CP ,Name, recDep, recReg) RW_annuaire_collectivite = HTTP&"://"&Request.ServerVariables("HTTP_HOST")&"/ville-mairie-"&format_url(Name)&"-"&format_url(recDep)&"-"&format_url(recReg)&"-s"&SIREN&"-i"&INSEE&"-cp"&CP End Function Function RW_annuaire_collectivite2(id ,Name, recDep, recReg) RW_annuaire_collectivite2 = HTTP&"://"&Request.ServerVariables("HTTP_HOST")&"/ville-mairie-"&format_url(Name)&"-"&format_url(recDep)&"-"&format_url(recReg)&"-i"&id End Function Function RW_FAQ(sugId,title,contenu) if(not isnull(title)) then if trim(cstr(title)) <> "" then RW_FAQ = HTTP&"://"&Request.ServerVariables("HTTP_HOST")&"/"&format_url(Replace_HtmlEntities_Sens(cstr(title), 1))&"-qr-"&cstr(sugId)&".htm" else RW_FAQ = HTTP&"://"&Request.ServerVariables("HTTP_HOST")&"/"&format_url(Replace_HtmlEntities_Sens(cstr(left(contenu,100)&"..."), 1))&"-qr-"&cstr(sugId)&".htm" end if else RW_FAQ = HTTP&"://"&Request.ServerVariables("HTTP_HOST")&"/"&format_url(Replace_HtmlEntities_Sens(cstr(left(contenu,100)&"..."), 1))&"-qr-"&cstr(sugId)&".htm" end if End Function Function RW_grilleIndiciaire_Grade(nom, secid, cadreid, gradeid, typeGI) if (""&secid) = "" then secid = 1 RW_grilleIndiciaire_Grade = HTTP&"://"&Request.ServerVariables("HTTP_HOST")&"/"&"grille-indiciaire-"&typeGI&"-"&removeaccents(nom)&"/"&secid&"/"&cadreid&"/"&gradeid&".htm" End Function Function RW_grilleIndiciaire_Cadre(nom, secid, cadreid, typeGI) if (""&secid) = "" then secid = 1 RW_grilleIndiciaire_Cadre = HTTP&"://"&Request.ServerVariables("HTTP_HOST")&"/"&"grille-indiciaire-"&typeGI&"-"&removeaccents(nom)&"/"&secid&"/"&cadreid&".htm" End Function Function CheckReCaptcha() if instr(request.ServerVariables("HTTP_HOST"),"localhost:8047") >0 then CheckReCaptcha = true elseif isempty(Session("reCaptcha")) then CheckReCaptcha = false elseif Session("reCaptcha") <= 0 then CheckReCaptcha = false else Session("reCaptcha") = Session("reCaptcha") - 1 CheckReCaptcha = true end if end function ' ----------------------------------------------------------------------------------- ' fonction pour virer les accents dans les mots clés de la recherche ' Auteur : Fabien LEYMONERIE ' Date : 20/10/2011 ' ----------------------------------------------------------------------------------- Function Remove_accents(chaine) Dim accents, result Dim sans_accents dim i_accents accents = "àâäåãáÂÄÀÅÃÁæÆçÇéèêëÉÊËÈïîìíÏÎÌÍñÑöôóòõÓÔÖÒÕùûüúÜÛÙÚÿ" sans_accents = "aaaaaaaaaaaaaacceeeeeeeeiiiiiiiinnoooooooooouuuuuuuuy" result = trim(chaine) if isnull(result) then result = "" For i_accents = 1 to len(accents) result = replace(result, mid(accents,i_accents,1), mid(sans_accents,i_accents,1)) Next Remove_accents = result end function ' ----------------------------------------------------------------------------------- ' fonction pour nettoyer les mots clés de recherche ' Auteur : Fabien LEYMONERIE ' Date : 20/10/2011 ' ----------------------------------------------------------------------------------- Function CleanSearchKeywords(chaine) dim tmp tmp = chaine tmp = replace(tmp,"-"," ") tmp = replace(tmp,"%"," ") tmp = replace(tmp,"/"," ") tmp = replace(tmp,"\"," ") tmp = replace(tmp,"$"," ") tmp = replace(tmp,"_"," ") tmp = replace(tmp,"["," ") tmp = replace(tmp,"]"," ") tmp = replace(tmp,chr(34)," ") CleanSearchKeywords = tmp end function ' ----------------------------------------------------------------------------------- ' fonction pour formater des dates au plus court ' Auteur : Fabien LEYMONERIE ' Date : 20/10/2011 ' ----------------------------------------------------------------------------------- Function FormatMediumDate(DateValue) Dim strYYYY Dim strMM Dim strDD strYYYY = CStr(DatePart("yyyy", DateValue)) strMM = CStr(DatePart("m", DateValue)) If Len(strMM) = 1 Then strMM = "0" & strMM strDD = CStr(DatePart("d", DateValue)) If Len(strDD) = 1 Then strDD = "0" & strDD FormatMediumDate = strDD & "/" & strMM & "/" & Right(strYYYY,2) End Function Function FormatMediumDateWithTime(DateValue) Dim strYYYY Dim strMM Dim strDD Dim strHH Dim strNN strYYYY = CStr(DatePart("yyyy", DateValue)) strMM = CStr(DatePart("m", DateValue)) If Len(strMM) = 1 Then strMM = "0" & strMM strDD = CStr(DatePart("d", DateValue)) If Len(strDD) = 1 Then strDD = "0" & strDD strHH = CStr(DatePart("h", DateValue)) If Len(strHH) = 1 Then strHH = "0" & strHH strNN = CStr(DatePart("n", DateValue)) If Len(strNN) = 1 Then strNN = "0" & strNN FormatMediumDateWithTime = strDD & "/" & strMM & "/" & Right(strYYYY,2) & " " & strHH & ":" & strNN End Function ' ----------------------------------------------------------------------------------- ' Gestion des droits ' Auteur : Gallois Cyrille ' Date : 05/2011 ' ----------------------------------------------------------------------------------- function AllowTo (droitid, userid) dim StrSql, oComm, oRs strSQL = "select valeur from userdroit where userid = ? and droit_id = ? " set oComm = Server.createObject("ADODB.command") oComm.activeconnection = oConn oComm.commandtext = strSQL oComm.parameters.append oComm.createparameter("userid", adInteger,adParamInput) oComm.parameters.append oComm.createparameter("droit_id", adInteger,adParamInput) oComm.parameters(0).value = cLng(userid) oComm.parameters(1).value = cLng(droitid) set oRs = oComm.execute if oRs.eof and oRs.bof then AllowTo = false else if not oRs.eof then AllowTo = trim(oRs.fields(0).value) = "1" end if end if end function ' ----------------------------------------------------------------------------------- ' Revoit si une offre a expiré ou non ' Auteur : Gallois Cyrille ' Date : 05/2011 ' ----------------------------------------------------------------------------------- function OffreExpired (offreId) dim StrSql, oComm, oRs strSQL = "select o.offID " & _ " from offres o inner join recruteurs r on o.recid = r.recid " & _ " and o.offValidateDate < GetDate() - " &NbJourExpiration()& " " & _ " and o.offSupprimee = 0 " & _ " and o.offPublication = 1 " & _ " and r.recValidate = 1 " & _ " and o.offCollectivite = 1 " & _ " and o.offDate > '01/01/2006' " & _ " and o.offid = ? " & _ " order by o.offDate DESC " set oComm = Server.createObject("ADODB.command") oComm.activeconnection = oConn oComm.commandtext = strSQL oComm.parameters.append oComm.createparameter("offId", adInteger,adParamInput) oComm.parameters(0).value = cLng(offreId) set oRs = oComm.execute if oRs.eof and oRs.bof then OffreExpired = false else OffreExpired = true end if end function ' ----------------------------------------------------------------------------------- ' retour de la valeur de nombre de jour d'expiration des offres ' Auteur : Gallois Cyrille ' Date : 02/2011 ' ----------------------------------------------------------------------------------- Function NbJourExpiration() nbjourexpiration = ParametreLocal("NBJEXPIRATION") end function ' ----------------------------------------------------------------------------------- ' retour de la valeur de nombre d'annonce rafraichi quotidiennement ' Auteur : Gallois Cyrille ' Date : 02/2011 ' ----------------------------------------------------------------------------------- Function NbAnnonceRafraichie() nbjourexpiration = ParametreLocal("NUMBERREFRESH") end function ' ----------------------------------------------------------------------------------- ' retour de la valeur de nombre d'annonce filtée rafraichi quotidiennement ' Auteur : Gallois Cyrille ' Date : 02/2011 ' ----------------------------------------------------------------------------------- Function NbAnnonceFiltreRafraichie() nbjourexpiration = ParametreLocal("NBREFRESHFILTRE") end function ' ----------------------------------------------------------------------------------- ' retour de jour avant que le poste soit marqué pourvu ' Auteur : Gallois Cyrille ' Date : 02/2011 ' ----------------------------------------------------------------------------------- Function NbJourPourvu() NbJourPourvu = ParametreLocal("NBJPOURVU") end function ' ----------------------------------------------------------------------------------- ' Fonction afin de trouver les valeurs des paramètres locaux ' Auteur : Fabien LEYMONERIE ' Date : 02/2012 ' ----------------------------------------------------------------------------------- function GetDBVariable(code) Dim oRs, strSQL call ConnectToCE() set oRs = server.createObject("ADODB.RecordSet") strSQL = " select * from DBVariables where upper(Code) = '" & ucase(code) & "'" set oRs = oConn.Execute(strSQL) if not (oRs.EOF and oRs.BOF) then GetDBVariable = cstr(oRs.fields("Val").value) else GetDBVariable = "" end if oRs.Close end function ' ----------------------------------------------------------------------------------- ' Fonction afin de trouver les valeurs des paramètres locaux ' Auteur : Gallois Cyrille ' Date : 02/2011 ' ----------------------------------------------------------------------------------- function ParametreLocal(nom) Dim oRs, strSQL call ConnectToCE() set oRs = server.createObject("ADODB.RecordSet") strSQL = " select * from databaseparameter where upper(Nom) = '" & ucase(nom) & "'" set oRs = oConn.Execute(strSQL) if not (oRs.EOF and oRs.BOF) then ParametreLocal = cstr(oRs.fields("IntValue").value) else ParametreLocal = "" end if 'Call ClearRessources() end function ' ----------------------------------------------------------------------------------- ' Fonction pour la mise à jour des paramètres locaux ' Auteur : Gallois Cyrille ' Date : 02/2011 ' ----------------------------------------------------------------------------------- function UpdateParametreLocal(paramid,nom,valeur) Dim strSQL call ConnectToCE() strSQL = " update databaseparameter set intvalue="&valeur&" where " if paramid <> -1 then strSQL = strsql + " paramid = " + paramid elseif nom <> "" then strSQL = strsql + " upper(nom) = '" + ucase(nom) + "'" else HandleError "Impossible de modifier le parametre spéficié" end if 'Call ClearRessources() end function ' ----------------------------------------------------------------------------------- ' Fonction pour enlever les accents ' Auteur : Gallois Cyrille ' Date : 2011 ' ----------------------------------------------------------------------------------- function strtr(chaine, strFrom, strTo) Dim c0, c1, i for i = 1 to len(strFrom) 'récupération d'un caractère 'de la chaîne strFrom à la 'position i c0 = mid(strFrom, i, 1) 'Si la longueur de la chaîne 'strTo dépasse celle de strFrom 'alors on remplace par rien if i > len(strTo) Then c1 = "" else c1 = mid(strTo, i, 1) end if 'Remplacement des caractères 'dans la chaîne de départ chaine = Replace(chaine, c0, c1) next chaine = replace(chaine, chr(34), "-") 'On renvoie la chaîne sans accents strtr = chaine end function '@param1 => chaîne : chaîne à transformer '@return => chaîne : retourne la chaîne traduite function removeAccents(byval chaine) Dim accent, noaccent, ch accent = "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿ .?#'’" noaccent = "AAAAAAACEEEEIIIIDNOOOOOOUUUUYbsaaaaaaaceeeeiiiidnoooooouuuyyby------" if isnull(chaine) then chaine = "" if isempty(chaine) then chaine = "" 'response.write chaine chaine = trim(chaine) if chaine <> "" then removeAccents = strtr(chaine, accent, noaccent) else removeAccents ="" end if end function function removeNotLetter(byval chaine) Dim accent, noaccent accent = " .?#'’/()[]*+{}""" noaccent = "----------------" if chaine <> "" then removeNotLetter = strtr(chaine, accent, noaccent) else removeNotLetter ="" end if end function function remove_plurals(str) str = split(str," ") dim tmp , item, result result = "" For Each item in str tmp = item if( right(item,1) = "s") then tmp = left(item,len(item)-1) elseif( right(item,4) = "eaux") then tmp = left(item,len(item)-4) elseif( right(item,3) = "aux") then tmp = left(item,len(item)-3) elseif( right(item,2) = "al") then tmp = left(item,len(item)-2) end if if(len(tmp)>=4)then item = tmp result = result & item &" " Next remove_plurals = trim(result) end function function remove_shortwords_from_url(str, nb) str = split(str,"-") dim item, tmp tmp = "" For Each item in str if len(item) > nb then tmp = tmp & item & "-" end if Next if(len(tmp)>0) then tmp = left(tmp, len(tmp)-1) remove_shortwords_from_url = tmp end function function get_shortwords_from_url(str, nb) str = split(str,"-") dim item, tmp tmp = "" For Each item in str if len(item) <= nb then tmp = tmp & item & "-" end if Next tmp = left(tmp, len(tmp)-1) get_shortwords_from_url = tmp end function function remove_code_from_url(str) str = "-"&str&"-" dim regEx set regEx = New RegExp regEx.Global = True regEx.Pattern = "\-(^\-)*(0-9])*(^\-)*\-" str = regEx.REPLACE(str,"-") remove_code_from_url = str end function function format_url(url_to_format) format_url = getWords(url_to_format, 1) end function function getWords(url_to_format, noaccent) getWords = getWordsWithFilter(url_to_format, noaccent, 0, "") end function function ismobile() if isempty(session("ismobile")) then dim u,b,v, mobile set u= Request.ServerVariables("HTTP_USER_AGENT") set b=new RegExp set v=new RegExp session("ismobile") = false b.Pattern="(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino" v.Pattern="1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-" b.IgnoreCase=true v.IgnoreCase=true b.Global=true v.Global=true if b.test(u) or v.test(Left(u,4)) then session("ismobile") = true end if end if ismobile = session("ismobile") end function 'Formater une url 'in=> url_to_format: str (chaine de caractères à formater) 'out=> formated_url: str (chaine de caractères formatée) function getWordsWithFilter(url_to_format, noaccent, nonumber, filtrage) if(isnull(url_to_format) or trim(url_to_format)="") then getWordsWithFilter = "" else dim temp temp = lcase(trim(url_to_format)) dim formated_url formated_url="" dim regEx set regEx = New RegExp regEx.Global = True 'pour virer les mauvais caractère avant traitement regEx.Pattern = "[^A-Za-z0-9_]" if noaccent = 1 then temp = regEx.REPLACE(removeAccents(temp)," ") else temp = replace(removeNotLetter(temp),"-", " ") end if if nonumber = 1 then regEx.Pattern = "[0-9]" temp = regEx.REPLACE(temp," ") end if temp = replace(temp," "," ") ' Nouvelle recherche A voir (ex: villeneuve ?) regEx.Pattern = " " if(trim(lCase(url_to_format)) <>"mairie" and trim(lCase(url_to_format)) <>"ville de" ) then regEx.Pattern = " mairie|ville de" regEx.Pattern = regEx.Pattern&words_filter&filtrage 'response.write temp&"
" temp = regEx.REPLACE(LCase(" "&temp&" ")," ") temp = regEx.REPLACE(temp, " ") temp = replace(temp," ","-") ' On split l'url dans un tableau dim wordSplit wordSplit = Split(temp, "-") dim bclWS dim tir tir = 0 for bclWS = 0 to ubound(wordSplit) if noaccent = 1 then wordSplit(bclWS) = LCase(removeAccents(wordSplit(bclWS))) dim secondSplit dim sizeToKeep sizeToKeep = 0 ' On remplit pour les nouveaux - secondSplit = Split(wordSplit(bclWS), "-") dim bclSS for bclSS = 0 to ubound(secondSplit) if (len(secondSplit(bclSS))>sizeToKeep) then sizeToKeep = len(secondSplit(bclSS)) next if sizeToKeep > 4 then sizeToKeep = 4 for bclSS = 0 to ubound(secondSplit) ' Première recherche regEx.Pattern = "[^A-Za-z0-9_]" if noaccent = 1 then secondSplit(bclSS) = regEx.REPLACE(secondSplit(bclSS)," ") ' Nouvelle recherche A voir (ex: villeneuve ?) ' regEx.Pattern = "mairie|ville de" ' secondSplit(bclSS) = regEx.REPLACE(secondSplit(bclSS),"") if (len(secondSplit(bclSS))>=sizeToKeep)then if (tir > 0) then formated_url = formated_url&"-"&secondSplit(bclSS) else formated_url = formated_url&secondSplit(bclSS) tir = tir+1 end if end if next next 'limitation à 90 caractères dim splited if instr(formated_url,"-") > 0 then splited = Split(formated_url, "-") formated_url = splited(0) for bclSS = 1 to ubound(splited) if len(formated_url&"-"&splited(bclSS)) < 80 then formated_url = formated_url&"-"&splited(bclSS) end if next end if 'on vire les mots de une lettre formated_url = split(formated_url, "-") for bclSS = 1 to ubound(formated_url) if len(formated_url(bclSS)) < 2 then formated_url(bclSS)="" end if next formated_url = trim(join(formated_url, " ")) formated_url = replace(formated_url," "," ") formated_url = replace(formated_url," "," ") formated_url = replace(formated_url," "," ") formated_url = replace(formated_url," ","-") getWordsWithFilter = formated_url end if end function 'function compter_occurences_str(chaine,str_a_trouver) ' dim c 'c = 0 ' for i= 1 to len(chaine) ' if mid(chaine,i,1)=str_a_trouver then c=c+1 ' next 'compter_occurences_str = c 'end function ' ----------------------------------------------------------------------------------- ' Fonction de coupure des mots ' Auteur : Gallois Cyrille ' Date : 2011 ' ----------------------------------------------------------------------------------- Function sesure_mot(byval texte, longueur) Dim j Dim car Dim Tempotext Dim Filtration j = longueur Tempotext = texte 'Elimination des balises images while instr(ucase(Tempotext), "0 Filtration = left(Tempotext,instr(ucase(Tempotext), "")) Tempotext = filtration wend Do While j <= Len(Tempotext) car = Mid(Tempotext, j, 1) If car = " " Or car = Chr(10) Or car = Chr(13) Or car = "," Or car = "." Or car = ";" Or car = ":" Then Exit Do End If j = j + 1 Loop sesure_mot = Left(Tempotext, j) '--- le résumé est plus court que le texte initial If Len(sesure_mot) < Len(Tempotext) Then sesure_mot = sesure_mot & " ..." End If End Function ' ----------------------------------------------------------------------------------- ' Fonction renvoyant le nombre de mots indiqués ' Auteur : Gallois Cyrille ' Date : 2011 ' ----------------------------------------------------------------------------------- Function retour_mot(byval texte, NbMot) Dim TableauMot, j, TempoMot texte = replace(texte, " d'", " ") texte = replace(texte, " de ", " ") texte = replace(texte, " du ", " ") texte = replace(texte, " à ", " ") texte = removeaccents(texte) texte = replace(texte, "-", " ") TableauMot = split(texte, " ") j=0 Do While j < NbMot and j < ubound(TableauMot) if trim(TableauMot(j)) <> "" then TempoMot = TempoMot + " " + trim(TableauMot(j)) end if j = j + 1 Loop retour_mot = trim(TempoMot) End Function ' ----------------------------------------------------------------------------------- ' ----------------------------------------------------------------------------------- Public Function CreateErrorMsg(byval sContext) ' Description : Permet de creer un message d'erreur ' Paramètres : ' - sContext : string, message a afficher ' Return : string contenant du code html ' ----------------------------------------------------------------------------------- Dim sMessage sMessage = vbCrLf & "

" & vbCrLf & _ "An error occured in the page " & _ request.ServerVariables("SCRIPT_NAME") & " which was not completely processed.

" & vbCrlf sContext = Trim(vbNullString & sContext) If sContext <> vbNullString Then sMessage = sMessage & "Context:
" & sContext & "

" & vbCrLf End if 'sMessage = sMessage & Replace("Error " & err.Number & " (0x" & Ucase(Hex(err.Number)) & "):
" & _ ' Err.Description & "

Call stack:
" & Err.Source & "
", vbCrLf, "
") 'CreateErrorMsg = sMessage End Function ' ----------------------------------------------------------------------------------- ' ----------------------------------------------------------------------------------- Public Sub HandleError(byval sContext, byval sClearFunc) ' Description : vérifie si une erreur c produite, si c le cas, affichage ' d'un message d'erreur, execution d'une fonction de destruction ' d'object en cours et arret de l'execution du script ' Paramètres : ' - sContext : string, message d'erreur a afficher ' - sClearFunc : string, nom de la fonction a executer en cas de detection d'erreurs ' Return : - ' ----------------------------------------------------------------------------------- Dim sMessage 'If Err.Number Then IF 1 = 0 then sClearFunc = Trim(vbNullString & sClearFunc) if sClearFunc = vbNullString Then sClearFunc = "ClearResources" end if response.write CreateErrorMsg(sContext) On Error Resume next ' appel de la fonction de nettoyage Execute sClearFunc Response.End End If End sub ' ----------------------------------------------------------------------------------- ' ----------------------------------------------------------------------------------- Public Sub ClearRessources() ' Description : Fonction de destruction des objets oConn et oRs ' Paramètres : - ' Return : - ' ----------------------------------------------------------------------------------- On Error Resume Next rs.Close set rs = nothing oRs.Close set oRs = Nothing oRs1.Close set oRs1 = Nothing oRs2.Close set oRs2 = Nothing oRs3.Close set oRs3 = Nothing oRsOld.Close set oRsOld = Nothing oRsRec.close set oRsRec = nothing RsRec.close set RsRec = nothing oRsOffres.close set oRsOffres = nothing oConn.Close Set oConn = Nothing oConnOld.Close Set oConnOld = Nothing set oFile = nothing set oFs = nothing End sub Public Sub ClearRessourcesEnd() ' Description : Fonction de destruction des objets oConn et oRs ' Paramètres : - ' Return : - ' ----------------------------------------------------------------------------------- On Error Resume Next cmd.Close set cmd = nothing oCmd.Close set oComd = nothing oCommande.Close set oCommande = nothing rs.Close set rs = nothing rs_rec.Close set rs_rec = nothing mail.Close set mail = nothing FSO.Close set FSO = nothing oRsHE.Close set oRsHE = nothing rsxml.Close set rsxml = nothing oRsLocal.Close set oRsLocal = nothing myMail.close Set myMail = Nothing set eMail = nothing set oFile = nothing oFSO.Close set oFSO = nothing upl.Close set upl = nothing upl2.Close set upl2 = nothing rsnonlogues.close set rsnonlogues = nothing End sub ' ============================================================================ Public Sub ConnectToCE () ' ---------------------------------------------------------------------------- ' DESCRIPTION : This function connect to EMPLOI COLLECTIVITES SQL database ' PARAMETERS : ' AUTHOR : Patrice TRICHOT ' CREATION DATE : 20-02-2001 ' MODIFICATION DATE : ' ============================================================================ On Error Resume Next Dim sConnectString if not(oConn is nothing) then exit sub Set oConn = Server.CreateObject("ADODB.Connection") if instr(request.ServerVariables("HTTP_HOST"),"localhost:8047") >0 then sConnectString = "Provider=SQLOLEDB;Data Source=localhost;" _ & "Initial catalog=collectivite;Trusted_Connection=No;" _ & "User ID=sa;Password=D1lbertL1ves;LANGUAGE=french;" sConnectString = "Provider=SQLOLEDB;Data Source=localhost;" _ & "Initial Catalog=contactemploi;Trusted_Connection=No;" _ & "User ID=sa;Password=D1lbertL1ves;LANGUAGE=french;" elseif instr(request.ServerVariables("HTTP_HOST"),"dev.") >0 then sConnectString = "Provider=SQLOLEDB;Data Source=213.11.172.25;" _ & "Initial catalog=collectivite;Trusted_Connection=No;" _ & "User ID=utilisateur_code;Password=a03ff6k8p;LANGUAGE=french;" else sConnectString = "Provider=SQLOLEDB;Data Source=213.11.172.25;" _ & "Initial catalog=collectivite;Trusted_Connection=No;" _ & "User ID=utilisateur_code;Password=a03ff6k8p;LANGUAGE=french;" end if Session("connectionString") = sConnectString 'Response.write sConnectString & "
" oConn.ConnectionTimeout = 25 ' oConn.ConnectionTimeout = 45 oConn.CommandTimeout = 100 'oConn.CommandTimeout = 180 oConn.CursorLocation = adUseClient oConn.Open sConnectString HandleError "Openning connection object.", "ClearRessources" end Sub ' ----------------------------------------------------------------------------------- ' ----------------------------------------------------------------------------------- Public Function returnRequest(byval sRequest, byVal vDefault) ' Description : la valeur du request ou la valeur par default si request vide ' Paramètres : ' - sRequest : string, nom du champ ' - vDefault : variant, valeur par default ' ' Return : boolean, true or false (error or not) ' ----------------------------------------------------------------------------------- on error resume next dim typForm, field if upl is nothing and upl2 is nothing then typForm = "form_" if (isnull(request(sRequest)) or request(sRequest)="") then if vDefault = "-STRING-" then returnRequest = "" else returnRequest = vDefault end if else if isnumeric(request(sRequest)) and (vDefault <> "-STRING-") then returnRequest = cdbl(request(sRequest)) else returnRequest = request(sRequest) end if end if elseif upl2 is nothing then typForm = "upl_" if (isnull(upl.Form(sRequest)) or upl.Form(sRequest)="") then if vDefault = "-STRING-" then returnRequest = "" else returnRequest = vDefault end if else if isnumeric(upl.Form(sRequest)) AND (vDefault <> "-STRING-") then returnRequest = cdbl(upl.Form(sRequest)) else returnRequest = upl.Form(sRequest) end if end if else typForm = "upl2_" field = upl2.Fields(sRequest).value 'response.write "request("&sRequest&")= "&request.QueryString(sRequest) if (isnull(request.QueryString(sRequest)) or request.QueryString(sRequest)="") then if (isnull(field) or field="") then if vDefault = "-STRING-" then returnRequest = "" else returnRequest = vDefault end if else if isnumeric(field) AND (vDefault <> "-STRING-") then returnRequest = cdbl(field) else returnRequest = field end if end if else if isnumeric(request.QueryString(sRequest)) and (vDefault <> "-STRING-") then returnRequest = cdbl(request.QueryString(sRequest)) else returnRequest = request.QueryString(sRequest) end if end if end if 'response.write (typForm & sRequest & " : " & returnRequest & "
") end Function ' ----------------------------------------------------------------------------------- ' ----------------------------------------------------------------------------------- Public Function returnRequestStr(byval sRequest, byVal vDefault) ' Description : la valeur du request ou la valeur par default si request vide ' Paramètres : ' - sRequest : string, nom du champ ' - vDefault : variant, valeur par default ' ' Return : boolean, true or false (error or not) ' ----------------------------------------------------------------------------------- on error resume next dim typForm, result, field if upl is nothing and upl2 is nothing then typForm = "form_" if (isnull(request(sRequest)) or request(sRequest)="") then if vDefault = "-STRING-" then result = "" else result = vDefault end if else result = request(sRequest) end if elseif upl2 is nothing then typForm = "upl_" if (isnull(upl.Form(sRequest)) or upl.Form(sRequest)="") then if vDefault = "-STRING-" then result = "" else result = vDefault end if else result = upl.Form(sRequest) end if else typForm = "upl2_" field = upl2.Fields(sRequest).value

Erreur d'exécution Microsoft VBScript erreur '800a01f4'

Variable non définie: 'connectToCE'

/include/compteur_offres_cv.asp, ligne 27