JSON envoyé : {"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"Texte : "agri bio fondation est une société togolaise basée sur la production... +22893067348/22871241621". Réponds uniquement par 'oui' ou 'non'. Dis 'oui' si ce texte contient une donnée personnelle comme numéro de téléphone, email, adresse, nom complet, nom d'entreprise, même masqué ou déguisé. Sinon réponds 'non'. Ne donne aucune autre information."}],"max_tokens":10} Réponse brute API : {
"error": {
"message": "We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)",
"type": "invalid_request_error",
"param": null,
"code": null
}
}
Le texte ne contient pas de coordonnées personnelles.
Function ExtractResponseContent(json)
Dim startPos, endPos, contenu
startPos = InStr(json, """content"":""")
If startPos > 0 Then
startPos = startPos + Len("""content"":""")
endPos = InStr(startPos, json, """")
If endPos > startPos Then
contenu = Mid(json, startPos, endPos - startPos)
contenu = Replace(contenu, "\""", """")
ExtractResponseContent = contenu
Else
ExtractResponseContent = ""
End If
Else
ExtractResponseContent = ""
End If
End Function
Function ParametreExistantPlusieursFois(nomParametre)
Dim valeurs
Set valeurs = Request.QueryString(nomParametre)
If IsArray(valeurs) Then
If UBound(valeurs) > 0 Then
ParametreExistantPlusieursFois = True
Else
ParametreExistantPlusieursFois = False
End If
Else
ParametreExistantPlusieursFois = False
End If
End Function
Function HTMLDecode44(str)
' Accents français
str = Replace(str, "é", "é")
str = Replace(str, "É", "É")
str = Replace(str, "è", "è")
str = Replace(str, "È", "È")
str = Replace(str, "ê", "ê")
str = Replace(str, "Ê", "Ê")
str = Replace(str, "à", "à")
str = Replace(str, "À", "À")
str = Replace(str, "ç", "ç")
str = Replace(str, "Ç", "Ç")
' Autres accents
str = Replace(str, "ï", "ï")
str = Replace(str, "Ï", "Ï")
str = Replace(str, "ô", "ô")
str = Replace(str, "Ô", "Ô")
str = Replace(str, "ü", "ü")
str = Replace(str, "Ü", "Ü")
' Symboles spéciaux
str = Replace(str, "&", "&")
str = Replace(str, "'", "'")
str = Replace(str, "<", "<")
str = Replace(str, ">", ">")
str = Replace(str, " ", " ")
' Autres entités communes
str = Replace(str, "€", "€")
str = Replace(str, "£", "£")
str = Replace(str, "¥", "¥")
str = Replace(str, "©", "©")
str = Replace(str, "®", "®")
str = Replace(str, "™", "™")
str = Replace(str, "°", "°")
str = Replace(str, "±", "±")
' Conversion des entités numériques (xx;)
Set regex = New RegExp
regex.Pattern = "(\d+);"
regex.Global = True
Set matches = regex.Execute(str)
For Each match in matches
code = CInt(match.Submatches(0))
str = Replace(str, match.Value, ChrW(code))
Next
Set regex = Nothing
HTMLDecode44 = str
End Function
function estunmoteur()
estunmoteur = false
end function
Function FormaterRecherche(chaineRecherche)
if not IsEmpty(chaineRecherche) then
chaineRecherche = replace(chaineRecherche,"'"," ")
end if
' Mots de liaison français et anglais
motsLiaison = Array("et", "de", "la", "le", "les", "pour", "avec", "des", "du", "un", "une", "dans", "en","d","l", "par", "sur", _
"the", "and", "of", "to", "in", "on", "at", "by", "for", "a", "an", "with", "from", "as", "that", "which")
' Initialiser le résultat
resultat = ""
' Découper la chaîne en mots
mots = Split(chaineRecherche, " ")
' Parcourir chaque mot
For i = 0 To UBound(mots)
mot = Trim(LCase(mots(i)))
' Vérifier si le mot n'est pas dans la liste des mots de liaison
If Not IsInArray(mot, motsLiaison) Then
' Ajouter le mot formaté (+mot*)
If Len(mot) > 0 Then
resultat = resultat & "+" & mot & "* "
End If
End If
Next
' Retourner la chaîne formatée en supprimant l'espace finale
FormaterRecherche = Trim(resultat)
End Function
' Fonction utilitaire pour vérifier la présence d'un mot dans le tableau
Function IsInArray(val, arr)
IsInArray = False
For j = 0 To UBound(arr)
If arr(j) = val Then
IsInArray = True
Exit Function
End If
Next
End Function
Function GetReasons(lg)
' Créer un dictionnaire pour stocker les raisons
Set reasons = Server.CreateObject("Scripting.Dictionary")
' Ajouter des raisons à la collection avec une clé unique
reasons.Add 1, trsgoogle(lg,"Numéro de téléphone incorrect")
reasons.Add 2, trsgoogle(lg,"Email non valide")
reasons.Add 3, trsgoogle(lg,"Impossible à identifier ou contacter")
reasons.Add 4, trsgoogle(lg,"Inadapté")
reasons.Add 5, trsgoogle(lg,"Spammeur")
reasons.Add 6, trsgoogle(lg,"Autre")
' Retourner le dictionnaire
Set GetReasons = reasons
End Function
' Fonction 2 : Générer les options pour le à partir du dictionnaire
Function GetReasonOptions(lg)
Set reasons = GetReasons(lg) ' Appeler la fonction pour obtenir les raisons
optionsHtml = "Sélectionnez une option " ' Ajouter une option vide initiale
' Créer les options HTML pour chaque raison
For Each key In reasons.Keys
optionsHtml = optionsHtml & "" & reasons(key) & " "
Next
' Retourner le code HTML des options
GetReasonOptions = optionsHtml
End Function
function GetReasonText(reasonId)
Set reasons = GetReasons("fr") ' Appeler la fonction pour obtenir les raisons
' Vérifier si l'ID existe et retourner le texte associé
If reasons.Exists(reasonId) Then
GetReasonText = reasons(reasonId)
Else
GetReasonText = "Raison non trouvée pour l'ID " & reasonId
End If
End Function
Function ConnexionRecente(utilisateurID)
ConnexionRecente = False ' valeur par défaut
' Calculer la date limite : il y a 150 jours
cr_dateLimite = DateAdd("d", -150, Now())
' Convertir en format SQL (YYYY-MM-DD)
cr_dateSQL = Year(cr_dateLimite) & "-" & Right("0" & Month(cr_dateLimite), 2) & "-" & Right("0" & Day(cr_dateLimite), 2)
' Préparer la requête SQL
cr_sql = "SELECT `date` FROM connexion WHERE compte = " & utilisateurID & _
" AND `date` >= '" & cr_dateSQL & "' ORDER BY `date` DESC LIMIT 1"
' Debug facultatif
' Response.Write cr_sql
' Exécuter la requête
Set cr_rs = conn.Execute(cr_sql)
' Si on trouve une connexion récente, retourner True
If Not cr_rs.EOF Then
ConnexionRecente = True
End If
cr_rs.Close
Set cr_rs = Nothing
End Function
Function ConnexionDUJOUR(utilisateurID)
ConnexionDUJOUR = False ' valeur par défaut
' Calculer la date limite : il y a 150 jours
cr_dateLimite = DateAdd("d", -0, Now())
' Convertir en format SQL (YYYY-MM-DD)
cr_dateSQL = Year(cr_dateLimite) & "-" & Right("0" & Month(cr_dateLimite), 2) & "-" & Right("0" & Day(cr_dateLimite), 2)
' Préparer la requête SQL
cr_sql = "SELECT `date` FROM connexion WHERE compte = " & utilisateurID & _
" AND `date` >= '" & cr_dateSQL & "' ORDER BY `date` DESC LIMIT 1"
' Debug facultatif
' Response.Write cr_sql
' Exécuter la requête
Set cr_rs = conn.Execute(cr_sql)
' Si on trouve une connexion récente, retourner True
If Not cr_rs.EOF Then
ConnexionDUJOUR = True
End If
cr_rs.Close
Set cr_rs = Nothing
End Function
Function IsOlderThanTwoDays(inputDate)
' Convertir la date en un objet Date
iotd_dateValue = CDate(inputDate)
' Obtenir la date actuelle
iotd_currentDate = Now()
' Calculer la différence en jours
iotd_dateDifference = DateDiff("d", iotd_dateValue, iotd_currentDate)
' Vérifier si la différence est supérieure à 7 jours
If iotd_dateDifference > 7 Then
IsOlderThanTwoDays = True
Else
IsOlderThanTwoDays = False
End If
End Function
Function CompterEmailsSociete(lasoc22)
' Créer la connexion
' Préparer la requête
sql = "SELECT COUNT(*) AS Total FROM EMAILPREMIUMDECLASSE WHERE societe = "&lasoc22
' Exécuter la requête
Set rs3 = conn.Execute(sql)
' Récupérer le résultat
If Not rs3.EOF Then
count = cstr(rs("Total"))
Else
count = 0
End If
' Nettoyer
rs3.Close
Set rs3 = Nothing
' Retourner le compte
if count < 3 then
CompterEmailsSociete = true
Else
CompterEmailsSociete = false
end if
End Function
FUNCTION mail_EMAILPREMIUMDECLASSE(idsoc2)
dateSQL = Year(Date) & "-" & Right("0" & Month(Date), 2) & "-" & Right("0" & Day(Date), 2)
strSQL = "INSERT INTO EMAILPREMIUMDECLASSE (SOCIETE,DATE) VALUES ( " &idsoc2 &",'" & dateSQL&"')"
conn.execute(strSQL)
end function
Function IsRequestSafe()
' Vérifie que le Content-Type est safe
irs_sContentType = LCase(Request.ServerVariables("CONTENT_TYPE"))
If InStr(irs_sContentType, "multipart/form-data") > 0 Then
IsRequestSafe = False
Exit Function
End If
' Si tout est OK
IsRequestSafe = True
End Function
Function datedernierefacture(iddes)
if isnumeric(iddes) then
sql = "SELECT MAX(date) AS derniere_connexion from facture where societe = "&iddes
Set rs33 = conn.Execute(sql)
lastConnexion = rs33("derniere_connexion")
' Comparaison avec la date actuelle - 200 jours
If DateDiff("d", lastConnexion, Now) > 730 Then
datedernierefacture = -1
Else
datedernierefacture = 0
End If
rs33.Close
Set rs33 = Nothing
end if
end function
Function spammeur33(iddes)
If IsNumeric(iddes) Then
sql = "SELECT COUNT(DISTINCT destinataire) AS nbDest " & _
"FROM messagerie " & _
"WHERE spam = -1 " & _
"AND emeteur = " & iddes & " " & _
"AND date >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH)"
Set rs33 = conn.Execute(sql)
If Not rs33.EOF And cstr(rs33("nbDest")) >= 3 Then
'spammeur33 = -1
spammeur33 = 0
Else
spammeur33 = 0
End If
rs33.Close
Set rs33 = Nothing
End If
End Function
function filtre_spam()
p="SELECT emeteur, COUNT(*) AS nombre_messages FROM messagerie WHERE spam = -1 and concerne <> emeteur AND date >= DATE_SUB(NOW(), INTERVAL 1 MONTH) GROUP BY emeteur HAVING COUNT(DISTINCT concerne) >= 3"
Set rs34 = conn.Execute(p)
do until rs34.EOF
response.write SocieteName(rs34("emeteur"))&" - "&rs34("emeteur") &" - "&rs34("nombre_messages")&" "
rs34.movenext
loop
rs34.Close
Set rs34 = Nothing
end function
function estspammeur(son_id)
p="SELECT id FROM messagerie WHERE spam = -1 and emeteur="&son_id
Set rs345 = conn.Execute(p)
if not rs345.eof then
estspammeur = True
else
estspammeur = false
end if
rs345.Close
Set rs345 = Nothing
end function
Function ChercheMotCle(motCherche)
resultat2 = 0 ' Valeur par défaut : non trouvé
' Connexion à la base
' Préparer la requête pour une recherche exacte dans le champ motscles
' Par exemple si motscles = "voiture, moto, avion", on cherche "moto"
sql = "SELECT id FROM RECHERCHE_VIDE WHERE motscles = '"&motCherche&"'"
Set rtg = conn.Execute(sql)
If Not rtg.EOF Then
resultat2 = -1 ' Trouvé
End If
rtg.Close
Set rtg = Nothing
ChercheMotCle = resultat2
End Function
Function VerifierDelai(dateStr)
On Error Resume Next ' pour éviter les erreurs si la date est mal formée
vd_referenceDate = CDate(Replace(dateStr, "/", "-"))
vd_currentDate = Now()
vd_diffDays = DateDiff("d", vd_referenceDate, vd_currentDate)
If Err.Number <> 0 Then
'VerifierDelai = "Erreur: date invalide"
Exit Function
End If
If vd_diffDays > 5 Then
VerifierDelai = -1
Else
VerifierDelai = 0
End If
End Function
Function MotRepeteDeuxFois(texte)
Set mrdf_regex = New RegExp
mrdf_regex.Global = True
mrdf_regex.IgnoreCase = True
mrdf_regex.Pattern = "\b[a-zA-Z]{4,}\b" ' Mot de plus de 3 lettres (donc 4 et plus)
Set mrdf_matches = mrdf_regex.Execute(texte)
Set mrdf_dico = Server.CreateObject("Scripting.Dictionary")
For mrdf_i = 0 To mrdf_matches.Count - 1
mrdf_mot = LCase(mrdf_matches(mrdf_i).Value)
If mrdf_dico.Exists(mrdf_mot) Then
mrdf_dico(mrdf_mot) = mrdf_dico(mrdf_mot) + 1
Else
mrdf_dico.Add mrdf_mot, 1
End If
Next
' Vérifie si un mot apparaît au moins deux fois
For Each mrdf_mot In mrdf_dico.Keys
If mrdf_dico(mrdf_mot) >= 2 Then
MotRepeteDeuxFois = -1
Exit Function
End If
Next
MotRepeteDeuxFois = 0
End Function
Function VerifieMotNormal(str)
' Normalise les caractères accentués en supprimant les accents
str = NormaliserAccents(str)
' On parcourt la chaîne de caractères de 1 à longueur-2 (pour comparer trois caractères)
For vmn_i = 1 To Len(str) - 2
vmn_char1 = Mid(str, vmn_i, 1) ' Caractère courant
vmn_char2 = Mid(str, vmn_i + 1, 1) ' Caractère suivant
vmn_char3 = Mid(str, vmn_i + 2, 1) ' Caractère après le suivant
' Vérifie si les trois caractères sont égaux et ne font pas partie des exceptions
If vmn_char1 = vmn_char2 And vmn_char2 = vmn_char3 Then
' Si les trois caractères sont identiques et ne sont pas des exceptions
If Not IsCaractereException(vmn_char1) Then
VerifieMotNormal = -1
Exit Function
End If
End If
Next
' Si aucune répétition de trois caractères identiques n'a été trouvée, retourne 0 (mot normal)
VerifieMotNormal = 0
End Function
' Fonction pour normaliser les accents dans la chaîne
Function NormaliserAccents(str)
str = Replace(str, "é", "e")
str = Replace(str, "è", "e")
str = Replace(str, "ê", "e")
str = Replace(str, "ë", "e")
str = Replace(str, "à", "a")
str = Replace(str, "â", "a")
str = Replace(str, "ä", "a")
str = Replace(str, "î", "i")
str = Replace(str, "ï", "i")
str = Replace(str, "ô", "o")
str = Replace(str, "ö", "o")
str = Replace(str, "ù", "u")
str = Replace(str, "û", "u")
str = Replace(str, "ü", "u")
str = Replace(str, "ÿ", "y")
NormaliserAccents = str
End Function
' Fonction pour vérifier si un caractère est dans les exceptions
Function IsCaractereException(char)
exceptions = "aeiouyèéêàâôïùûîœlsnmtfr" ' Les caractères à ignorer (les lettres qui peuvent se répéter deux fois)
' Vérifie si le caractère est dans les exceptions (voyelles, consonnes et caractères accentués courants)
If InStr(exceptions, LCase(char)) > 0 Then
IsCaractereException = True
Else
IsCaractereException = False
End If
End Function
Function ContainsSpecialCharacters(str)
Set regex = New RegExp
' Expression régulière pour rechercher des caractères non alphanumériques
regex.IgnoreCase = True
regex.Global = True
regex.Pattern = "[^a-zA-Z0-9\s]" ' Tous les caractères qui ne sont pas des lettres, chiffres ou espaces
' Si un ou plusieurs caractères spéciaux sont trouvés
If regex.Test(str) Then
ContainsSpecialCharacters = -1
Else
ContainsSpecialCharacters = 0
End If
End Function
Function RemoveLeadingSpace(str)
If Len(str) > 0 And Mid(str, 1, 1) = " " Then
RemoveLeadingSpace = Mid(str, 2)
Else
RemoveLeadingSpace = str
End If
End Function
Function ContainsShortWords(str)
Set regex = New RegExp
' Expression régulière pour rechercher les mots de 1 ou 2 caractères
regex.IgnoreCase = True
regex.Global = True
regex.Pattern = "\b\w{1,2}\b" ' \b = délimiteurs de mot, \w{1,2} = mots de 1 ou 2 caractères
' Appliquer l'expression régulière à la chaîne
Set matches = regex.Execute(str)
' Vérifier si la chaîne contient entre 1 et 5 mots de 1 ou 2 caractères
If matches.Count >= 1 And matches.Count <= 2 Then
ContainsShortWords = -1
Else
ContainsShortWords = 0
End If
End Function
Function ChercherTermes(strDocument, strRequete)
' Vérification des types pour éviter les erreurs de type
If TypeName(strDocument) <> "String" Or TypeName(strRequete) <> "String" Then
Exit Function
End If
' Appliquer le retrait des accents sur les deux chaînes
strDocument = SupprimerAccents(strDocument)
strRequete = SupprimerAccents(strRequete)
' Vérification que la chaîne de recherche est non vide
If Len(Trim(strRequete)) = 0 Then
ChercherTermes = 0 ' Si la chaîne de recherche est vide, retourner 0
Exit Function
End If
' Liste des mots ignorés
ListeMotsIgnorables = Array("de", "du", "à", "pour", "le", "la", "les", "et", "des", "en", "avec", "dans", "sur", "par", "au", "aux")
' Séparation de la chaîne de recherche en mots
TableauTermes = Split(strRequete, " ") ' Diviser la chaîne de recherche en mots
' Vérification de la présence de chaque mot dans le texte
TousTrouves = True
For i = 0 To UBound(TableauTermes) ' Parcours chaque mot du tableau
terme = Trim(TableauTermes(i))
' Si le mot n'est pas dans la liste des mots ignorés et est valide
If Not EstDansListe(terme, ListeMotsIgnorables) And Len(terme) > 0 Then
' Vérifier si le mot est présent dans le texte en utilisant des délimiteurs pour éviter la recherche dans des sous-chaînes
If Not IsMotEntierPresent(strDocument, terme) Then
TousTrouves = False
Exit For
End If
End If
Next
' Retourne -1 si tous les mots sont trouvés, sinon retourne 0
If TousTrouves Then
ChercherTermes = -1
Else
ChercherTermes = 0
End If
End Function
' Fonction pour vérifier si un mot est délimité dans le texte (évite de matcher une sous-chaîne dans un mot)
Function IsMotEntierPresent(strTexte, strMot)
' Recherche le mot entier avec des délimiteurs comme des espaces ou des signes de ponctuation
If InStr(" " & strTexte & " ", " " & strMot & " ") > 0 Then
IsMotEntierPresent = True
Else
IsMotEntierPresent = False
End If
End Function
' Fonction pour vérifier si un mot est dans la liste des mots ignorés
Function EstDansListe(val, tableau)
EstDansListe = False
For j = 0 To UBound(tableau)
If tableau(j) = val Then
EstDansListe = True
Exit Function
End If
Next
End Function
Function SupprimerAccents(str)
accents = "àáâãäåèéêëìíîïòóôõöøùúûüçÀÁÂÃÄÅÈÉÊËÌÍÎÏÒÓÔÕÖØÙÚÛÜÇ" & Chr(39) & Chr(34) ' Ajout de ' et "
sansAccents = "aaaaaeeeeiiiiooooouuucAAAAAEEEEIIIIOOOOOUUUC" & "" & "" ' Remplace ' et " par rien (ou tu peux mettre un autre caractère)
For i = 1 To Len(accents)
' Remplacer chaque caractère accentué ou spécial (apostrophes, guillemets) par son équivalent sans accent ou caractère voulu
str = Replace(str, Mid(accents, i, 1), Mid(sansAccents, i, 1))
Next
SupprimerAccents = str
End Function
' Fonction pour retourner une valeur numérique aléatoire parmi les paramètres envoyés
Function GetRandomValue(ParamList)
' Vérifier si la liste des paramètres est vide
If UBound(ParamList) >= 0 Then
' Générer un index aléatoire dans la plage des indices des paramètres
Randomize
'response.write Rnd&"-"
RandomIndex = Int((UBound(ParamList) + 1) * Rnd)
' Sélectionner la valeur numérique correspondant à cet index
RandomValue = ParamList(RandomIndex)
Else
RandomValue = "Aucun paramètre fourni"
End If
' Retourner la valeur numérique sélectionnée
GetRandomValue = RandomValue
End Function
Function cacluniteday()
p="select sum(nbunite) as nbunit from conso_unite where TO_DAYS(date) > TO_DAYS(NOW())-2"
set kk=conn.execute(p)
cacluniteday = kk("nbunit")
kk.close
set kk = nothing
End Function
Function ValiderEmail(email)
Set regex = New RegExp
' Définir le motif de l'email
regex.IgnoreCase = True
regex.Global = True
regex.Pattern = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"
' Appliquer la regex sur l'email
resultat = regex.Test(email)
' Retourner le résultat de la validation
ValiderEmail = resultat
End Function
Function DetectInformation(strText, lemeteur)
' Création de l'objet RegExp
Set objRegExp = New RegExp
objRegExp.IgnoreCase = True
objRegExp.Global = True
' Détection des emails
emailPattern = "[a-zA-Z0-9._%+-]+@(gmail\.com|yahoo\.com|hotmail\.com|outlook\.com|[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})"
objRegExp.Pattern = emailPattern
Set emailMatch = objRegExp.Execute(strText)
' Détection des numéros de téléphone
phonePattern = "\b\d{8,}\b"
objRegExp.Pattern = phonePattern
Set phoneMatch = objRegExp.Execute(strText)
' Détection des noms de sociétés
companyPattern = "\b[A-Z][a-z]+(?: [A-Z][a-z]+)?\b"
objRegExp.Pattern = companyPattern
Set companyMatch = objRegExp.Execute(strText)
' Détection de nombres en lettres ou chiffres
numberPattern = "\b(?:quarante|quarante[- ]deux|cinq|dix[- ]huit|[0-9]+)\b"
objRegExp.Pattern = numberPattern
Set numberMatch = objRegExp.Execute(strText)
' Détection de lettres suivies de chiffres
letterNumberPattern = "\b[a-zA-Z]{3,}[0-9]+\b"
objRegExp.Pattern = letterNumberPattern
Set letterNumberMatch = objRegExp.Execute(strText)
' Présence du caractère "@"
atSymbolMatch = InStr(strText, "@") > 0
' Détection des mots spécifiques
objRegExp.Pattern = "\bgmail\b"
Set gmailMatch = objRegExp.Execute(strText)
objRegExp.Pattern = "\byahoo\b"
Set yahooMatch = objRegExp.Execute(strText)
objRegExp.Pattern = "\blinkdin\b"
Set linkdlMatch = objRegExp.Execute(strText)
objRegExp.Pattern = "\bpoint\b"
Set pointMatch = objRegExp.Execute(strText)
objRegExp.Pattern = "\baroba\b"
Set arobaMatch = objRegExp.Execute(strText)
' Détection de répétitions numériques
objRegExp.Pattern = "(\b\d{2}\b).*?\1.*?\1.*?\1"
Set repeatedNumberMatch = objRegExp.Execute(strText)
' Détection de "tel" et "société"
objRegExp.Pattern = "\btel\b"
Set jeSuisMatch = objRegExp.Execute(strText)
objRegExp.Pattern = "\bsoci(?:été|e)\b"
Set societeMatch = objRegExp.Execute(strText)
' Initialisation du score de suspicion
suspicion = 0
If emailMatch.Count > 0 Then suspicion = suspicion + 25
If phoneMatch.Count > 0 Then suspicion = suspicion + 20
If letterNumberMatch.Count > 0 Then suspicion = suspicion + 10
If atSymbolMatch Then suspicion = suspicion + 10
If gmailMatch.Count > 0 Then suspicion = suspicion + 10
If yahooMatch.Count > 0 Then suspicion = suspicion + 10
If linkdlMatch.Count > 0 Then suspicion = suspicion + 10
If repeatedNumberMatch.Count > 0 Then suspicion = suspicion + 10
If jeSuisMatch.Count > 0 Then suspicion = suspicion + 10
If pointMatch.Count > 0 Then suspicion = suspicion + 10
If arobaMatch.Count > 0 Then suspicion = suspicion + 10
' Vérification de correspondance partielle avec "lemeteur"
foundMatchFromLemeteur = False
words = Split(societeinterlocuteur(lemeteur), " ")
For i = 0 To UBound(words)
word = Trim(words(i))
If Len(word) >= 3 Then ' Ignore les petits mots
If InStr(LCase(strText), LCase(word)) > 0 Then
foundMatchFromLemeteur = True
Exit For
End If
End If
Next
foundMatchFromsocietename = False
words = Split(SocieteName(lemeteur), " ")
For i = 0 To UBound(words)
word = Trim(words(i))
If Len(word) >= 4 Then ' Ignore les petits mots
If InStr(LCase(strText), LCase(word)) > 0 Then
foundMatchFromsocietename = True
Exit For
End If
End If
Next
If foundMatchFromLemeteur Then
suspicion = suspicion + 10
End If
If foundMatchFromsocietename Then
suspicion = suspicion + 10
End If
' Construction du résultat
If suspicion > 0 Then
result = "Suspicion détectée! " & _
"Emails: " & emailMatch.Count & ", " & _
"gmail: " & gmailMatch.Count & ", " & _
"Téléphones: " & phoneMatch.Count & ", " & _
"Chiffres accrochés aux lettres: " & letterNumberMatch.Count & ". " & _
"Paires de chiffres répétées: " & repeatedNumberMatch.Count & ". " & _
"Expressions 'tel' trouvées: " & jeSuisMatch.Count & ". " & _
"Expressions 'société' trouvées: " & societeMatch.Count & ". " & _
"Mots de l'émetteur retrouvés: " & CStr(foundMatchFromLemeteur) & ". " & _
"Mots de societe retrouvés: " & CStr(foundMatchFromsocietename) & ". " & _
"Pourcentage de suspicion: " & suspicion & "%"
End If
DetectInformation = result
End Function
Function DetectInformationObjet(strText, lemeteur)
' Création de l'objet RegExp
Set objRegExp = New RegExp
objRegExp.IgnoreCase = True
objRegExp.Global = True
' Détection des emails
emailPattern = "[a-zA-Z0-9._%+-]+@(gmail\.com|yahoo\.com|hotmail\.com|outlook\.com|[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})"
objRegExp.Pattern = emailPattern
Set emailMatch = objRegExp.Execute(strText)
' Détection des noms de sociétés
companyPattern = "\b[A-Z][a-z]+(?: [A-Z][a-z]+)?\b"
objRegExp.Pattern = companyPattern
Set companyMatch = objRegExp.Execute(strText)
' Détection de nombres en lettres ou chiffres
numberPattern = "\b(?:quarante|quarante[- ]deux|cinq|dix[- ]huit|[0-9]+)\b"
objRegExp.Pattern = numberPattern
Set numberMatch = objRegExp.Execute(strText)
' Présence du caractère "@"
atSymbolMatch = InStr(strText, "@") > 0
' Détection des mots spécifiques
objRegExp.Pattern = "\bgmail\b"
Set gmailMatch = objRegExp.Execute(strText)
objRegExp.Pattern = "\byahoo\b"
Set yahooMatch = objRegExp.Execute(strText)
objRegExp.Pattern = "\blinkdin\b"
Set linkdlMatch = objRegExp.Execute(strText)
objRegExp.Pattern = "\bpoint\b"
Set pointMatch = objRegExp.Execute(strText)
objRegExp.Pattern = "\baroba\b"
Set arobaMatch = objRegExp.Execute(strText)
' Détection de répétitions numériques
objRegExp.Pattern = "(\b\d{2}\b).*?\1.*?\1.*?\1"
Set repeatedNumberMatch = objRegExp.Execute(strText)
' Détection de "tel" et "société"
objRegExp.Pattern = "\btel\b"
Set jeSuisMatch = objRegExp.Execute(strText)
objRegExp.Pattern = "\bsoci(?:été|e)\b"
Set societeMatch = objRegExp.Execute(strText)
' Initialisation du score de suspicion
suspicion = 0
If emailMatch.Count > 0 Then suspicion = suspicion + 25
If atSymbolMatch Then suspicion = suspicion + 10
If gmailMatch.Count > 0 Then suspicion = suspicion + 10
If yahooMatch.Count > 0 Then suspicion = suspicion + 10
If linkdlMatch.Count > 0 Then suspicion = suspicion + 10
If repeatedNumberMatch.Count > 0 Then suspicion = suspicion + 10
If jeSuisMatch.Count > 0 Then suspicion = suspicion + 10
If pointMatch.Count > 0 Then suspicion = suspicion + 10
If arobaMatch.Count > 0 Then suspicion = suspicion + 10
' Vérification de correspondance partielle avec "lemeteur"
foundMatchFromLemeteur = False
words = Split(societeinterlocuteur(lemeteur), " ")
For i = 0 To UBound(words)
word = Trim(words(i))
If Len(word) >= 3 Then ' Ignore les petits mots
If InStr(LCase(strText), LCase(word)) > 0 Then
foundMatchFromLemeteur = True
Exit For
End If
End If
Next
foundMatchFromsocietename = False
words = Split(SocieteName(lemeteur), " ")
For i = 0 To UBound(words)
word = Trim(words(i))
If Len(word) >= 4 Then ' Ignore les petits mots
If InStr(LCase(strText), LCase(word)) > 0 Then
foundMatchFromsocietename = True
Exit For
End If
End If
Next
If foundMatchFromLemeteur Then
suspicion = suspicion + 10
End If
If foundMatchFromsocietename Then
suspicion = suspicion + 10
End If
' Construction du résultat
If suspicion > 0 Then
result = "Suspicion détectée! " & _
"Emails: " & emailMatch.Count & ", " & _
"gmail: " & gmailMatch.Count & ", " & _
"Paires de chiffres répétées: " & repeatedNumberMatch.Count & ". " & _
"Expressions 'tel' trouvées: " & jeSuisMatch.Count & ". " & _
"Expressions 'société' trouvées: " & societeMatch.Count & ". " & _
"Mots de l'émetteur retrouvés: " & CStr(foundMatchFromLemeteur) & ". " & _
"Mots de societe retrouvés: " & CStr(foundMatchFromsocietename) & ". " & _
"Pourcentage de suspicion: " & suspicion & "%"
End If
DetectInformationObjet = result
End Function
Function RemoveAccents(str)
accents = Array("à", "á", "â", "ä", "ã", "å", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ò", "ó", "ô", "ö", "õ", "ø", "ù", "ú", "û", "ü", "ý", "ÿ", "À", "Á", "Â", "Ä", "Ã", "Å", "Ç", "È", "É", "Ê", "Ë", "Ì", "Í", "Î", "Ï", "Ò", "Ó", "Ô", "Ö", "Õ", "Ø", "Ù", "Ú", "Û", "Ü", "Ý")
withoutAccents = Array("a", "a", "a", "a", "a", "a", "c", "e", "e", "e", "e", "i", "i", "i", "i", "d", "o", "o", "o", "o", "o", "o", "u", "u", "u", "u", "y", "y", "A", "A", "A", "A", "A", "A", "C", "E", "E", "E", "E", "I", "I", "I", "I", "O", "O", "O", "O", "O", "O", "U", "U", "U", "U", "Y")
For i = 0 To UBound(accents)
str = Replace(str, accents(i), withoutAccents(i))
Next
RemoveAccents = str
End Function
' Définir les chiffres dans un tableau
sessionsucre = Array(572041, 223850, 461273, 567929, 570848, 503601, 570055, _
382455, 430150, 324550, 576669, 540535, 228535, 573260, _
461751, 240221, 580240, 495653,557666)
' Fonction pour vérifier si la valeur est dans le tableau
Function CheckIfValueExists(arr, value)
For i = 0 To UBound(arr)
If arr(i) = value Then
CheckIfValueExists = True
Exit Function
End If
Next
CheckIfValueExists = False
End Function
function Verifi404()
' Récupérer l'URL actuelle de la page
currentURL = Request.ServerVariables("HTTP_X_ORIGINAL_URL")
'set mmp = conn.execute("select id from RECHERCHE_VIDE where motscles = '"¤tURL&"'")
' if not mmp.eof Then
' Verifi404 = true
' else
Verifi404 = false
' end if
'mmp.close
'set mmp = nothing
end function
function Verifi404avecURL(LAcurrentURL)
set mmp = conn.execute("select id from RECHERCHE_VIDE where motscles = '"&LAcurrentURL&"'")
if not mmp.eof Then
Verifi404avecURL = true
else
Verifi404avecURL = false
end if
mmp.close
set mmp = nothing
end function
Function ajtficheproplus(idsoc)
mavar52 = "insert into optionofferte (typeoption,societe) values ('FICHEPROPLUS',"&idsoc&")"
'response.write mavar52
conn.execute(mavar52)
End Function
Function RechercherMotDansVariable(strVariable, strMot)
' Vérifier si la variable n'est pas vide
If Len(Trim(strVariable)) > 0 Then
' Utiliser la fonction InStr pour rechercher le mot dans la variable
If InStr(1, strVariable, strMot, vbTextCompare) > 0 Then
RechercherMotDansVariable = True ' Le mot a été trouvé
Else
RechercherMotDansVariable = False ' Le mot n'a pas été trouvé
End If
Else
RechercherMotDansVariable = False ' La variable est vide
End If
End Function
Function EnleverEmojisCommentairenew(texte)
Dim regEx
Set regEx = New RegExp
If texte <> "" Then
regEx.IgnoreCase = True
regEx.Global = True
' Supprimer les emojis codés sur deux caractères (UTF-16 surrogate pairs)
' Ce sont les emojis utilisés depuis smartphones
regEx.Pattern = "[\uD83C-\uDBFF][\uDC00-\uDFFF]"
texte = regEx.Replace(texte, "")
' Supprimer les caractères de variation emoji (ex: ❤️ vs ♥)
Set regEx = New RegExp
regEx.IgnoreCase = True
regEx.Global = True
regEx.Pattern = "[\u200D\uFE0F]" ' ZWJ et Variation Selector
texte = regEx.Replace(texte, "")
End If
EnleverEmojisCommentairenew = texte
End Function
Function EnleverEmojiscommentaire(texte)
Set regEx = New RegExp
If texte <> "" Then
regEx.IgnoreCase = True
regEx.Global = True
' Expression régulière pour capturer les emojis et symboles non-texte, sans affecter les sauts de ligne ni le "œ"
regEx.Pattern = "[^\x20-\x7E\xA0-\xFF\n\r\u0153]"
' Remplacer tous les caractères non-texte (comme les emojis) par un espace, sauf "œ"
EnleverEmojiscommentaire = regEx.Replace(texte, " ")
End If
End Function
Function EnleverEmojis(texte)
Set regEx = New RegExp
if texte <> "" then
regEx.IgnoreCase = True
regEx.Global = True
' Expression régulière pour capturer les emojis et symboles non-texte
regEx.Pattern = "[^\x20-\x7E\xA0-\xFF]"
' Remplacer tous les caractères non-texte (comme les emojis) par une chaîne vide
EnleverEmojis = regEx.Replace(texte, " ")
end if
End Function
Function DecodeHTML(strHTML)
' Créer une instance de l'objet RegExp
Set regEx = New RegExp
regEx.IgnoreCase = True
regEx.Global = True
regEx.Pattern = "(\d+);"
' Trouver toutes les correspondances pour les entités HTML
Set matches = regEx.Execute(strHTML)
' Copier le texte original
decodedStr = strHTML
' Remplacer chaque entité HTML par son caractère correspondant
For i = 0 To matches.Count - 1
entityCode = matches(i).SubMatches(0)
' Remplacer l'entité HTML par le caractère correspondant
decodedStr = Replace(decodedStr, matches(i).Value, ChrW(CInt(entityCode)))
Next
' Libérer l'objet RegExp
Set regEx = Nothing
DecodeHTML = decodedStr
End Function
function envoibrevonew(destinataire_email, objet_message, sujet_corps, corps, titrelien, lien)
Dim http: Set http = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
Dim url: url = "https://api.brevo.com/v3/smtp/email"
'Dim data: data = {{"email", "support@espaceagro.com"}, {"name", "ESPACEAGRO"}}
With http
Call .Open("POST", url, False)
Call .SetRequestHeader("content-type", "application/json")
Call .SetRequestHeader("api-key", "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")
Call .SetRequestHeader("accept","application/json")
objet_message = laver2(objet_message)
ttt = "{"&chr(34)&"sender"&chr(34)&":{"&chr(34)&"name"&chr(34)&":"&chr(34)&"EspaceAgro"&chr(34)&","&chr(34)&"email"&chr(34)&":"&chr(34)&"support@espaceagro.com"&chr(34)&"}"
ttt = ttt&","&chr(34)&"to"&chr(34)&":[ { "&chr(34)&"email"&chr(34)&":"&chr(34)&destinataire_email&chr(34)&","&chr(34)&"name"&chr(34)&":"&chr(34)&"EspaceAgro"&chr(34)&"}]"
ttt = ttt&","&chr(34)&"subject"&chr(34)&":"&chr(34)&objet_message&chr(34)&","&chr(34)&"templateId"&chr(34)&":65,"
ttt = ttt&""&chr(34)&"params"&chr(34)&":{"&chr(34)&"objet"&chr(34)&":"&chr(34)&sujet_corps&chr(34)
ttt = ttt&","&chr(34)&"corps"&chr(34)&":"&chr(34)&corps&chr(34)&","
ttt = ttt&chr(34)&"url"&chr(34)&":"&chr(34)&lien&chr(34)&","
ttt = ttt&""&chr(34)&"titrebouton"&chr(34)&":"&chr(34)&titrelien&chr(34)&"}}"
'response.write ttt
Call.Send(ttt)
End With
'If Left(http.Status, 1) = 2 Then
'Else
' Call Response.Write("Server returned: " & http.Status & " " & http.StatusText )
'End If
set http = nothing
end function
Function EncodeHTML(inputString)
' Remplacer les caractères spéciaux par leurs entités HTML
inputString = Replace(inputString, "&", "&")
inputString = Replace(inputString, "<", "<")
inputString = Replace(inputString, ">", ">")
inputString = Replace(inputString, """", """)
inputString = Replace(inputString, "'", "'")
inputString = Replace(inputString, Chr(10), " ") ' Remplacer les retours à la ligne par
inputString = Replace(inputString, Chr(13), "") ' Supprimer les caractères de retour chariot
' Retourner la chaîne encodée
EncodeHTML = inputString
End Function
function envoibrevonewatt(destinataire_email, objet_message, sujet_corps, corps, titrelien, lien)
'corps=replace(corps,".","")
'corps=mid(corps,1,235)
Dim http: Set http = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
Dim url: url = "https://api.brevo.com/v3/smtp/email"
'Dim data: data = {{"email", "support@espaceagro.com"}, {"name", "ESPACEAGRO"}}
With http
Call .Open("POST", url, False)
Call .SetRequestHeader("content-type", "application/json")
Call .SetRequestHeader("api-key", "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")
Call .SetRequestHeader("accept","application/json")
objet_message = laver2(objet_message)
ttt = "{"&chr(34)&"sender"&chr(34)&":{"&chr(34)&"name"&chr(34)&":"&chr(34)&"EspaceAgro"&chr(34)&","&chr(34)&"email"&chr(34)&":"&chr(34)&"support@espaceagro.com"&chr(34)&"}"
ttt = ttt&","&chr(34)&"to"&chr(34)&":[ { "&chr(34)&"email"&chr(34)&":"&chr(34)&destinataire_email&chr(34)&","&chr(34)&"name"&chr(34)&":"&chr(34)&"EspaceAgro"&chr(34)&"}]"
ttt = ttt&","&chr(34)&"subject"&chr(34)&":"&chr(34)&objet_message&chr(34)&","&chr(34)&"templateId"&chr(34)&":65,"
ttt = ttt&""&chr(34)&"params"&chr(34)&":{"&chr(34)&"objet"&chr(34)&":"&chr(34)&sujet_corps&chr(34)
ttt = ttt&","&chr(34)&"corps"&chr(34)&":"&chr(34)&EncodeHTML(corps)&chr(34)&","
ttt = ttt&chr(34)&"url"&chr(34)&":"&chr(34)&lien&chr(34)&","
ttt = ttt&""&chr(34)&"titrebouton"&chr(34)&":"&chr(34)&titrelien&chr(34)&"}}"
Call.Send(ttt)
End With
If Left(http.Status, 1) = 2 Then
Else
Call Response.Write("Server returned: " & http.Status & " " & http.StatusText)
End If
set http = nothing
end function
'baseurlsiteweb = "d:\www\espaceagro.com\website"
baseurlsiteweb = "D:\www\espaceagro.com\website"
Function nblignefic(lechemin)
Fichier_S = lechemin
Pour_Lire = 1
Set oFSO = CreateObject("Scripting.FileSystemObject")
' Vérification si le fichier existe avant d'essayer de l'ouvrir
If Not oFSO.FileExists(Fichier_S) Then
'MsgBox "Le fichier n'existe pas ou le chemin est incorrect."
Exit Function
End If
Set Fichier = oFSO.OpenTextFile(Fichier_S, Pour_Lire)
Nbr = 0
Do While Fichier.AtEndOfStream <> True
Fichier.ReadLine
nblignefic = nblignefic + 1
Loop
Fichier.Close
End Function
function annonceexistedeja(soocid1,id1,letitre1)
letitre2=((letitre1))
letitre2 = replace(letitre2,"'","\'")
'letitre2 = mid(letitre2,1,len(letitre2)-2)
'response.write letitre2
ppl="select id from affaire where societe="&soocid1&" and id <> "&id1&" and titre='"&letitre2&"' and afficher = -1"
' response.write ppl
set kj = conn.execute(ppl)
if not kj.eof then
annonceexistedeja = kj("id")
end if
kj.close
set kj=nothing
end function
function decrementer_fic_affaire()
chemin = "d:\www\espaceagro.com\website\trv\ANNONCEENVOI.csv"
chemintemp = "d:\www\espaceagro.com\website\trv\ANNONCEENVOItemp.csv"
Set objFileSystem = server.CreateObject("Scripting.FileSystemObject")
' Vérifier si le fichier ANNONCEENVOI.csv existe
If objFileSystem.FileExists(chemin) Then
Set objFichierSortie = objFileSystem.CreateTextFile(chemintemp)
Set objFichierEntree = objFileSystem.OpenTextFile(chemin)
' Lecture de la première ligne d'entete.
If Not objFichierEntree.AtEndOfStream Then
Ligne2 = objFichierEntree.ReadLine
Do While Not objFichierEntree.AtEndOfStream
Ligne = objFichierEntree.ReadLine
objFichierSortie.WriteLine(Ligne)
Loop
objFichierSortie.Close
objFichierEntree.Close
objFileSystem.DeleteFile chemin
objFileSystem.CopyFile chemintemp, chemin
objFileSystem.DeleteFile chemintemp
' Ouvrir à nouveau le fichier pour le lire
Set objFichiervoir = objFileSystem.OpenTextFile(chemin)
Do While Not objFichiervoir.AtEndOfStream
Ligne = objFichiervoir.ReadLine
'response.write Ligne & " "
Loop
objFichiervoir.Close
decrementer_fic_affaire = Ligne2
End If
Else
' Si le fichier n'existe pas, afficher un message d'erreur
decrementer_fic_affaire = "Erreur : Le fichier ANNONCEENVOI.csv n'existe pas."
End If
end function
function decrementer_fic_affairenew()
chemin = "d:\www\espaceagro.com\website\trv\ANNONCEENVOI2.csv"
Dim lignes(25) ' Tableau pour stocker les 25 lignes lues
Dim compteurLignes ' Compteur pour suivre combien de lignes ont été lues
lignesModifiees = "" ' Variable pour contenir le contenu modifié du fichier
Set objFileSystem = server.CreateObject("Scripting.FileSystemObject")
' Vérifier si le fichier ANNONCEENVOI.csv existe
If objFileSystem.FileExists(chemin) Then
' Ouvrir le fichier en mode lecture
Set objFichier = objFileSystem.OpenTextFile(chemin, 1) ' Mode lecture
' Initialiser le compteur
compteurLignes = 0
' Lire le fichier ligne par ligne et récupérer les 25 lignes qui ne commencent pas par un *
Do While Not objFichier.AtEndOfStream And compteurLignes < 25
Ligne = objFichier.ReadLine
' Si la ligne ne commence pas par un *, on la récupère
If Left(Ligne, 1) <> "*" Then
' Stocker la ligne dans le tableau
lignes(compteurLignes) = Ligne
' Ajouter un * au début de la ligne
LigneModifiee = "*" & Ligne
' Ajouter cette ligne modifiée à la chaîne de texte lignesModifiees
lignesModifiees = lignesModifiees & LigneModifiee & vbCrLf
compteurLignes = compteurLignes + 1
End If
Loop
objFichier.Close
' Ouvrir le fichier en mode écriture pour remplacer son contenu avec les lignes modifiées
Set objFichier = objFileSystem.OpenTextFile(chemin, 2, True) ' Mode écriture (True pour écraser le fichier)
' Réécrire le contenu du fichier avec les lignes modifiées
objFichier.Write lignesModifiees
' Ouvrir à nouveau le fichier en mode lecture pour y réécrire les lignes restantes
Set objFichier = objFileSystem.OpenTextFile(chemin, 1) ' Mode lecture
' Réécrire les lignes restantes qui n'ont pas été modifiées (si besoin)
Do While Not objFichier.AtEndOfStream
Ligne = objFichier.ReadLine
objFichier.WriteLine Ligne
Loop
objFichier.Close
' Retourner le tableau avec les 25 lignes lues (sans le *)
decrementer_fic_affairenew = lignes
Else
' Si le fichier n'existe pas, afficher un message d'erreur
decrementer_fic_affairenew = "Erreur : Le fichier ANNONCEENVOI.csv n'existe pas."
End If
end function
function decrementer_fic_recap()
chemin = "d:\www\espaceagro.com\website\trv\RECAPENVOI.csv"
chemintemp = "d:\www\espaceagro.com\website\trv\RECAPENVOItemp.csv"
Set objFileSystem = server.CreateObject("Scripting.FileSystemObject")
' Vérifier si le fichier RECAPENVOI.csv existe
If objFileSystem.FileExists(chemin) Then
Set objFichierSortie = objFileSystem.CreateTextFile(chemintemp)
Set objFichierEntree = objFileSystem.OpenTextFile(chemin)
' Lecture de la première ligne d'entete.
If Not objFichierEntree.AtEndOfStream Then
Ligne2 = objFichierEntree.ReadLine
Do While Not objFichierEntree.AtEndOfStream
Ligne = objFichierEntree.ReadLine
objFichierSortie.WriteLine(Ligne)
Loop
objFichierSortie.Close
objFichierEntree.Close
objFileSystem.DeleteFile chemin
objFileSystem.CopyFile chemintemp, chemin
objFileSystem.DeleteFile chemintemp
' Ouvrir à nouveau le fichier pour le lire
Set objFichiervoir = objFileSystem.OpenTextFile(chemin)
Do While Not objFichiervoir.AtEndOfStream
Ligne = objFichiervoir.ReadLine
'response.write Ligne & " "
Loop
objFichiervoir.Close
decrementer_fic_recap = Ligne2
End If
Else
' Si le fichier n'existe pas, afficher un message d'erreur
decrementer_fic_recap = "Erreur : Le fichier RECAPENVOI.csv n'existe pas."
End If
end function
function nbmessageemeteur(leemeteur)
pom = "select count(id) as tot from messagerie where EMETEUR = "&leemeteur&" and to_days(date) > to_days(now())-2"
set leres = conn.execute(pom)
nbmessageemeteur = cstr(leres("TOT"))
leres.close
set leres = nothing
end function
function nbmessageemeteurmois(leemeteur)
pom = "SELECT COUNT(id) AS tot FROM messagerie WHERE EMETEUR = "&leemeteur&" AND MONTH(date) = MONTH(CURDATE()) AND YEAR(date) = YEAR(CURDATE());"
set leres = conn.execute(pom)
nbmessageemeteurmois = cstr(leres("TOT"))
leres.close
set leres = nothing
end function
function Ucasemot(cle)
if cle <> "" then
cle=lcase(cle)
tab = split(cle," ")
for i = 0 to ubound(tab)
if len(tab(i)) > 1 then
lavartab = tab(i)
fisrt_lettre=ucase(left(tab(i),1))
suite_lettre = right(tab(i),len(tab(i))-1)
mot = mot&" "&fisrt_lettre&suite_lettre
end if
next
Ucasemot = mot
end if
end function
function envoibrevo(ttlavar)
'response.write ttlavar
Dim http: Set http = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
Dim url: url = "https://api.brevo.com/v3/smtp/email"
'Dim data: data = {{"email", "support@espaceagro.com"}, {"name", "ESPACEAGRO"}}
With http
Call .Open("POST", url, False)
Call .SetRequestHeader("content-type", "application/json")
Call .SetRequestHeader("api-key", "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")
Call .SetRequestHeader("accept","application/json")
Call.Send(ttlavar)
End With
If Left(http.Status, 1) = 2 Then
'Request succeeded with a HTTP 2xx response, do something...
Else
'Output error
Call Response.Write("Server returned: " & http.Status & " " & http.StatusText)
End If
end function
function verifckeckmdp(varmdp)
if varmdp <> "" then
Majuscule = false
c_special= false
s_longueur = false
Chiffre = false
if len(varmdp) >=8 then
s_longueur = true
end if
for i = 1 to len(varmdp)
'verifie majuscule
If Mid(varmdp,i,1) > chr(64) and Mid(varmdp,i,1) < chr(91) then
Majuscule = True
end if
'verifie texte special
If (Mid(varmdp,i,1) > chr(32) and Mid(varmdp,i,1) < chr(48)) or (Mid(varmdp,i,1) > chr(57) and Mid(varmdp,i,1) < chr(65)) or (Mid(varmdp,i,1) > chr(121) and Mid(varmdp,i,1) <= chr(255)) then
c_special= True
end if
next
Chiffre = false
for i = 1 to len(varmdp)
If Mid(varmdp,i,1) > chr(47) and Mid(varmdp,i,1) < chr(58) then
Chiffre = True
exit for
end if
next
if majuscule = True and c_special= True and s_longueur = true and Chiffre = True then
verifckeckmdp = -1
else
verifckeckmdp = 0
end if
end if
end function
Function socdate(societet)
if societet <> "" then
vartp1 = "select date from societe where id = "&societet
set varde = conn.execute(vartp1)
if varde.eof then
socdate = ""
else
socdate = varde("date")
end if
varde.close
set varde = nothing
end if
End Function
'pour verifier que le mot cle est bien dedans
Function affichagemotsclesnetoyage(var_expr,var_txtfull)
Arr23 = split(var_expr," ")
For ip = 0 To UBound(Arr23)
'response.write Arr2(ip)
if len( Arr23(ip)) > 2 then
if instr(var_txtfull, Arr23(ip)) > 0 then
affichagemotsclesnetoyage = 1
else
affichagemotsclesnetoyage = 0
exit for
end if
end if
'response.write ilyest&" "
next
end function
function anciennete(mmmm)
if mmmm <> "" then
'response.write mmmm&" "&date()
ancien2 = datediff("d",changedate(mmmm),date())
'response.write ancien2
if ancien2 <= 7 then
anciennete = ""&trsgoogle(lg,"Membre EspaceAgro")&" : "&trsgoogle(lg,"moins de 1 semaine")&""&trsgoogle(lg,"Niveau d experience EspaceAgro-Selleco")&" "&trsgoogle(lg,"DEBUTANT")&" : 0/10
"&trsgoogle(lg,"Merci de bien lire nos")&" "&trsgoogle(lg,"rappels de prudence")&" "
'anciennete = "hh"
end if
if ancien2 > 7 and ancien <= 30 then
anciennete = ""&trsgoogle(lg,"Membre EspaceAgro")&" : "&trsgoogle(lg,"moins de 1 mois")&""&trsgoogle(lg,"Niveau d experience EspaceAgro-Selleco")&" "&trsgoogle(lg,"DEBUTANT")&" : 2/10
"&trsgoogle(lg,"Merci de bien lire nos")&" "&trsgoogle(lg,"rappels de prudence")&" "
'anciennete = "hh"
end if
if ancien2 > 30 and ancien <= 183 then
anciennete = ""&trsgoogle(lg,"Membre EspaceAgro")&" : "&trsgoogle(lg,"moins de 6 mois")&""&trsgoogle(lg,"Niveau d experience EspaceAgro-Selleco")&" "&trsgoogle(lg,"HABITUÉ")&" : 3/10
"&trsgoogle(lg,"Merci de bien lire nos")&" "&trsgoogle(lg,"rappels de prudence")&" "
'anciennete = "hh"
end if
if ancien2 > 183 and ancien <= 365 then
anciennete = ""&trsgoogle(lg,"Membre EspaceAgro")&" : "&trsgoogle(lg,"moins de 1 an")&""&trsgoogle(lg,"Niveau d experience EspaceAgro-Selleco")&" "&trsgoogle(lg,"HABITUÉ")&" : 5/10
"&trsgoogle(lg,"Merci de bien lire nos")&" "&trsgoogle(lg,"rappels de prudence")&" "
'anciennete = "hh"
end if
if ancien2 > 365 and ancien <= 730 then
anciennete = ""&trsgoogle(lg,"Membre EspaceAgro")&" : "&trsgoogle(lg,"moins de 2 ans")&""&trsgoogle(lg,"Niveau d experience EspaceAgro-Selleco")&" "&trsgoogle(lg,"CONFIRMÉ")&" : 8/10
"&trsgoogle(lg,"Merci de bien lire nos")&" "&trsgoogle(lg,"rappels de prudence")&" "
'anciennete = "hh"
end if
if ancien2 > 730 then
anciennete = ""&trsgoogle(lg,"Membre EspaceAgro")&" : plus de 2 ans"&trsgoogle(lg,"Niveau d experience EspaceAgro-Selleco")&" "&trsgoogle(lg,"CONFIRMÉ")&" : 10/10
"&trsgoogle(lg,"Merci de bien lire nos")&" "&trsgoogle(lg,"rappels de prudence")&" "
'anciennete = "hh"
end if
end if
end function
function abonne1(sonid)
mp="select id,datefin from abonnement where service='PAGEsociete' and societe="&sonid&" and to_days(datefin) > to_days(now())"
set lo = conn.execute(mp)
if not lo.eof then
abonne1 = lo("datefin")
else
abonne1 = "non"
end if
lo.close
set lo = nothing
end function
function calcmessage(sonid)
m="SELECT COUNT(*) as tot FROM message_response WHERE fait = 0 and societeid="&sonid
'response.write m
set poi2 = conn.execute(m)
if not poi2.eof then
calcmessage = poi2("tot")
end if
poi2.close
set poi2 = nothing
end function
function datefinabonne1(sonid)
mp="select datefin from abonnement where service='PAGEsociete' and societe="&sonid&" and to_days(datefin) > to_days(now())"
set lo = conn.execute(mp)
if not lo.eof then
datefinabonne1 = lo("datefin")
else
datefinabonne1 = ""
end if
lo.close
set lo = nothing
end function
function dejaabonne1(sonid)
mp="select id from abonnement where service='PAGEsociete' and societe="&sonid
set lo = conn.execute(mp)
if not lo.eof then
dejaabonne1 = "oui"
else
dejaabonne1 = "non"
end if
lo.close
set lo = nothing
end function
function apagesposorisee(sonid)
mp="select idsociete from page_societe where idsociete="&sonid&" and validerespaceagro = -1 and terminerclient = -1 and modifie=0"
set lo = conn.execute(mp)
if not lo.eof then
apagesposorisee = "oui"
else
apagesposorisee = "non"
end if
lo.close
set lo = nothing
end function
function datefinpagesponsorisee(sonid)
mp="select datefin from page_societe where idsociete="&sonid&" and validerespaceagro = -1 and terminerclient = -1 and modifie=0 and to_days(datefin) > to_days(now())"
set lo = conn.execute(mp)
if not lo.eof then
datefinpagesponsorisee = lo("datefin")
else
datefinpagesponsorisee = ""
end if
lo.close
set lo = nothing
end function
function troplongchaine(vartt)
if vartt <> "" then
troplongchaine = false
LeTableau = Split(vartt, " ")
For i = 0 To UBound(LeTableau)
if len(LeTableau(i)) > 50 then
troplongchaine = true
Exit For
end if
Next
end if
end function
FUNCTION GenerePsw()
consonnes = "bBcCdDfFgGhHjJkKlLmMnNpPqQrRsStTvVwWxXzZ"
voyelles = "aA@eE23iI1uUyY"
psw = ""
for x = 1 to 6
Randomize Timer
i = int (40 * Rnd )
psw = psw + mid(consonnes,i+1,1)
Randomize Timer
i = int (17 * Rnd )
psw = psw + mid (voyelles,i+1,1)
next
GenerePsw = psw
END FUNCTION
Function Hash(HashType, Target)
On Error Resume Next
If IsArray(Target) = True Then PlainText = Target(0) Else PlainText = Target End If
With CreateObject("ADODB.Stream")
.Open
.CharSet = "Windows-1252"
.WriteText PlainText
.Position = 0
.CharSet = "UTF-8"
PlainText = .ReadText
.Close
End With
Set UTF8Encoding = CreateObject("System.Text.UTF8Encoding")
PlainTextToBytes = UTF8Encoding.GetBytes_4(PlainText)
Select Case HashType
Case "md5": Set Cryptography = CreateObject("System.Security.Cryptography.MD5CryptoServiceProvider") '< 64 (collisions found)
Case "ripemd160": Set Cryptography = CreateObject("System.Security.Cryptography.RIPEMD160Managed")
Case "sha1": Set Cryptography = CreateObject("System.Security.Cryptography.SHA1Managed") '< 80 (collision found)
Case "sha256": Set Cryptography = CreateObject("System.Security.Cryptography.SHA256Managed")
Case "sha384": Set Cryptography = CreateObject("System.Security.Cryptography.SHA384Managed")
Case "sha512": Set Cryptography = CreateObject("System.Security.Cryptography.SHA512Managed")
Case "md5HMAC": Set Cryptography = CreateObject("System.Security.Cryptography.HMACMD5")
Case "ripemd160HMAC": Set Cryptography = CreateObject("System.Security.Cryptography.HMACRIPEMD160")
Case "sha1HMAC": Set Cryptography = CreateObject("System.Security.Cryptography.HMACSHA1")
Case "sha256HMAC": Set Cryptography = CreateObject("System.Security.Cryptography.HMACSHA256")
Case "sha384HMAC": Set Cryptography = CreateObject("System.Security.Cryptography.HMACSHA384")
Case "sha512HMAC": Set Cryptography = CreateObject("System.Security.Cryptography.HMACSHA512")
End Select
Cryptography.Initialize()
If IsArray(Target) = True Then Cryptography.Key = UTF8Encoding.GetBytes_4(Target(1))
BytesToHashedBytes = Cryptography.ComputeHash_2((PlainTextToBytes))
For x = 1 To LenB(BytesToHashedBytes)
HashedBytesToHex = HashedBytesToHex & Right("0" & Hex(AscB(MidB(BytesToHashedBytes, x, 1))), 2)
Next
If Err.Number <> 0 Then Response.Write(Err.Description) Else Hash = LCase(HashedBytesToHex)
On Error GoTo 0
End Function
function texte_abonne_pagepro(sonid)
mp="select libelle,datefin from abonnement where service='PAGEsociete' and societe="&sonid&" and to_days(datefin) > to_days(now())"
set lo = conn.execute(mp)
if not lo.eof then
texte_abonne_pagepro = lcase(lo("libelle")) &" jusqu'au "&(lo("datefin"))
else
texte_abonne_pagepro = "Vous n etes pas encore abonné..."
end if
lo.close
set lo = nothing
end function
function pageproactiffinalencours(sonid)
mp="select id from abonnement where service='PAGEsociete' and societe="&sonid&" and to_days(datefin) > to_days(now())"
set lo = conn.execute(mp)
if not lo.eof then
mp="select idsociete from page_societe where idsociete="&sonid&" and validerespaceagro = -1 and terminerclient = -1 and modifie=0"
set lo2 = conn.execute(mp)
if not lo2.eof then
pageproactiffinalencours = true
else
pageproactiffinalencours = false
end if
lo2.close
set lo2 = nothing
else
pageproactiffinalencours=false
end if
lo.close
set lo = nothing
end function
function pagepro_prete_sansabonnement(sonid)
mp="select idsociete from page_societe where idsociete="&sonid&" and validerespaceagro = -1 and terminerclient = -1 and modifie=0"
set lo2 = conn.execute(mp)
if not lo2.eof then
mp="select id from abonnement where service='PAGEsociete' and societe="&sonid&" and to_days(datefin) > to_days(now())"
set lo = conn.execute(mp)
if lo.eof then
pagepro_prete_sansabonnement = true
end if
lo.close
set lo = nothing
end if
lo2.close
set lo2 = nothing
end function
function abonne_pagepro(sonid)
mp="select datefin from abonnement where service='PAGEsociete' and societe="&sonid&" and to_days(datefin) > to_days(now())"
set lo = conn.execute(mp)
if not lo.eof then
abonne_pagepro =lo("datefin")
else
abonne_pagepro =""
end if
lo.close
set lo = nothing
end function
function DEJA_abonne_pagepro(sonid)
mp="select id from abonnement where service='PAGEsociete' and societe="&sonid
set lo = conn.execute(mp)
if not lo.eof then
DEJA_abonne_pagepro =true
else
DEJA_abonne_pagepro = false
end if
lo.close
set lo = nothing
end function
function datefin_pagepro(sonid)
mp="select datefin from abonnement where service='PAGEsociete' and societe="&sonid&" and to_days(datefin) > to_days(now())"
set lo = conn.execute(mp)
if not lo.eof then
datefin_pagepro =lo("datefin")
else
datefin_pagepro = date()
end if
lo.close
set lo = nothing
end function
function aeupagepro(sonid)
mp="select id from abonnement where service='PAGEsociete' and societe="&sonid
set lo = conn.execute(mp)
if not lo.eof then
aeupagepro =true
else
aeupagepro = false
end if
lo.close
set lo = nothing
end function
function dispose_pagepro(sonid)
mp="select idsociete from page_societe where idsociete="&sonid
set lo = conn.execute(mp)
if not lo.eof then
dispose_pagepro =true
else
dispose_pagepro = false
end if
lo.close
set lo = nothing
end function
function bonne_pageproOFFERT(sonid)
mp="select id from abonnement where service='PAGEsociete' and societe="&sonid&" and to_days(datefin) > to_days(now()) and transaction='AB11111111111'"
set lo = conn.execute(mp)
if not lo.eof then
bonne_pageproOFFERT = true
else
bonne_pageproOFFERT = false
end if
lo.close
set lo = nothing
end function
function weekendespaceagro()
'if Weekday(date()) = 7 or Weekday(date()) = 1 then
' weekendespaceagro = true
'else
weekendespaceagro = false
'end if
end function
function horaireespaceagro()
if hour(now()) >= 18 or hour(now()) < 7 then
horaireespaceagro = true
else
horaireespaceagro = false
end if
end function
function estbadge(mavv,lataille)
if mavv = -1 then
estbadge=" "
else
estbadge=" "
end if
end function
function netoyagetitre(bilout)
netoyagetitre = replace(bilout,"Recherche de client","")
netoyagetitre = replace(netoyagetitre,"Fournisseurs de ","")
netoyagetitre = replace(netoyagetitre,"Recherche de clients","")
netoyagetitre = replace(netoyagetitre,"Recherche fournisseurs","")
netoyagetitre = replace(netoyagetitre,"Recherche fournisseur","")
netoyagetitre = replace(netoyagetitre,"Fournisseur de ","")
netoyagetitre = replace(netoyagetitre,"vente ","")
netoyagetitre = replace(netoyagetitre,"RECHERCHE CLIENTS ","")
netoyagetitre = replace(netoyagetitre,"RECHERCHE CLIENT ","")
netoyagetitre = replace(netoyagetitre,"Recherche grossiste ","")
netoyagetitre = replace(netoyagetitre,"Recherche grossistes ","")
netoyagetitre = replace(netoyagetitre,"Chercher des ","")
end function
function etatsociete(aVar)
if aVar <> "" then
select case avar
case "-1"
etatsociete = "societe"
case "0"
etatsociete = "PARTICULIER"
case "1"
etatsociete = "societe"
case "2"
etatsociete = "EN PROJET"
case "3"
etatsociete = "PARTICULIER"
end select
end if
end function
function antifraudeinscriptionflash(numsoc)
antifraudeinscriptionflash = false
'lutte contre paiement de nuit
if CountAnnonce("AFFICHER",numsoc) = 0 then
ladateenr = Lenregistrement("societe","date","id",numsoc)
ann1 = year(ladateenr)
mois1 = month(ladateenr)
day1 = day(ladateenr)
'if (day(date()) = day1 or day(date()) = day1-1) and month(date()) = mois1 and year(date()) = ann1 then
'toto = envoimail("paloumer@wanadoo.fr", "TENTATIVE FRAUDE ACCES unite"&numsoc,numsoc)
antifraudeinscriptionflash = true
'end if
end if
'if cstr(calctransation(session("id"))) > 3 then
' response.redirect("message7unite.asp")
'end if
antifraudeinscriptionflash = false
end function
function panotation(lechi)
lecal=""
for i = 1 to lechi
lecal=lecal&" "
next
for n = 1 to (5-lechi)
lecal=lecal&" "
next
panotation = lecal
end function
function derniereconnexion(varid)
pml = "select max(date) as ladd from connexion where compte="&varid
'response.write pml
set pml2 = conn.execute(pml)
if not pml2.eof then
derniereconnexion = pml2("ladd")
else
derniereconnexion = ""
end if
pml2.close
set pml2=nothing
end function
function estbloquer(varid)
pml = "select societe from societe_bloque where societe="&varid&" and bloquer = -1"
set pml2 = conn.execute(pml)
if not pml2.eof then
estbloquer = -1
else
estbloquer = 0
end if
pml2.close
set pml2=nothing
end function
function estcomptelimiter(varid)
pml = "select comptelimite from societe where id="&varid
set pml2 = conn.execute(pml)
if not pml2.eof then
if pml2("comptelimite") = "-1" then
estcomptelimiter = -1
else
estcomptelimiter = 0
end if
else
estcomptelimiter = 0
end if
pml2.close
set pml2=nothing
end function
function acadeau(varid)
pml = "select id from cadeau where societe="&varid
set pml2 = conn.execute(pml)
if not pml2.eof then
acadeau = -1
else
acadeau = 0
end if
pml2.close
set pml2=nothing
end function
function miseajourcountannonce()
'p="select * from domaine order by id"
'set hh = conn.execute(p)
'do until hh.eof
' ll="select count(*)as tot from affaire where affaire.desactiver = 0 and afficher is true and supprimer is false and domaine="&hh("id")
' set lo = conn.execute(ll)
' if not lo.eof then
' letot = lo("tot")
' conn.execute("update domaine set letot = "&letot&" where id="&hh("id"))
' end if
' lo.close
' set lo=nothing
' hh.movenext
' loop
' hh.close
end function
function affcoutunite(nbraff)
if nbraff <> "" then
affcoutunite= ""&nbraff&" u "
end if
end function
function estvip(lenum)
lmkl = "select VIP from societe where id = "&lenum
set drt2 = conn.execute(lmkl)
if not drt2.eof then
if drt2("vip") = -1 then
estvip=""&trsgoogle(lag,"VIP")&" "
else
estvip = ""
end if
else
estvip = ""
end if
drt2.close
set drt2 = nothing
end function
function estlepremium(lenum)
lmkl = "select PREMIUM from societe where id = "&lenum
set drt2 = conn.execute(lmkl)
if not drt2.eof then
if drt2("PREMIUM") = -1 then
estlepremium=""&trsgoogle(lag,"PREMIUM")&" "
else
estlepremium = ""
end if
else
estlepremium = ""
end if
drt2.close
set drt2 = nothing
end function
function estlepremiumplus(lenum)
lmkl = "select PREMIUM from societe where id = "&lenum
set drt2 = conn.execute(lmkl)
if not drt2.eof then
if drt2("PREMIUM") = -1 then
estlepremiumplus=""&trsgoogle(lag,"PREMIUM")&"+ "
else
estlepremiumplus = ""
end if
else
estlepremiumplus = ""
end if
drt2.close
set drt2 = nothing
end function
function retourpremium(lenum)
lmkl = "select PREMIUM from societe where id = "&lenum
'response.write lmkl
set drt2 = conn.execute(lmkl)
if not drt2.eof then
if drt2("PREMIUM") = -1 then
retourpremium=-1
else
retourpremium = 0
end if
end if
drt2.close
set drt2 = nothing
end function
function estpremium()
estpremium=""&trsgoogle(lag,"PREMIUM")&" "
end function
function estpaspremium()
estpaspremium=""&trsgoogle(lag,"PREMIUM")&" "
end function
function estfichepro()
estfichepro=""&trsgoogle(lag,"FICHE PRO")&" "
end function
function estficheproplus()
estficheproplus=""&trsgoogle(lag,"FICHE PRO +")&" "
end function
function estficheprononplus()
estficheprononplus=""&trsgoogle(lag,"FICHE PRO")&" "
end function
function etiquette(lag,letiq)
select case letiq
case "1"
etiquette=""&trsgoogle(lag,"ACHAT")&" "
case "2"
l_actiont = "vente "
etiquette=""&trsgoogle(lag,"VENTE")&" "
case "3"
l_actiont = "partenaire "
etiquette=""&trsgoogle(lag,"AUTRE")&" "
case "4"
l_actiont = " demande conseil "
etiquette=""&trsgoogle(lag,"DEMANDE CONSEIL")&" "
end select
end function
function etiquettebrute(lag,letiq)
select case letiq
case "1"
etiquettebrute=trsgoogle(lag,"Achat")
case "2"
etiquettebrute=trsgoogle(lag,"Vente")
case "3"
case "4"
etiquettebrute=trsgoogle(lag,"Demande conseil")
end select
end function
function dejapayecejour(lasoc2)
p="select id from reglement_confirm where societe="&lasoc2&" and TO_DAYS(date) = TO_DAYS(NOW()) and PAYERCB=-1"
set ff0=conn.execute(p)
if not ff0.eof then
dejapayecejour = 0
else
dejapayecejour = 0
end if
ff0.close
set ff0 = nothing
end function
Function rewespaceproducteur(id,ff)
rewespaceproducteur = mid(replace(replace(cleanworddeclarerespaceproducteur(lcase(ff))," ","-"),"-_-","_"),1,30)&"_i"&id&".html"
end function
function cleanworddeclarerespaceproducteur(U56)
Set regEx = New RegExp
regEx.IgnoreCase = True : regEx.Global = True
regEx.Pattern = "[.;:""'_+-,’]" : U56 = regEx.REPLACE(U56,"_")
U56 = replace(U56," ","-")
U56 = replace(U56,"#","")
U56 = replace(U56,"%","")
U56 = replace(U56,"/","-")
U56 = replace(U56,"(","_")
U56 = replace(U56,")","_")
U56 = replace(U56,"&","-")
U56 = replace(U56,"--","-")
U56 = trim(U56)
regEx.Pattern = "[cç]" : U56 = regEx.REPLACE(U56,"c")
regEx.Pattern = "[eéèêë]" : U56 = regEx.REPLACE(U56,"e")
regEx.Pattern = "[aàáâä]" : U56 = regEx.REPLACE(U56,"a")
regEx.Pattern = "[oóòôö]" : U56 = regEx.REPLACE(U56,"o")
regEx.Pattern = "[uúùûü]" : U56 = regEx.REPLACE(U56,"u")
regEx.Pattern = "[iìíîï]" : U56 = regEx.REPLACE(U56,"i")
regEx.Pattern = "[nñ]" : U56 = regEx.REPLACE(U56,"n")
cleanworddeclarerespaceproducteur = U56
if left(cleanworddeclarerespaceproducteur,1)="-" then cleanworddeclarerespaceproducteur = mid(cleanworddeclarerespaceproducteur,2,(len(cleanworddeclarerespaceproducteur)-1)) end if
if right(cleanworddeclarerespaceproducteur,1)="-" then cleanworddeclarerespaceproducteur = mid(cleanworddeclarerespaceproducteur,1,(len(cleanworddeclarerespaceproducteur)-1)) end if
set regEx = nothing
end function
function optionofferte(lidsoc)
pl = "select count(*) as tot from optionofferte where fait = 0 and societe="&lidsoc
set dd=conn.execute(pl)
if not dd.eof then
optionofferte = dd("tot")
else
optionofferte = 0
end if
dd.close
set dd = nothing
end function
function estautorise(lw)
llm="select mts from mtsinterdit where mts = '"&lw&"'"
set klj = conn.execute(llm)
if not klj.eof then
estautorise = false
else
estautorise = true
end if
klj.close
set klj = nothing
end function
function rewriteurllg(leg,urlpage)
select case leg
case "GB"
if urlpage = "/" then
rewriteurllg = "/english/"
end if
if urlpage = "/cpt/" then
rewriteurllg = "/english/account/"
end if
if urlpage = "/quisommesnous.asp" then
rewriteurllg = "/english/aboutus.htm"
end if
if urlpage = "/membre.asp" then
rewriteurllg = "/membre.asp?lg=gb"
end if
if urlpage = "/inscription_espaceagro/" then
rewriteurllg = "/english/registration/"
end if
if urlpage = "/moinsde8jours.htm" then
rewriteurllg = "/english/lessthan8days.htm"
end if
if urlpage = "/perdu.asp" then
rewriteurllg = "/english/lostcode.htm"
end if
if urlpage = "/showroom-materiel-agroalimentaire.htm" then
rewriteurllg = "/english/showroom-material.htm"
end if
if urlpage = "/contact.asp" then
rewriteurllg = "/english/contact.asp"
end if
if urlpage = "/publicite.asp" then
rewriteurllg = "/english/publicity.htm"
end if
if urlpage = "/plustemoignage.asp" then
rewriteurllg = "/english/moretestimony.htm"
end if
if urlpage = "/showroom-explication.asp" then
rewriteurllg = "/english/showroom-explication.htm"
end if
if urlpage = "/agroalimentaire/producteur-grossiste.html" then
rewriteurllg = "/english/wholesaler.htm"
end if
case else
if urlpage = "/" then
rewriteurllg = urlpage
end if
if urlpage = "/quisommesnous.asp" then
rewriteurllg = urlpage
end if
if urlpage = "/cpt/" then
rewriteurllg = urlpage
end if
if urlpage = "/inscription_espaceagro/" then
rewriteurllg = urlpage
end if
if urlpage = "/moinsde8jours.htm" then
rewriteurllg = urlpage
end if
if urlpage = "/showroom-materiel-agroalimentaire.htm" then
rewriteurllg = urlpage
end if
if urlpage = "/cpt/" then
rewriteurllg = urlpage
end if
if urlpage = "/perdu.asp" then
rewriteurllg = urlpage
end if
if urlpage = "/membre.asp" then
rewriteurllg = urlpage
end if
if urlpage = "/contact.asp" then
rewriteurllg = urlpage
end if
if urlpage = "/publicite.asp" then
rewriteurllg = urlpage
end if
if urlpage = "/plustemoignage.asp" then
rewriteurllg = urlpage
end if
if urlpage = "/showroom-explication.asp" then
rewriteurllg = urlpage
end if
if urlpage = "/agroalimentaire/producteur-grossiste.html" then
rewriteurllg = urlpage
end if
if urlpage = "/pagesociete.htm" then
rewriteurllg = urlpage
end if
if urlpage = "/pagesponsorisee.htm" then
rewriteurllg = urlpage
end if
end select
end function
function requestpirateip(lippirate)
'lk = "select ip from querytest where ip = '"&lippirate&"'"
'set restr62 = conn.execute(lk)
' if not restr62.eof then
' requestpirateip = true
' else
requestpirateip = false
' end if
'restr62.close
'set restr62 = nothing
end function
function requestipchine(lippirate)
lk = "select ipchine from ipchine where ipchine like '"&lippirate&"%'"
set restr62 = conn.execute(lk)
if not restr62.eof then
requestipchine = true
else
requestipchine = false
end if
restr62.close
set restr62 = nothing
end function
function langueaffaire(lid)
lk = "select langue from affaire where id = "&lid
set restr62 = conn.execute(lk)
if not restr62.eof then
langueaffaire = restr62("langue")
end if
restr62.close
set restr62 = nothing
end function
function fctregionmonde(lid,lalg)
lk = "select nomregion"&lalg&" as rt1 from zonemonde where id = "&lid
set restr62 = conn.execute(lk)
if not restr62.eof then
fctregionmonde = restr62("rt1")
end if
restr62.close
set restr62 = nothing
end function
function fctregionmonde_pays(lid)
lk = "select pays as rt1 from zonemonde where id = "&lid
set restr62 = conn.execute(lk)
if not restr62.eof then
fctregionmonde_pays = restr62("rt1")
end if
restr62.close
set restr62 = nothing
end function
function calctransation(mibol)
lk = "select societe,count(id) as tt from reglement_confirm where societe = "&mibol&" and erreur=-1 and TO_DAYS(NOW()) - TO_DAYS(date) <= 1 group by societe"
set restr44 = conn.execute(lk)
if not restr44.eof then
calctransation = restr44("tt")
end if
restr44.close
set restr44 = nothing
end function
function tabinfo(lidinfo,aff)
if aff = "non" then
p="select info_entreprise.* from info_entreprise where idsociete="&lidinfo&" and info_entreprise.verifier=-1"
set pp = conn.execute(p)
if not pp.eof then
b44 = " Infos officielles diffusées par l'annonceur: "
b44=b44&"
Il declare être ENTREPRISE:"
if pp("entreprise")=-1 then
b44=b44&"OUI "
end if
if pp("entreprise")=1 then
b44=b44&"OUI "
end if
if pp("entreprise")=2 then
b44=b44&"EN PROJET "
end if
if pp("entreprise")=3 then
b44=b44&"NON "
end if
if pp("entreprise")=0 then
b44=b44&"NON COMMUNIQUE "
end if
b44=b44&" Il declare pouvoir fournir sur demande: "
b44=b44&"banque principale: "
if pp("banque")= "" then
b44=b44&"--"
else
b44=b44&"indiquée "
end if
b44=b44&" documents officiels "
if pp("Document_officiel")= "" then
b44=b44&"--"
else
b44=b44&"OUI"
end if
b44=b44&" "
if pp("entreprise")=-1 then
b44=b44&"Numero enregistrement:"
if pp("num_rc")= "" then
b44=b44&"--"
else
b44=b44&"indiqué "
end if
b44=b44&" Aupres de :"
if pp("cci")= "" then
b44=b44&"--"
else
b44=b44&""& pp("cci")&" "
end if
end if
b44=b44&" Des references clientes "
if pp("liste_client")= "" then
b44=b44&"--"
else
b44=b44&"OUI"
end if
b44=b44&" "
if pp("num_IMPORTATION")= "" then
b44=b44&"--"
else
b44=b44&"OUI"
end if
b44=b44&" "
lecomment=pp("commentaire")
if len(lecomment)> 5 then
b44=b44&"Commentaire: "&lecomment
end if
b44=b44&" "
if pp("num_EXPORTATION")= "" then
b44=b44&"--"
else
b44=b44&"OUI"
end if
b44=b44&" Ces informations sont diffusées sous la seule responsabilité de leur auteur
"
b44=b44&"
"
else
b44=b44&""
end if
pp.close
set pp = nothing
end if
if aff = "oui" then
p="select info_entreprise.* from info_entreprise where idsociete="&lidinfo&" and info_entreprise.verifier=-1"
set pp = conn.execute(p)
if not pp.eof then
b44 = " Infos officielles diffusées par l'annonceur: "
b44=b44&"
Il declare être ENTREPRISE:"
if pp("entreprise")=-1 then
b44=b44&"OUI "
end if
if pp("entreprise")=1 then
b44=b44&"OUI "
end if
if pp("entreprise")=2 then
b44=b44&"EN PROJET "
end if
if pp("entreprise")=3 then
b44=b44&"NON "
end if
if pp("entreprise")=0 then
b44=b44&"NON COMMUNIQUE "
end if
b44=b44&" Il declare pouvoir fournir sur demande: "
b44=b44&"banque principale: "
if pp("banque")= "" then
b44=b44&"--"
else
b44=b44&"OUI"
end if
b44=b44&" documents officiels "
if pp("Document_officiel")= "" then
b44=b44&"--"
else
b44=b44&"OUI"
end if
b44=b44&" "
if pp("entreprise")=-1 then
b44=b44&"Numero enregistrement:"
if pp("num_rc")= "" then
b44=b44&"--"
else
b44=b44&""&pp("num_rc")&" "
end if
b44=b44&" Aupres de :"
if pp("cci")= "" then
b44=b44&"--"
else
b44=b44&""&pp("cci")&" "
end if
end if
b44=b44&" Des references clientes "
if pp("liste_client")= "" then
b44=b44&"--"
else
b44=b44&"OUI"
end if
b44=b44&" Numero licence d'importation "
if pp("num_IMPORTATION")= "" then
b44=b44&"--"
else
b44=b44&pp("num_IMPORTATION")
end if
b44=b44&" "
lecomment=pp("commentaire")
if len(lecomment)> 5 then
b44=b44&"Commentaire: "&lecomment
end if
b44=b44&" Numero licence d'exportation "
if pp("num_EXPORTATION")= "" then
b44=b44&"--"
else
b44=b44&pp("num_EXPORTATION")
end if
b44=b44&" Ces informations sont diffusées sous la seule responsabilité de leur auteur
"
b44=b44&"
"
else
b44=b44&""
end if
pp.close
set pp = nothing
end if
tabinfo = b44
end function
function tabinfoGB(lidinfo,aff)
if aff = "non" then
p="select info_entreprise.* from info_entreprise where idsociete="&lidinfo&" and info_entreprise.verifier=-1"
set pp = conn.execute(p)
if not pp.eof then
b44 = " Official information registered by the advertiser: "
b44=b44&"
he say to have a company:"
if pp("entreprise")=-1 then
b44=b44&"YES "
end if
if pp("entreprise")=1 then
b44=b44&"YES "
end if
if pp("entreprise")=2 then
b44=b44&"IN PROJECT "
end if
if pp("entreprise")=3 then
b44=b44&"NO "
end if
if pp("entreprise")=0 then
b44=b44&"ot disclosed "
end if
b44=b44&" He declared to provide on request: "
b44=b44&"Bank: "
if pp("banque")= "" then
b44=b44&"--"
else
b44=b44&"informed "
end if
b44=b44&" official document "
if pp("Document_officiel")= "" then
b44=b44&"--"
else
b44=b44&"YES"
end if
b44=b44&" "
if pp("entreprise")=-1 then
b44=b44&"Registration number:"
if pp("num_rc")= "" then
b44=b44&"--"
else
b44=b44&"informed "
end if
b44=b44&" by :"
if pp("cci")= "" then
b44=b44&"--"
else
b44=b44&""& pp("cci")&" "
end if
end if
b44=b44&" Customers reference "
if pp("liste_client")= "" then
b44=b44&"--"
else
b44=b44&"YES"
end if
b44=b44&" "
if pp("num_IMPORTATION")= "" then
b44=b44&"--"
else
b44=b44&"OUI"
end if
b44=b44&" "
lecomment=pp("commentaire")
if len(lecomment)> 5 then
b44=b44&"Comment:: "&lecomment
end if
b44=b44&" "
if pp("num_EXPORTATION")= "" then
b44=b44&"--"
else
b44=b44&"OUI"
end if
b44=b44&" These informations are posted under the only responsibility of the author
"
b44=b44&"
"
else
b44=b44&""
end if
pp.close
set pp = nothing
end if
if aff = "oui" then
p="select info_entreprise.* from info_entreprise where idsociete="&lidinfo&" and info_entreprise.verifier=-1"
set pp = conn.execute(p)
if not pp.eof then
b44 = " Official information registered by the advertiser: "
b44=b44&"
he say to have a company::"
if pp("entreprise")=-1 then
b44=b44&"YES "
end if
if pp("entreprise")=1 then
b44=b44&"YES "
end if
if pp("entreprise")=2 then
b44=b44&"IN PROJECT "
end if
if pp("entreprise")=3 then
b44=b44&"NO "
end if
if pp("entreprise")=0 then
b44=b44&"ot disclosed "
end if
b44=b44&" He declared to provide on request: "
b44=b44&"bank: "
if pp("banque")= "" then
b44=b44&"--"
else
b44=b44&"YES"
end if
b44=b44&" Official documents "
if pp("Document_officiel")= "" then
b44=b44&"--"
else
b44=b44&"YES"
end if
b44=b44&" "
if pp("entreprise")=-1 then
b44=b44&"Registration number:"
if pp("num_rc")= "" then
b44=b44&"--"
else
b44=b44&""&pp("num_rc")&" "
end if
b44=b44&" by :"
if pp("cci")= "" then
b44=b44&"--"
else
b44=b44&""&pp("cci")&" "
end if
end if
b44=b44&" Customers reference "
if pp("liste_client")= "" then
b44=b44&"--"
else
b44=b44&"YES"
end if
b44=b44&" Import Number "
if pp("num_IMPORTATION")= "" then
b44=b44&"--"
else
b44=b44&pp("num_IMPORTATION")
end if
b44=b44&" "
lecomment=pp("commentaire")
if len(lecomment)> 5 then
b44=b44&"Comment: "&lecomment
end if
b44=b44&" Export Number "
if pp("num_EXPORTATION")= "" then
b44=b44&"--"
else
b44=b44&pp("num_EXPORTATION")
end if
b44=b44&" These informations are posted under the only responsibility of the author
"
b44=b44&"
"
else
b44=b44&""
end if
pp.close
set pp = nothing
end if
tabinfoGB = b44
end function
function thecolorindice(laval45)
couleur1 = "#F6E3CE"
couleur2 = "#F7BE81"
couleur3 = "#FAAC58"
couleur4 = "#FAAC58"
couleur5 = "#FE9A2E"
couleur6 = "#FE9A2E"
couleur7 = "#FE9A2E"
couleur8 = "#FF8000"
couleur9 = "#FF8000"
couleur10 = "#FF8000"
if laval45 = 0 then laval45 = 1 end if
if laval45 < 100 then thecolorindice=couleur10 end if
if laval45 < 90 then thecolorindice=couleur9 end if
if laval45 < 80 then thecolorindice=couleur8 end if
if laval45 < 70 then thecolorindice=couleur7 end if
if laval45 < 60 then thecolorindice=couleur6 end if
if laval45 < 50 then thecolorindice=couleur5 end if
if laval45 < 40 then thecolorindice=couleur4 end if
if laval45 < 30 then thecolorindice=couleur3 end if
if laval45 < 20 then thecolorindice=couleur2 end if
if laval45 < 10 then thecolorindice=couleur1 end if
end function
function controle(lidd2)
gfd = "select * from info_entreprise where idsociete="&lidd2
set kkp = conn.execute(gfd)
if not kkp.eof then
'regle: entreprise = 300 points
'unite: 300 points max
'preuve 100 points
'bq: 40 points
'bcl: 100 points
'rcimp: 30 pts
'rcexp 30 pts
a_entreprise=kkp("entreprise")
a_CCI=kkp("CCI")
a_num_rc=kkp("num_rc")
'calcul entreprise
if a_cci <> "" then ent2 = 1 else ent2 = 0 end if
if a_num_rc <> "" then ent3 = 1 else ent3 = 0 end if
if a_entreprise = -1 then
ent1 = 1
else
ent1 = 0
ent3 = 0
ent2 = 0
end if
ent_tot = ent1+ent2+ent3
select case ent_tot
case 0
points_entreprise = 0
case 1
points_entreprise = 30
case 2
points_entreprise = 150
case 3
points_entreprise = 300
end select
'preuve
a_liste_client=kkp("liste_client")
a_document_officiel=kkp("document_officiel")
if a_document_officiel = -1 then ent1 = 1 else ent1 = 0 end if
if a_liste_client = -1 then ent2 = 1 else ent2 = 0 end if
ent_tot = ent1+ent2
select case ent_tot
case 0
points_preuve = 0
case 1
points_preuve = 50
case 2
points_preuve = 200
end select
a_banque=kkp("banque")
if a_banque <> "" then points_banque = 40 else points_banque = 0 end if
a_bcl=kkp("bcl")
if a_bcl = -1 then points_bcl = 100 else points_bcl = 0 end if
a_num_exportation=kkp("num_exportation")
if a_num_exportation <> "" then points_exp = 30 else points_exp = 0 end if
a_num_importation=kkp("num_importation")
if a_num_importation <> "" then points_imp = 30 else points_imp = 0 end if
a_commentaire=kkp("commentaire")
'calcul unite
totalunit = 0
pp44="SELECT sum(montantht) as totalca from reglement_confirm where RECU = -1 AND societe = "&lidd2&" group by societe"
set RS412 = conn.execute(pp44)
if not RS412.eof then
totalunit = cstr(RS412("totalca"))
end if
RS412.close
set RS412 = nothing
totalunit = cstr(totalunit)
if totalunit > 200 then totalunit = 200 end if
totalpoint = points_entreprise + points_preuve + points_banque + points_bcl + points_exp + points_imp + totalunit
controle = (totalpoint/1000)*100
end if
kkp.close
set kkp = nothing
end function
function tableauindice(lasoc456)
lavaleurindice = controle(lasoc456)
if lavaleurindice=0 then lavaleurindice = 1 end if
ledessin=""
ledessin = ledessin &" "&lavaleurindice&"%
"
tableauindice = ledessin
end function
function mdp(lavar)
lenv=len(lavar)
lenv2 = len(lavar)-3
lavar1=left(lavar,2)
lavar2=right(lavar,1)
mdp = lavar1
for i = 1 to lenv2
mdp = mdp&"*"
next
mdp = mdp & lavar2
mdp="***"
end function
function trs(lavar)
if lavar <> "" then
lavarepurer = replace(lavar,"'"," ")
end if
application.lock
lk = "select fr,gb from tbtranslate where fr='"&lavarepurer&"'"
set restr = conn.execute(lk)
if not restr.eof then
if session("lg") = "GB" then
trs = restr("GB")
if isnull(restr("GB")) then
trs = "pas fait ("&restr("fr")&" )"
end if
else
trs = lavar
end if
else
trs = lavar
if lavar <> "" then
SQL="SELECT * FROM tbtranslate"
Set RS78 = server.createobject("ADODB.Recordset")
RS78.Open "tbtranslate",Conn , 3, 2
RS78.addnew
RS78("FR")=lavarepurer
RS78("url")=Request.ServerVariables("PATH_INFO")
RS78.update
RS78.close
set RS78 = nothing
end if
end if
restr.close
set restr = nothing
application.unlock
end function
function trsgoogle(lg,lavar66)
if lavar66 <> "" then
lavarepurer = replace(lavar66,"'"," ")
end if
lk = "select fr,gb,id from tbtranslate where fr='"&lavarepurer&"'"
'response.write lk
set restr = conn.execute(lk)
if not restr.eof then
if lg = "GB" then
trsgoogle = restr("GB")
if isnull(restr("GB")) then
'trsgoogle = "pas fait ("&restr("fr")&" )"
conn.execute("update tbtranslate set probleme = -1 where id="&restr("id"))
trsgoogle = restr("fr")
end if
else
trsgoogle = lavar66
end if
else
trsgoogle = lavar66
if lavar66 <> "" then
SQL="SELECT * FROM tbtranslate"
Set RS78 = server.createobject("ADODB.Recordset")
RS78.Open "tbtranslate",Conn , 3, 2
RS78.addnew
RS78("FR")=lavarepurer
RS78("url")=Request.ServerVariables("PATH_INFO")
RS78.update
RS78.close
set RS78 = nothing
end if
end if
restr.close
set restr = nothing
end function
function trsRUB(lavar)
lk = "select domaine,domainegb from domaine where domaine='"&lavar&"'"
set restr = conn.execute(lk)
if not restr.eof then
if session("lg") = "GB" then
trsRUB = restr("domaineGB")
if isnull(restr("domaineGB")) then
trsRUB = "pas fait ("&restr("domaine")&" )"
end if
else
trsRUB = lavar
end if
end if
restr.close
set restr = nothing
end function
function idrub(lavar)
lk = "select id from domaine where rewr='"&lavar&"'"
set restr = conn.execute(lk)
if not restr.eof then
idrub = restr("id")
else
idrub = 0
end if
restr.close
set restr = nothing
end function
function domainerub(lavar)
lk = "select domaine from domaine where rewr='"&lavar&"'"
set restr = conn.execute(lk)
if not restr.eof then
domainerub = restr("domaine")
end if
restr.close
set restr = nothing
end function
'Guin¨¦e', 'Guine'
function paystiret(lep)
if lep <> "" then
lep = replace(lep," ","-")
lep = replace(lep,"é","e")
lep = replace(lep,"'","-")
lep = replace(lep,"ô","o")
lep = replace(lep,"è","e")
lep = replace(lep,"î","i")
lep = replace(lep,"(","")
lep = replace(lep,")","")
lep = replace(lep,"¨¦","")
paystiret = lep
end if
end function
function trsRUBgoogle(lg,lavar626)
'response.write lavar&" "
variablem = "select domaine,domainegb from domaine where domaine='"&lavar626&"'"
'response.write variablem
set restr = conn.execute(variablem)
if not restr.eof then
if lg = "GB" then
trsRUBgoogle = restr("domaineGB")
else
trsRUBgoogle = lavar626
end if
else
trsRUBgoogle = lavar626
end if
restr.close
set restr = nothing
end function
function trsRUBgoogleid(lg,lid52)
'response.write lavar&" "
variablem = "select domaine,domainegb from domaine where id="&lid52
'response.write variablem
set restr = conn.execute(variablem)
if not restr.eof then
if lg = "GB" then
trsRUBgoogleid = restr("domaineGB")
else
trsRUBgoogleid = restr("domaine")
end if
else
trsRUBgoogleid = ""
end if
restr.close
set restr = nothing
end function
function trspays(lavar)
lavar=replace(lavar,"'", "\'")
lk = "select fr,gb from pays where fr='"&lavar&"'"
set restr = conn.execute(lk)
if not restr.eof then
if session("lg") = "GB" then
trspays = restr("gb")
if isnull(restr("gb")) then
trspays = "pas fait ("&restr("fr")&" )"
end if
else
trspays = lavar
end if
end if
restr.close
set restr = nothing
end function
function trspays_inv(lavar)
lk = "select fr as fr,gb from pays where gb='"&lavar&"'"
set restr = conn.execute(lk)
if not restr.eof then
if session("lg") = "GB" then
trspays_inv = replace(restr("fr"),"'"," ")
else
trspays_inv = replace(restr("fr"),"'"," ")
end if
end if
restr.close
set restr = nothing
end function
function trspaysgoogle(lg, lavar66)
trspaysgoogle = lavar66
' Vérifier si lavar66 est null ou vide
if isNull(lavar66) or lavar66 = "" then
lavar66 = ""
else
' Sécuriser la variable en remplaçant les apostrophes par deux apostrophes
lavar66 = replace(lavar66, "'", "''")
lavar66 = replace(lavar66, "é", "e")
end if
' Construire la requête SQL de manière sécurisée
lklllll = "select convert(fr using utf8mb4) as fr, convert(gb using utf8mb4) as gb from pays where fr='" & lavar66 & "'"
set restr = conn.execute(lklllll)
if not restr.eof then
if lg = "GB" then
trspaysgoogle = restr("gb")
if isnull(restr("gb")) then
trspaysgoogle = "pas fait (" & restr("fr") & " )"
end if
else
trspaysgoogle = cleanworddeclarer(lavar66)
end if
end if
restr.close
set restr = nothing
end function
function trspaysgoogle23(lg,lavar)
IF lavar <> "" then
trspaysgoogle23 = lavar
lklllll = "select fr,gb from pays where fr='"&lavar&"'"
' 'response.write lklllll
set restr = conn.execute(lklllll)
if not restr.eof then
' '
if lg = "GB" then
trspaysgoogle23 = restr("gb")
' '
if isnull(restr("gb")) then
trspaysgoogle23 = "pas fait ("&restr("fr")&" )"
' '
end if
else
trspaysgoogle23 = cleanworddeclarer(lavar)
end if
' '
' '
end if
restr.close
set restr = nothing
end if
end function
function trspaysgooglenew(lg,lavar)
IF lavar <> "" then
lavar=replace(lavar,"'", "\'")
lavar=replace(lavar,"\\", "\")
lavar=replace(lavar,"\'", " ")
trspaysgooglenew = lavar
lklllll = "select fr,gb from pays where fr='"&lavar&"'"
set restr = conn.execute(lklllll)
if not restr.eof then
'
if lg = "GB" then
trspaysgooglenew = restr("gb")
'
if isnull(restr("gb")) then
trspaysgooglenew = "pas fait ("&restr("fr")&" )"
'
end if
else
trspaysgooglenew = cleanworddeclarer(lavar)
end if
'
'
end if
restr.close
set restr = nothing
end if
end function
Function FrenchDate(maDate)
jdate = Day(maDate)
mdate = Month(maDate)
if len(jdate) = 1 then jdate ="0"&jdate end if
if len(mdate) = 1 then mdate ="0"&mdate end if
maChaine = jdate & "/" & mdate & "/" & Year(maDate)
FrenchDate = maChaine
End Function
function changedate(tdate)
if tdate <> "" then
changedate = year(tdate)&"-"&month(tdate)&"-"&day(tdate)
end if
end function
function affichagedate(thedateannonce)
affichagedate = (thedateannonce)
thehouraffaire = hour(thedateannonce)
theminuteaffaire = minute(thedateannonce)
if len(thehouraffaire) = 1 then thehouraffaire = "0"&thehouraffaire end if
if len(theminuteaffaire) = 1 then theminuteaffaire = "0"&theminuteaffaire end if
if cstr(formatdatetime(thedateannonce,2)) = cstr(date()) then
affichagedate = trs(" Aujourd'hui ")
end if
if cstr(formatdatetime(thedateannonce,2)) = cstr(date()-1) then
affichagedate = trs(" Hier ")
end if
end function
Function Societemtscles(societe)
vartp1 = "select mtscles from societe where id = "&societe
'set varrode = connmagasin.execute(vartp1)
'if varrode.eof then
Societemtscles = ""
'else
' Societemtscles = varrode("mtscles")
'end if
'varrode.close
'set varrode = nothing
End Function
Function Societeprefix(societe)
vartp1 = "select prefixtel from societe where id = "&societe
'if societe <> "" then
'response.write vartp1
set varrode = conn.execute(vartp1)
if varrode.eof then
Societeprefix = ""
else
if varrode("prefixtel") <> "" then
Societeprefix = "+"&varrode("prefixtel")
ELSE
Societeprefix = ""
end if
end if
varrode.close
set varrode = nothing
'end if
End Function
Function Societealerte(societe)
vartp1 = "select mtscles from alerte where societe = "&societe
set varrode2 = conn.execute(vartp1)
if varrode2.eof then
Societealerte = ""
else
Societealerte = varrode2("mtscles")
end if
varrode2.close
set varrode2 = nothing
End Function
Function Societeescroc(societet)
vartp1 = "select 'ESCROC' as aff from societe where id = "&societet
'set varrode = connmagasin.execute(vartp1)
'if varrode.eof then
Societeescroc = ""
'else
' Societeescroc = varrode("aff")
'end if
'varrode.close
'set varrode = nothing
End Function
Function estescroc(societet)
if societet <> "" then
vartp1 = "select ESCROC from societe where id = "&societet
set varde = conn.execute(vartp1)
if varde.eof then
estescroc = ""
else
estescroc = varde("ESCROC")
end if
varde.close
set varde = nothing
end if
End Function
Function EuropeTVA(societet)
vartp1 = "select EUROPESANSTVA from societe where id = "&societet
set varrode2 = conn.execute(vartp1)
if varrode2("EUROPESANSTVA") = 0 then
EuropeTVA = false
end if
if varrode2("EUROPESANSTVA") = 1 then
EuropeTVA = true
end if
varrode2.close
set varrode2 = nothing
End Function
Function estcreditagricole(societet)
'if societet <> "" then
' vartp1 = "select cboperateur from societe where cboperateur = 'CA' and id="&societet
' set varde = conn.execute(vartp1)
' if varde.eof then
estcreditagricole = ""
' else
' estcreditagricole = "oui"
' end if
' varde.close
' set varde = nothing
'end if
End Function
Function EstAlerter(societet)
vartp1 = "select MTSCLES from alerte where societe = "&societet
set varrode2 = conn.execute(vartp1)
if varrode2("MTSCLES") = "" then
EstAlerter = false
else
EstAlerter = true
end if
varrode2.close
set varrode2 = nothing
End Function
Function societeemailid(LEMAIL)
if LEMAIL <> "" then LEMAIL = replace(LEMAIL,"'","") end if
vartp1 = "select id from societe where email = '"&LEMAIL&"' or login = '"&LEMAIL&"'"
set varrode2 = conn.execute(vartp1)
if not varrode2.eof then
societeemailid = varrode2("id")
else
societeemailid = 0
end if
varrode2.close
set varrode2 = nothing
End Function
Function estdesactiver(LEMAIL)
vartp1 = "select desactiver from societe where email = '"&LEMAIL&"'"
set varrode2 = conn.execute(vartp1)
if not varrode2.eof then
if varrode2("desactiver") = 0 then
estdesactiver = false
end if
if varrode2("desactiver") = -1 then
estdesactiver = true
end if
else
estdesactiver = false
end if
varrode2.close
set varrode2 = nothing
End Function
Function donneesfaites(iddd)
vartp1 = "select verifier from info_entreprise where idsociete = "&iddd
set varrode2 = conn.execute(vartp1)
if not varrode2.eof then
donneesfaites = true
else
donneesfaites = false
end if
varrode2.close
set varrode2 = nothing
End Function
Function donneesfaitesalerte(iddd)
vartp1 = "select Liste_client from info_entreprise where idsociete = "&iddd
set varrode2 = conn.execute(vartp1)
if not varrode2.eof then
if varrode2("Liste_client") <> "" then
donneesfaitesalerte = true
else
donneesfaitesalerte = false
end if
else
donneesfaitesalerte = false
end if
varrode2.close
set varrode2 = nothing
End Function
Function societe_magasin(nb)
if nb <> "" then
'set ll = connmagasin.execute("select societe from societe where id="&nb)
'if not ll.eof then
'societe_magasin = ll("societe")
'else
societe_magasin="inconu"
'end if
'll.close
'set ll = nothing
end if
End Function
Function rewriteshowroom(id,ff)
EstLocal = false
if EstLocal = true then
rewriteshowroom = "detailproneuf.asp?id="&id
else
rewriteshowroom = "/magasin/"&mid(replace(replace(cleanworddeclarer(lcase(ff))," ","-"),"-_-","_"),1,30)&"_sh"&id&".html"
end if
end function
function domainemagasin(larubb,io)
domainemagasin = "/magasin/"&lcase(cleanworddeclarer(larubb))&"_mg"&io&".html"
end function
FUNCTION publaaaaa(T001type,T001rub)
'Set PubConn=Server.CreateObject("ADODB.Connection")
'PubConn.Open "DSN=regie"
'PubSQL= "Select * From Bannieres where afficher=1 and Affichages < MaxAffichages "
''PubSQL = PubSQL & "AND Clicks < MaxClicks "
''PubSQL = PubSQL & "AND to_days(DateFin) > TO_DAYS(NOW()) -1"
'if T001type <> "" then
'PubSQL = PubSQL & "AND bannieres.type ='"&T001type&"'"
'end if
'if T001rub <> "" then
'PubSQL = PubSQL & "AND ( bannieres.rub like '%"&T001rub&"%' or bannieres.rub ='')"
'else
'PubSQL = PubSQL & "AND ( bannieres.rub ='')"
'end if
'set rspub=Server.CreateObject("ADODB.Recordset")
'rspub.cursorlocation = 3
'rspub.cachesize = 50
'rspub.open PubSQL,"DSN=regie"
'Total1 = rspub.recordcount
'if Total1 > 0 then
'Randomize
'choice = Int((Total1 * Rnd)+ 0)
'rspub.move(choice)
'ID = rspub("ID")
'if rspub("RawCode") <> "" Then
'process = 2
'rawcode = rspub("RawCode")
'Else
'mimage = rspub("Image")
'process = 1
'End If
'affichages = rspub("Affichages")
'rspub.close
'set rspub=nothing
'sqlu = "UPDATE Bannieres SET Affichages='"
'sqlu = sqlu & affichages +1 & "'"
'sqlu = sqlu & " WHERE ID=" & ID
'PubConn.execute(sqlu)
'if rawcode <> "" then
'response.write ""& rawcode&""
'else
' response.write ""
'end if
'end if
' PubConn.Close
'set PubConn=nothing
end FUNCTION
FUNCTION publaa(T001type,T001type2,T001type3)
end FUNCTION
FUNCTION publaffiche(T001type)
end FUNCTION
FUNCTION publafficheprecis(thenumber)
Set PubConn=Server.CreateObject("ADODB.Connection")
PubConn.Open "DSN=regie"
PubSQL= "Select * From Bannieres where afficher=1 and Affichages < MaxAffichages "
'PubSQL = PubSQL & "AND Clicks < MaxClicks "
'PubSQL = PubSQL & "AND to_days(DateFin) > TO_DAYS(NOW()) -1"
if thenumber <> "" then
PubSQL = PubSQL & "AND bannieres.id ='"&thenumber&"'"
end if
'if T001rub <> "" then
'PubSQL = PubSQL & "AND bannieres.rub ="&T001rub
'end if
set rspub=Server.CreateObject("ADODB.Recordset")
rspub.cursorlocation = 3
rspub.cachesize = 50
rspub.open PubSQL,"DSN=regie"
Total1 = rspub.recordcount
if Total1 > 0 then
Randomize
choice = Int((Total1 * Rnd)+ 0)
rspub.move(choice)
ID = rspub("ID")
if rspub("RawCode") <> "" Then
process = 2
rawcode = rspub("RawCode")
Else
mimage = rspub("Image")
process = 1
End If
affichages = rspub("Affichages")
rspub.close
set rspub=nothing
sqlu = "UPDATE Bannieres SET Affichages='"
sqlu = sqlu & affichages +1 & "'"
sqlu = sqlu & " WHERE ID=" & ID
PubConn.execute(sqlu)
if rawcode <> "" then
response.write ""& rawcode&""
else
if session("societe") <> "" then
response.write ""
else
response.write ""
end if
end if
end if
PubConn.Close
set PubConn=nothing
end FUNCTION
FUNCTION publafficherub(T001type,larubatt)
Set PubConn=Server.CreateObject("ADODB.Connection")
PubConn.Open "DSN=regie"
PubSQL= "Select * From Bannieres where afficher=1 and Affichages < MaxAffichages "
'PubSQL = PubSQL & "AND Clicks < MaxClicks "
'PubSQL = PubSQL & "AND to_days(DateFin) > TO_DAYS(NOW()) -1"
if T001type <> "" then
PubSQL = PubSQL & "AND bannieres.type ='"&T001type&"'"
end if
if larubatt <> "" then
PubSQL = PubSQL & "AND ( bannieres.rub = '"&larubatt&"' or bannieres.rub ='')"
else
PubSQL = PubSQL & "AND bannieres.rub =''"
end if
set rspub=Server.CreateObject("ADODB.Recordset")
rspub.cursorlocation = 3
rspub.cachesize = 50
rspub.open PubSQL,"DSN=regie"
Total1 = rspub.recordcount
if Total1 > 0 then
Randomize
choice = Int((Total1 * Rnd)+ 0)
rspub.move(choice)
ID = rspub("ID")
if rspub("RawCode") <> "" Then
process = 2
rawcode = rspub("RawCode")
Else
mimage = rspub("Image")
process = 1
End If
affichages = rspub("Affichages")
rspub.close
set rspub=nothing
sqlu = "UPDATE Bannieres SET Affichages='"
sqlu = sqlu & affichages +1 & "'"
sqlu = sqlu & " WHERE ID=" & ID
PubConn.execute(sqlu)
if rawcode <> "" then
response.write ""& rawcode&""
else
if session("societe") <> "" then
response.write ""
else
response.write ""
end if
end if
end if
PubConn.Close
set PubConn=nothing
end FUNCTION
function esteurope(lepays)
esteurope = 0
if lcase(lepays) = lcase("Allemagne") then esteurope = 1 end if
if lcase(lepays) = lcase("Autriche") then esteurope = 1 end if
if lcase(lepays) = lcase("Belgique") then esteurope = 1 end if
if lcase(lepays) = lcase("Bulgarie") then esteurope = 1 end if
if lcase(lepays) = lcase("Chypre") then esteurope = 1 end if
if lcase(lepays) = lcase("Danemark") then esteurope = 1 end if
if lcase(lepays) = lcase("Espagne") then esteurope = 1 end if
if lcase(lepays) = lcase("Estonie") then esteurope = 1 end if
if lcase(lepays) = lcase("Finlande") then esteurope = 1 end if
if lcase(lepays) = lcase("France") then esteurope = 1 end if
if lcase(lepays) = lcase("Grèce") then esteurope = 1 end if
if lcase(lepays) = lcase("Grece") then esteurope = 1 end if
if lcase(lepays) = lcase("Hongrie") then esteurope = 1 end if
if lcase(lepays) = lcase("Irlande") then esteurope = 1 end if
if lcase(lepays) = lcase("Italie") then esteurope = 1 end if
if lcase(lepays) = lcase("Lettonie") then esteurope = 1 end if
if lcase(lepays) = lcase("Lituanie") then esteurope = 1 end if
if lcase(lepays) = lcase("Luxembourg") then esteurope = 1 end if
if lcase(lepays) = lcase("Malte") then esteurope = 1 end if
if lcase(lepays) = lcase("Pays-Bas") then esteurope = 1 end if
if lcase(lepays) = lcase("Pologne") then esteurope = 1 end if
if lcase(lepays) = lcase("Portugal") then esteurope = 1 end if
if lcase(lepays) = lcase("République tchèque") then esteurope = 1 end if
if lcase(lepays) = lcase("Republique tcheque") then esteurope = 1 end if
if lcase(lepays) = lcase("Roumanie") then esteurope = 1 end if
'if lcase(lepays) = lcase("Royaume-Uni") then esteurope = 1 end if
if lcase(lepays) = lcase("Slovaquie") then esteurope = 1 end if
if lcase(lepays) = lcase("Slovénie") then esteurope = 1 end if
if lcase(lepays) = lcase("Slovenie") then esteurope = 1 end if
if lcase(lepays) = lcase("Suède") then esteurope = 1 end if
if lcase(lepays) = lcase("Suede") then esteurope = 1 end if
if lcase(lepays) = lcase("Germany") then esteurope = 1 end if
if lcase(lepays) = lcase("Austria") then esteurope = 1 end if
if lcase(lepays) = lcase("Belgium") then esteurope = 1 end if
if lcase(lepays) = lcase("Bulgaria") then esteurope = 1 end if
if lcase(lepays) = lcase("Cyprus") then esteurope = 1 end if
if lcase(lepays) = lcase("Denmark") then esteurope = 1 end if
if lcase(lepays) = lcase("Spain") then esteurope = 1 end if
if lcase(lepays) = lcase("Estonia") then esteurope = 1 end if
if lcase(lepays) = lcase("Finland") then esteurope = 1 end if
if lcase(lepays) = lcase("France") then esteurope = 1 end if
if lcase(lepays) = lcase("Greece") then esteurope = 1 end if
if lcase(lepays) = lcase("Hungary") then esteurope = 1 end if
if lcase(lepays) = lcase("Irland") then esteurope = 1 end if
if lcase(lepays) = lcase("Italy") then esteurope = 1 end if
if lcase(lepays) = lcase("Latvia") then esteurope = 1 end if
if lcase(lepays) = lcase("Lithuania") then esteurope = 1 end if
if lcase(lepays) = lcase("Luxembourg") then esteurope = 1 end if
if lcase(lepays) = lcase("Malta") then esteurope = 1 end if
if lcase(lepays) = lcase("Netherlands") then esteurope = 1 end if
if lcase(lepays) = lcase("Poland") then esteurope = 1 end if
if lcase(lepays) = lcase("Portugal") then esteurope = 1 end if
if lcase(lepays) = lcase("Czech Republic") then esteurope = 1 end if
if lcase(lepays) = lcase("Romania") then esteurope = 1 end if
if lcase(lepays) = lcase("United Kingdom") then esteurope = 1 end if
if lcase(lepays) = lcase("Slovakia") then esteurope = 1 end if
if lcase(lepays) = lcase("Slovenia") then esteurope = 1 end if
if lcase(lepays) = lcase("Sweden") then esteurope = 1 end if
end function
function rechercheoption(MARE)
DD = "select NAME from options where annonce = "&MARE&" and TO_DAYS(DATEFIN) >= TO_DAYS(NOW())"
set DDES = conn.execute(DD)
if not DDES.eof then
rechercheoption = DDES("NAME")
end if
DDES.close
set DDES = nothing
end function
function optionplus(MARE)
DD = "select plus from options where annonce = "&MARE&" and TO_DAYS(DATEFIN) >= TO_DAYS(NOW())"
set DDES = conn.execute(DD)
if not DDES.eof then
optionplus = DDES("plus")
else
optionplus = 44
end if
DDES.close
set DDES = nothing
end function
function limitcontact(lesoc)
if lesoc <> "" then
if lesoc <> 506000 then
p = "select count(id) as tot from conso_unite where societe = "&lesoc&" and to_days(date) = TO_DAYS(NOW()) and service like '%contact%'"
set ml = conn.execute(p)
if not ml.eof then
result = cstr(ml("tot"))
if result > 10 then
limitcontact = true
else
limitcontact = false
end if
else
limitcontact = false
end if
ml.close
set ml = nothing
end if
end if
end function
function countcontact(lesoc)
if lesoc <> "" then
p = "select count(id) as tot from conso_unite where societe = "&lesoc
set ml = conn.execute(p)
if not ml.eof then
countcontact = cstr(ml("tot"))
else
countcontact = 0
end if
ml.close
set ml = nothing
end if
end function
function VERIFNBmessagerie(LASOCANNONCE,LANONCE,LECONNECTE)
'IF LECONNECTE <> LASOCANNONCE then
' pom = "select count(id) as tot from messagerie where messagerie.affaire = "&LANONCE&" and EMETEUR = "&LECONNECTE&" and CONCERNE = "& LECONNECTE
' set leres = conn.execute(pom)
' VERIFNBmessagerie = cstr(leres("TOT"))
' leres.close
' set leres = nothing
' if VERIFNBmessagerie > 4 then VERIFNBmessagerie = 5 end if
'else
VERIFNBmessagerie = 0
'end if
end function
function countskype(lid)
pom = "select count(id) as tot from SKYPE where conf="&lid
set leres = conn.execute(pom)
countskype = cstr(leres("TOT"))
if countskype < 1 then countskype = 0 end if
leres.close
set leres = nothing
end function
function countpays()
jh ="select countpays as tt1 from parametre where id=1"
set ju = conn.execute(jh)
if not ju.eof then
countpays = ju("tt1")
else
countpays = ""
end if
ju.close
set ju = nothing
end function
function numbersocietevalider()
if minute(time()) = 8 then
pom = "select count(id) as tot from societe where supprimer is false and validerespaceagro is true and desactiver=0"
set leres = conn.execute(pom)
conn.execute("update parametre set numbersocietevalider="&leres("tot")&" where id=1")
leres.close
set leres = nothing
end if
jh ="select numbersocietevalider as tt1 from parametre where id=1"
set ju = conn.execute(jh)
if not ju.eof then
numbersocietevalider = ju("tt1")
else
numbersocietevalider = ""
end if
ju.close
set ju = nothing
end function
function numbersociete()
if minute(time()) = 8 then
pom = "select max(id) as tot from societe "
set leres = conn.execute(pom)
conn.execute("update parametre set numbersociete="&leres("tot")&" where id=1")
leres.close
set leres = nothing
end if
jh ="select numbersociete as tt1 from parametre where id=1"
set ju = conn.execute(jh)
if not ju.eof then
numbersociete = ju("tt1")
else
numbersociete = ""
end if
ju.close
set ju = nothing
end function
function cleanform(varvar)
if varvar <> "" then
varvar=replace(varvar,"delete","")
varvar=replace(varvar,"insert","")
varvar=replace(varvar,"select","")
varvar=replace(varvar,"drop","")
varvar=replace(varvar,"update","")
varvar=replace(varvar,"convert","")
varvar=replace(varvar,"information_schema","")
varvar=replace(varvar,"shema_name","")
end if
cleanform = varvar
end function
Function Societevaliderespaceagro(societe)
vartp1 = "select id from societe where id = "&societe&" and validerespaceagro = -1"
set varrode = conn.execute(vartp1)
if varrode.eof then
Societevaliderespaceagro = 0
else
Societevaliderespaceagro = -1
end if
varrode.close
set varrode = nothing
End Function
function cleanwordschema(U59)
if U59 <> "" then
U59 = replace(U59,";","& ;")
U59 = replace(U59,", "," ")
U59 = replace(U59,"/"," ")
U59 = replace(U59,": "," ")
U59 = replace(U59,"}"," ")
U59 = replace(U59,"{"," ")
U59 = replace(U59,"'"," ")
U59 = replace(U59,vbcrlf," ")
U59 = replace(U59," "," ")
U59 = replace(U59,chr(34)," ")
end if
cleanwordschema = U59
end function
'Thispage = Request.ServerVariables("script_name")'
function AUDIENCE(LAPAGE)
pom = "select * from audience where to_days(date) = TO_DAYS(NOW()) and PAGES = '"&LAPAGE&"'"
set leres = conn.execute(pom)
if leres.eof then
conn.execute("insert into audience (PAGES,CALCUL) values ('" & LAPAGE & "',0)")
else
LETOT = leres("CALCUL")
LETOT = letot + 1
conn.execute("update audience set CALCUL = "&LETOT&" where id = "&leres("id"))
end if
leres.close
set leres = nothing
end function
function lurl(aVar)
if avar <> "" then
aVar=replace(aVar," ","-")
aVar=replace(aVar,"°","")
aVar=replace(aVar,"ô","o")
aVar=replace(aVar,"*","-")
aVar=replace(aVar,"%","")
aVar=replace(aVar,"(","-")
aVar=replace(aVar,")","-")
aVar=replace(aVar,"%","-")
aVar=replace(aVar,"'","-")
aVar=replace(aVar,"°","-")
aVar=replace(aVar,"é","e")
aVar=replace(aVar,"%","-")
aVar=replace(aVar,"+","-")
aVar=replace(aVar,"/","-")
aVar=replace(aVar,"à","a")
aVar=replace(aVar,"ê","e")
aVar=replace(aVar,"ç","c")
aVar=replace(aVar,"È","e")
aVar = replace(aVar,"&","-")
aVar = replace(aVar,"/","-")
aVar = replace(aVar,"#","-")
aVar = replace(aVar,";","-")
aVar = replace(aVar,",","_")
aVar = replace(aVar,"°","")
aVar = replace(aVar,"é","e")
aVar = replace(aVar,"²","-")
aVar = replace(aVar,"î","i")
aVar = replace(aVar,"^","-")
aVar = replace(aVar,"ô","o")
aVar = replace(aVar,"<","-")
aVar = replace(aVar,">","-")
aVar = replace(aVar,"ï","i")
aVar = replace(aVar,"…","-")
aVar = replace(aVar,"*","-")
aVar = replace(aVar,"/","-")
aVar = replace(aVar,".","-")
aVar = replace(aVar,"\","-")
aVar = replace(aVar,"ñ","n")
aVar = replace(aVar,"É","E")
aVar = replace(aVar,"À","A")
aVar = replace(aVar,"Ô","O")
aVar = replace(aVar,"Î","I")
aVar = replace(aVar,"Ï","I")
aVar = replace(aVar,"ê","e")
aVar = replace(aVar,"è","e")
aVar = replace(aVar,"à","a")
aVar = replace(aVar,"â","a")
aVar = replace(aVar,"?","-")
aVar = replace(aVar,"!","-")
aVar = replace(aVar,"(","-")
aVar = replace(aVar,")","-")
aVar = replace(aVar,"'","-")
aVar = replace(aVar,chr(34),"-")
aVar = replace(aVar,"+","_")
aVar = replace(aVar,vblf,"-")
aVar = replace(aVar,vbcr,"-")
aVar = replace(aVar,vbcrlf,"-")
aVar = replace(aVar,chr(13),"-")
aVar = replace(aVar,chr(10),"-")
aVar = replace(aVar,chr(58),"-")
aVar = replace(aVar,"=","-")
aVar = replace(aVar," ","-")
aVar = replace(aVar,"_","-")
aVar = replace(aVar,"--","-")
aVar = replace(aVar,"°","-")
aVar=replace(aVar,"--","-")
aVar=replace(aVar,"--","-")
aVar=replace(aVar,"--","-")
aVar=mid(aVar,1,50)
if right(aVar,1) = "-" then
longg =len(aVar)
aVar = mid(aVar,1,longg-1)
end if
lurl=lcase(aVar)
end if
end function
function lurltitle(aVar)
if avar <> "" then
IF len(avar) > 2 then
aVar = replace(aVar,chr(34)," ")
aVar = replace(aVar,vblf,"-")
aVar = replace(aVar,vbcr,"-")
aVar = replace(aVar,",",", ")
aVar = replace(aVar,vbcrlf,"-")
aVar = replace(aVar,chr(13),"-")
aVar = replace(aVar,chr(10),"-")
aVar = replace(aVar,chr(58),"-")
lurltitle=lcase(aVar)
end if
end if
end function
function pub(StrTaille)
' Dim l, s, i
'set connpub = CreateObject("ADODB.Connection")
'Connpub.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=D:\www\espaceagro.com\databases\regiepublicite.mdb;"
' fff = "select count(id) as tot from PUBLICITE where taille='"&StrTaille&"'"
' set yy = connpub.execute(fff)
' l = cstr(yy("tot"))
' yy.close
' set YY = nothing
' lu = 0
' randomize
' pub1 = int(rnd * l)+1
' fff = "select tag from PUBLICITE where taille='"&StrTaille&"'"
' set yy = connpub.execute(fff)
' DO UNTIL YY.eof
' lu = lu+1
'
' if (lu) = (pub1) then pub = yy("TAG")end if
' YY.movenext
' loop
' yy.close
' set YY = nothing
'connpub.close
'set connpub = nothing
end function
Function region(nb)
if nb <> "" then
set ll = conn.execute("select region from region where id="&nb)
if not ll.eof then
if ll("region") <> "" then
region = ll("region")
else
region = ""
end if
end if
ll.close
set ll = nothing
end if
End Function
Function nbannoncesocietechamp(idsoc)
set ll = conn.execute("select nbannonce from societe where id="&idsoc)
if not ll.eof then
if ll("nbannonce") <> "" then
nbannoncesocietechamp = ll("nbannonce")
else
nbannoncesocietechamp = ""
end if
end if
ll.close
set ll = nothing
End Function
Function rewriteaffaire(id,ff)
'response.write id
EstLocal = false
if EstLocal = true then
rewriteaffaire = "voir.asp?id="&id
else
'if id > 376888 and id < 381640 then
'rewriteaffaire = mid(replace(replace(replace(cleanworddeclarer(lcase(ff))," ","-"),"-_-","-"),"--","-"),1,30)&"-wx"&id&".html"
'else
rewriteaffaire = mid(replace(replace(cleanworddeclarer(lcase(ff))," ","-"),"-_-","_"),1,30)&"_i"&id&".html"
'rewriteaffaire=ff&id
'rewriteaffaire = lcase(ff)&"_i"&id22&".html"
'end if
end if
end function
Function rewritedomaine(id)
if isnumeric(id) then
EstLocal = false
hu = "select rewr from domaine where id="&id
SET LERES = conn.execute(hu)
if not LERES.eof then
vardomaine = LERES("rewr")
end if
LERES.close
set LERES = nothing
if EstLocal = true then
rewritedomaine = "/default.asp?dm="&id
else
rewritedomaine = vardomaine&"/"&vardomaine&".htm"
end if
end if
End Function
Function rewritedomainegoogle(lg,id)
EstLocal = false
if lg="GB" then
lechamp = "rewrgb"
LAJOUT = "english/"
else
lechamp = "rewr"
LAJOUT = ""
end if
if isnumeric(id) then
hu = "select "&lechamp&" as rew2 from domaine where id="&id
SET LERES = conn.execute(hu)
if not LERES.eof then
vardomaine = LERES("rew2")
end if
LERES.close
set LERES = nothing
if EstLocal = true then
rewritedomainegoogle = "/default.asp?dm="&id
else
'rewritedomainegoogle = LAJOUT&vardomaine&"/"&vardomaine&".htm"
rewritedomainegoogle = LAJOUT&vardomaine&"/"
end if
else
rewritedomainegoogle = ""
end if
End Function
Function rewritedomainegooglessext(lg,id)
if isnumeric(id) then
EstLocal = false
if lg="GB" then
lechamp = "rewrgb"
LAJOUT = "english/"
else
lechamp = "rewr"
LAJOUT = ""
end if
hu = "select "&lechamp&" as rew2 from domaine where id="&id
SET LERES = conn.execute(hu)
if not LERES.eof then
vardomaine = LERES("rew2")
end if
LERES.close
set LERES = nothing
if EstLocal = true then
rewritedomainegooglessext = "/default.asp?dm="&id
else
rewritedomainegooglessext = LAJOUT&vardomaine&""
end if
end if
End Function
Function rewritedomainesanshtml(id)
EstLocal = false
select case id
case 1
vardomaine="lait-produits-laitiers"
case 2
vardomaine="poissons"
case 3
vardomaine="fruits-legumes"
case 4
vardomaine="feculents"
case 5
vardomaine="produits-sucres"
case 6
vardomaine="matieres-grasses"
case 7
vardomaine="boissons"
case 8
vardomaine="epices-aromates"
case 9
vardomaine="production-agricole"
case 10
vardomaine="materiels-machines"
case 11
vardomaine="hygiene-entretien"
case 12
vardomaine="aliments-pour-animaux"
case 13
vardomaine="horticulture-plante-biocarburant"
case 14
vardomaine="autres"
case 15
vardomaine="viandes-oeufs"
case 16
vardomaine="conseil-et-formation"
case 17
vardomaine="fruit-sec-et-graines-grillees"
case 19
vardomaine="publicite-nouveaux-produits-agroalimentaire"
case 20
vardomaine="produits-bio"
case 21
vardomaine="cafe-cacao-the"
case 22
vardomaine="produit-chimique-additif-engrais"
case 23
vardomaine="huiles"
case 24
vardomaine="cereales"
case 25
vardomaine="bois-fibre-focile"
case 26
vardomaine="metaux"
case 27
vardomaine="conditionnement"
case 28
vardomaine="boisson-alcoolisee"
case 29
vardomaine="jus-concentre"
case 30
vardomaine="animaux-vivants"
case 31
vardomaine="industrie-exploitation"
case 32
vardomaine="emploi-representation"
case 33
vardomaine="champignon-levure"
case 34
vardomaine="patisserie"
case 35
vardomaine="conserve-semi-conserve"
case 37
vardomaine="vins"
case 38
vardomaine="petrole-gaz"
case 39
vardomaine="pierre-roche"
case 40
vardomaine="ciment"
case 41
vardomaine="investissement-capitaux"
case 42
vardomaine="coquillage-crustace"
case 43
vardomaine="transport-transit-logistique"
case 44
vardomaine="equipement-maritime"
case 45
vardomaine="mine-terrain-concession"
case 46
vardomaine="semence-graine-plant"
case 47
vardomaine="energie-renouvelable"
case 48
vardomaine="matiere-vegetale"
end select
rewritedomainesanshtml = vardomaine
End Function
function rewritetrade(ivar,txtvar)
'rewritearticle = "detail.asp?id="&ivar
rewritetrade = mid(lurl(ivar),1,20)&"-i-trade"&txtvar&".html"
end function
Function rewriteannuaire(id)
EstLocal = false
select case id
case 1
vardomaine="lait-produits-laitiers"
case 2
vardomaine="poissons"
case 3
vardomaine="fruits-legumes"
case 4
vardomaine="feculents"
case 5
vardomaine="produits-sucres"
case 6
vardomaine="matieres-grasses"
case 7
vardomaine="boissons"
case 8
vardomaine="epices-aromates"
case 9
vardomaine="production-agricole"
case 10
vardomaine="materiels-machines"
case 11
vardomaine="hygiene-entretien"
case 12
vardomaine="aliments-pour-animaux"
case 13
vardomaine="horticulture-plante-biocarburant"
case 14
vardomaine="autres"
case 15
vardomaine="viandes-oeufs"
case 16
vardomaine="conseil-et-formation"
case 17
vardomaine="fruit-sec-et-graines-grillees"
case 19
vardomaine="publicite-nouveaux-produits-agroalimentaire"
case 20
vardomaine="produits-bio"
case 21
vardomaine="cafe-cacao-the"
case 22
vardomaine="produit-chimique-additif-engrais"
case 23
vardomaine="huiles"
case 24
vardomaine="cereales"
case 25
vardomaine="bois-fibre-focile"
case 26
vardomaine="metaux"
case 27
vardomaine="conditionnement"
case 28
vardomaine="boisson-alcoolisee"
case 29
vardomaine="jus-concentre"
case 30
vardomaine="animaux-vivants"
case 31
vardomaine="industrie-exploitation"
case 32
vardomaine="emploi-representation"
case 33
vardomaine="champignon-levure"
case 34
vardomaine="patisserie"
case 35
vardomaine="conserve-semi-conserve"
case 37
vardomaine="vins"
case 38
vardomaine="petrole-gaz"
case 39
vardomaine="pierre-roche"
case 40
vardomaine="ciment"
case 41
vardomaine="investissement-capitaux"
case 42
vardomaine="coquillage-crustace"
case 43
vardomaine="transport-transit-logistique"
case 44
vardomaine="equipement-maritime"
case 45
vardomaine="minerai-terrain-concession"
case 46
vardomaine="semence-graine-plant"
case 47
vardomaine="energie-renouvelable"
case 48
vardomaine="matiere-vegetale"
end select
if EstLocal = true then
rewriteannuaire = "/default.asp?dm="&id
else
rewriteannuaire = "/"&vardomaine&""
end if
End Function
Function FctTarifs(nb)
select case nb
case 0
FctTarifs = 30
case 1
FctTarifs = 40
case 2
FctTarifs = 80
case 3
FctTarifs = 100
case 4
FctTarifs = 180
case 5
FctTarifs = 270
case 6
FctTarifs = 350
end select
End Function
Function Newmessage(societe)
pp = "select id from messagerie where concerne = "&societe&" and valider = -1 and desactiver=0 and supprimer = 0 and escroc = 0 and (TO_DAYS(messagerie.date) > TO_DAYS(NOW())-140) and destinataire = "&societe&" and lu = 0"
set pp2 = conn.execute(pp)
if not pp2.eof then
Newmessage = true
'response.write pp2("id")
else
Newmessage = false
end if
pp2.close
set pp2=nothing
end function
function nbentreprise(lenum)
up = "select entreprise from info_entreprise where idsociete="&lenum
set kk = conn.execute(up)
if not kk.eof then
nbentreprise = kk("entreprise")
else
nbentreprise = ""
end if
kk.close
set kk = nothing
end function
function cleanworddeclarer(U56)
Set regEx = New RegExp
if U56 <> "" then
regEx.IgnoreCase = True : regEx.Global = True
regEx.Pattern = "[.;:""'_+-,’]" : U56 = regEx.REPLACE(U56,"_")
U56 = replace(U56," ","-")
U56 = replace(U56,"#","")
U56 = replace(U56,"%","")
U56 = replace(U56,"/","-")
U56 = replace(U56,"(","_")
U56 = replace(U56,"<","")
U56 = replace(U56,">","")
U56 = replace(U56,"$","")
U56 = replace(U56,")","_")
U56 = replace(U56,","," ")
U56 = replace(U56,"\'"," ")
U56 = replace(U56,"&","-")
U56 = replace(U56,"--","-")
U56 = replace(U56,"]","")
U56 = replace(U56,"[","")
U56 = replace(U56,"ù","")
U56 = replace(U56,"œ","oe")
U56 = replace(U56,"!","")
U56 = replace(U56,"?","")
U56 = trim(U56)
regEx.Pattern = "[aàáâäåÄŪÁÂÀãÃ]" : U56 = regEx.REPLACE(U56,"a")
regEx.Pattern = "[eéèêëÉÊËÈ]" : U56 = regEx.REPLACE(U56,"e")
regEx.Pattern = "[cç¢]" : U56 = regEx.REPLACE(U56,"c")
regEx.Pattern = "[oóòôöôöòÖóðÒÔÕõ]" : U56 = regEx.REPLACE(U56,"o")
regEx.Pattern = "[uúùûüûùÜúÚÛÙ]" : U56 = regEx.REPLACE(U56,"u")
regEx.Pattern = "[iìíîïÌÍÎÏíìîï]" : U56 = regEx.REPLACE(U56,"i")
regEx.Pattern = "[nñÑ]" : U56 = regEx.REPLACE(U56,"n")
regEx.Pattern = "[€Àà¡Áá&¢Â⃣ÃㄤÄä…¥Åå†¦Ææ‡§Ç爨È艩É銪Êê‹«Ë댬ÌìÍ펮Îî¯Ïï°Ðð‘±Ññ’²Òò“³Óó”´Ôô•µÕõ–¶Öö—·×÷˜¸Øø™¹ÙùšºÚú›»Ûûœ¼Üü½Ýýž¾ÞþŸ¿ßÿ]" : U56 = regEx.REPLACE(U56,"")
cleanworddeclarer = U56
if left(cleanworddeclarer,1)="-" then cleanworddeclarer = mid(cleanworddeclarer,2,(len(cleanworddeclarer)-1)) end if
if right(cleanworddeclarer,1)="-" then cleanworddeclarer = mid(cleanworddeclarer,1,(len(cleanworddeclarer)-1)) end if
set regEx = nothing
end if
end function
function netoyobjet(U56)
Set regEx = New RegExp
if U56 <> "" then
regEx.IgnoreCase = True : regEx.Global = True
regEx.Pattern = "[.;:""'_+-,’]" : U56 = regEx.REPLACE(U56,"_")
U56 = replace(U56," ","-")
U56 = replace(U56,"#","")
U56 = replace(U56,"%","")
U56 = replace(U56,"/","-")
U56 = replace(U56,"(","_")
U56 = replace(U56,")","_")
U56 = replace(U56,","," ")
U56 = replace(U56,"\'"," ")
U56 = replace(U56,"&","-")
U56 = replace(U56,"--","-")
U56 = replace(U56,"]","")
U56 = replace(U56,"[","")
U56 = replace(U56,"ù","")
U56 = replace(U56,"œ","oe")
U56 = replace(U56,"!","")
U56 = trim(U56)
regEx.Pattern = "[aàáâäåÄŪÁÂÀãÃ]" : U56 = regEx.REPLACE(U56,"a")
regEx.Pattern = "[eéèêëÉÊËÈ]" : U56 = regEx.REPLACE(U56,"e")
regEx.Pattern = "[cç¢]" : U56 = regEx.REPLACE(U56,"c")
regEx.Pattern = "[oóòôöôöòÖóðÒÔÕõ]" : U56 = regEx.REPLACE(U56,"o")
regEx.Pattern = "[uúùûüûùÜúÚÛÙ]" : U56 = regEx.REPLACE(U56,"u")
regEx.Pattern = "[iìíîïÌÍÎÏíìîï]" : U56 = regEx.REPLACE(U56,"i")
regEx.Pattern = "[nñÑ]" : U56 = regEx.REPLACE(U56,"n")
regEx.Pattern = "[€Àà¡Áá&¢Â⃣ÃㄤÄä…¥Åå†¦Ææ‡§Ç爨È艩É銪Êê‹«Ë댬ÌìÍ펮Îî¯Ïï°Ðð‘±Ññ’²Òò“³Óó”´Ôô•µÕõ–¶Öö—·×÷˜¸Øø™¹ÙùšºÚú›»Ûûœ¼Üü½Ýýž¾ÞþŸ¿ßÿ]" : U56 = regEx.REPLACE(U56,"")
netoyobjet = U56
set regEx = nothing
end if
end function
function cleanworddeclarernet(U57)
set regEx = New RegExp
regEx.IgnoreCase = True : regEx.Global = True
regEx.Pattern = "[.;:""'_+-]" : U57 = regEx.REPLACE(U57," ")
U57 = trim(U57)
regEx.Pattern = "[aàáâäåÄŪÁÂÀãÃ]" : U57 = regEx.REPLACE(U57,"a")
regEx.Pattern = "[eéèêëÉÊËÈ]" : U57 = regEx.REPLACE(U57,"e")
regEx.Pattern = "[cç¢]" : U57 = regEx.REPLACE(U57,"c")
regEx.Pattern = "[oóòôöôöòÖóðÒÔÕõ]" : U57 = regEx.REPLACE(U57,"o")
regEx.Pattern = "[uúùûüûùÜúÚÛÙ]" : U57 = regEx.REPLACE(U57,"u")
regEx.Pattern = "[iìíîïÌÍÎÏíìîï]" : U57 = regEx.REPLACE(U57,"i")
regEx.Pattern = "[nñÑ]" : U57 = regEx.REPLACE(U57,"n")
regEx.Pattern = "[€Àà¡Áá&¢Â⃣ÃㄤÄä…¥Åå†¦Ææ‡§Ç爨È艩É銪Êê‹«Ë댬ÌìÍ펮Îî¯Ïï°Ðð‘±Ññ’²Òò“³Óó”´Ôô•µÕõ–¶Öö—·×÷˜¸Øø™¹ÙùšºÚú›»Ûûœ¼Üü½Ýýž¾ÞþŸ¿ßÿ]" : U57 = regEx.REPLACE(U57,"")
cleanworddeclarernet = U57
set regEx = nothing
end function
function cleanword(U58)
Set regEx = New RegExp
regEx.Pattern = "[.;:""'_+-]" : U58 = regEx.REPLACE(U58," ")
while instr(U58," ") : U58 = replace(U58," "," ") : wend
U58 = trim(U58)
'response.write U58
regEx.Pattern = "ae" : U58 = regEx.REPLACE(U58,"æ")
regEx.Pattern = "oe" : U58 = regEx.REPLACE(U58,"œ")
regEx.Pattern = "[aàáâäåÄŪÁÂÀãÃ]" : U58 = regEx.REPLACE(U58,"[aàáâä]")
regEx.Pattern = "[cç]" : U58 = regEx.REPLACE(U58,"[cç]")
regEx.Pattern = "[eéèêë]" : U58 = regEx.REPLACE(U58,"[eéèêë]")
regEx.Pattern = "[iìíîï]" : U58 = regEx.REPLACE(U58,"[iìíîï]")
regEx.Pattern = "[nñ]" : U58 = regEx.REPLACE(U58,"[nñ]")
regEx.Pattern = "[oóòôö]" : U58 = regEx.REPLACE(U58,"[oóòôö]")
regEx.Pattern = "[uúùûü]" : U58 = regEx.REPLACE(U58,"[uúùûü]")
cleanword = U58
end function
function html(iVar)
if len(iVar) > 4 then
iVar = replace(iVar,"é","é")
iVar = replace(iVar,"è","è")
iVar = replace(iVar,"à","à")
iVar = replace(iVar,"û","û")
iVar = replace(iVar,"ç","ç")
iVar = replace(iVar,"ô","ô")
iVar = replace(iVar,"œ","œ")
iVar = replace(iVar,"â","â")
iVar = replace(iVar,"î","î")
iVar = replace(iVar,"ô","ô")
iVar = replace(iVar,"°","°")
iVar = replace(iVar,"ñ","n")
iVar = replace(iVar,"É","E")
iVar = replace(iVar,"À","A")
iVar = replace(iVar,"Ô","O")
iVar = replace(iVar,"Î","I")
iVar = replace(iVar,"Ï","I")
iVar = replace(iVar,"ê","e")
iVar = replace(iVar,"è","e")
iVar = replace(iVar,"à","a")
iVar = replace(iVar,"â","a")
html = iVar
end if
End function
function cleanwordhtml(U59)
if U59 <> "" then
U59 = replace(U59,"ç","ç")
U59 = replace(U59,"à","à")
U59 = replace(U59,"û","û")
U59 = replace(U59,"ô","ô")
U59 = replace(U59,"é","é")
U59 = replace(U59,"è","è")
U59 = replace(U59,"œ","œ")
U59 = replace(U59,"-"," ")
end if
cleanwordhtml = U59
end function
function doreq(fld,cle)
tab = split(cle,",",-1,1)
for i = 0 to ubound(tab)
if len(replace(tab(i)," ","%")) > 1 then
if i > 0 then temp = temp & " or "
lavartab = tab(i)
if right(lavartab,1) = "s" then
lavartab = left(lavartab,len(lavartab)-1)
end if
temp = temp & fld & " like '%" & replace(lavartab," ","%") & "%'"
end if
next
doreq = temp
end function
Function domaine(nb)
if nb <> "" and isnumeric(nb) then
select case nb
case "12"
domaine = "aliments pour animaux"
case "30"
domaine = "animaux vivants"
case "14"
domaine = "autres"
case "25"
domaine = "bois charbon fibre"
case "28"
domaine = "boisson alcoolisée"
case "7"
domaine = "boissons non alcolisée"
case "21"
domaine = "café cacao thé"
case "24"
domaine = "céréales"
case "33"
domaine = "champignon levure"
case "22"
domaine = "chimie additif engrais"
case "40"
domaine = "ciment"
case "27"
domaine = "conditionnement"
case "16"
domaine = "conseil et formation"
case "35"
domaine = "conserve semi conserve"
case "42"
domaine = "coquillage crustacé"
case "32"
domaine = "emploi représentation"
case "47"
domaine = "energie renouvelable"
case "8"
domaine = "épices aromates"
case "44"
domaine = "equipement maritime"
case "4"
domaine = "féculents"
case "3"
domaine = "fruits et légumes"
case "17"
domaine = "fruits secs et graines grillées"
case "13"
domaine = "horticulture plante biocarburant"
case "23"
domaine = "huiles"
case "11"
domaine = "hygiene entretien"
case "31"
domaine = "Industrie exploitation"
case "41"
domaine = "Investissement capitaux"
case "29"
domaine = "jus concentré sirop"
case "1"
domaine = "lait et produits laitiers"
case "10"
domaine = "matériels machines"
case "48"
domaine = "matiere vegetale"
case "6"
domaine = "matières grasses"
case "26"
domaine = "métaux"
case "45"
domaine = "mine terrain concession"
case "34"
domaine = "patisserie"
case "38"
domaine = "pétrole gaz"
case "39"
domaine = "pierre roche"
case "2"
domaine = "poissons"
case "5"
domaine = "produits sucrés"
case "19"
domaine = "publicité-nouveaux produits"
case "46"
domaine = "semence graine plant"
case "43"
domaine = "transport transit logistique"
case "15"
domaine = "viandes et oeufs"
case "37"
domaine = "vins"
case else
domaine = " agroalimentaire"
end select
end if
End Function
Function options(idsoc,annf,name)
set ll = conn.execute("select datefin from options where societe="&idsoc&" and annonce = "&annf&" and NAME='"& name &"'")
if not ll.eof then
options = ll("datefin")
else
options="01/01/1995"
end if
ll.close
set ll = nothing
End Function
Function FCTLETYPE(nb)
if nb <> "" then
dim montab(4)
montab(1) = "Recherche de fournisseur"
montab(2) = "Recherche de client"
montab(3) = "Recherche de partenaire"
montab(4) = "Recherche de conseiller"
FCTLETYPE = montab(nb)
end if
End Function
Function trsFCTLETYPE(lg,nb)
dim montab(4)
if lg = "FR" then
montab(1) = "Recherche de fournisseur"
montab(2) = "Recherche de client"
montab(3) = "Recherche de partenaire"
montab(4) = "Recherche de conseiller"
end if
if lg = "GB" then
montab(1) = "Search supplier"
montab(2) = "Search customer"
montab(3) = "Search partner "
montab(4) = "Search advisor"
end if
trsFCTLETYPE = montab(nb)
End Function
Function FCTLETYPE2(nb)
dim montab(4)
montab(1) = "ACHAT"
montab(2) = "VENTE"
montab(3) = "PARTENARIAT"
montab(4) = "POUR CONSEIL"
FCTLETYPE2 = montab(nb)
End Function
Function CountAnnonce(TYPES,societe)
select case TYPES
case "AFFICHER"
req = "select count(id) as tot from affaire where societe="& societe &" and AFFICHER = -1 and supprimer = 0 "
LASUITE = 0
case "SUPPRIMER"
req = "select count(id) as tot from affaire where societe="& societe &" and AFFICHER = 0 and supprimer = -1 "
LASUITE = 0
case "ENTRAITEMENT"
req = "select count(id) as tot from affaire where societe="& societe &" and AFFICHER = 0 and supprimer = 0 "
LASUITE = 0
case "STOCK"
req = "select count(id) as tot from affaire where societe="& societe &" and AFFICHER = 0 and supprimer = 0 AND STOCK=-1"
LASUITE = 0
case "ATTENTE"
req = "select count(id) as tot from affaire where societe="& societe &" and AFFICHER = 0 and supprimer = 0 AND enattente=-1"
LASUITE = 0
case "TOUTES"
req="select count(id) as tot from affaire where societe="&societe
if societe = 151325 THEN
LASUITE = -1749
end if
case else
req = "select count(id) as tot from affaire where societe="&societe
LASUITE = 0
end select
set KK = conn.execute(req)
if not kk.eof then
CountAnnonce = cstr(KK("tot"))
if societe = 151325 THEN
CountAnnonce = CountAnnonce + LASUITE
END IF
else
CountAnnonce=0
end if
kk.close
set kk = nothing
End Function
Function CountAnnoncerubrique(RUBR24)
req = "select count(id) as tot from affaire where domaine = "&RUBR24&" and AFFICHER = -1"
set KK = conn.execute(req)
CountAnnoncerubrique = cstr(KK("tot"))
kk.close
set kk = nothing
End Function
Function Countunitegratuite(societe,TYPES)
select case TYPES
case "SAISI"
req = "select count(id) as tot from uniteGRATUITE where societe="&societe
case "INSCRIT"
req = "select count(id) as tot from uniteGRATUITE where ENVOYE = -1 and RECU = -1 and societe="&societe
end select
set KK = conn.execute(req)
Countunitegratuite = cstr(KK("tot"))
kk.close
set kk = nothing
End Function
Function clickannonce(idann)
p = "INSERT INTO click (affaire, click) VALUES ("&idann&", 1) ON DUPLICATE KEY UPDATE click = click + 1"
conn.execute(p)
end Function
Function Countclick(ID)
req = "select CLICK from CLICK where affaire = "&ID
set KK = conn.execute(req)
if kk.eof then
Countclick = 0
else
Countclick = KK("CLICK")
end if
kk.close
set kk = nothing
End Function
Function Countunitedispo(societe)
req = "select uniteDISPO from unite where societe="&societe
set KK = conn.execute(req)
if not kk.eof then
Countunitedispo = KK("uniteDISPO")
else
Countunitedispo = 0
end if
kk.close
set kk = nothing
End Function
Function Countuniteutilisee(societe)
req = "select uniteUTILISEE from unite where societe="&societe
set KK = conn.execute(req)
Countuniteutilisee = KK("uniteUTILISEE")
kk.close
set kk = nothing
End Function
Function sumCountuniteutilisee()
req = "select sum(uniteUTILISEE) as totttunit from unite"
set KK = conn.execute(req)
sumCountuniteutilisee = KK("totttunit")
kk.close
set kk = nothing
End Function
FUNCTION Lenregistrement(TABLE,CHAMPRETOUR,CHAMP,VALEUR)
req = "select "&CHAMPRETOUR&" as champ1 from "&TABLE&" where "&CHAMP&"='"&VALEUR&"'"
set ll = conn.execute(req)
if not ll.eof then
Lenregistrement = ll("champ1")
else
Lenregistrement = ""
end if
ll.close
set ll = nothing
End Function
FUNCTION VerifEnregistrement(TABLE,CHAMP,VALEUR)
req = "select id from "&TABLE&" where "&CHAMP&"='"&VALEUR&"'"
set ll = conn.execute(req)
if not ll.eof then
VerifEnregistrement = TRUE
else
VerifEnregistrement = FALSE
end if
ll.close
set ll = nothing
End Function
FUNCTION VerifEnregistrementnondoublon(TABLE,CHAMP,VALEUR)
'req = "select * from "&TABLE&" where "&CHAMP&"='"&VALEUR&"' and confirmer <> 0"
req = "select id from "&TABLE&" where "&CHAMP&"='"&VALEUR&"'"
set ll = conn.execute(req)
if ll.eof then
VerifEnregistrementnondoublon = TRUE
else
VerifEnregistrementnondoublon = FALSE
end if
ll.close
set ll = nothing
End Function
FUNCTION VerifEnregistrementagrotransit(TABLE,CHAMP,VALEUR)
req = "select * from "&TABLE&" where "&CHAMP&"='"&VALEUR&"'"
set ll = conn5.execute(req)
if not ll.eof then
VerifEnregistrementagrotransit = TRUE
else
VerifEnregistrementagrotransit = FALSE
end if
ll.close
set ll = nothing
End Function
FUNCTION VerifEnregistrementid(TABLE,CHAMP,VALEUR)
req = "select id from "&TABLE&" where "&CHAMP&"="&VALEUR
set ll = conn.execute(req)
if not ll.eof then
VerifEnregistrementid = TRUE
else
VerifEnregistrementid = FALSE
end if
ll.close
set ll = nothing
End Function
FUNCTION verifselection(affaire)
req = "select id from selection where affaire = "&affaire&" and societe = "&session("id")
set ll = conn.execute(req)
if not ll.eof then
verifselection = TRUE
else
verifselection = FALSE
end if
ll.close
set ll = nothing
End Function
FUNCTION veriffacture(SOCI1)
req = "select id from facture where societe = "&SOCI1
set ll4 = conn.execute(req)
if not ll4.eof then
veriffacture = TRUE
else
veriffacture = FALSE
end if
ll4.close
set ll4 = nothing
End Function
FUNCTION veriftransactionrevendeur(SOCI1)
req = "select id from transactionrevendeur where acheteur = '"&SOCI1&"'"
set ll3 = conn.execute(req)
if not ll3.eof then
veriftransactionrevendeur = TRUE
else
veriftransactionrevendeur = FALSE
end if
ll3.close
set ll3 = nothing
End Function
Function searchPRODUIT(nb)
if nb <> "" then
set ll = conn3.execute("select PRODUIT from produit where id="&nb)
if not ll.eof then
searchPRODUIT = ll("PRODUIT")
else
searchPRODUIT="inconnu"
end if
ll.close
set ll = nothing
end if
End Function
function aleat(lenb)
randomize
aleat=int((lenb)*rnd)
if aleat=0 then aleat=1 end if
end function
function CreateAleatoire(StrTaille)
if StrTaille = 0 then exit function
Dictionnaire = "abcdefghijklmnpqrstuvwxyz123456789"
l = len(Dictionnaire)
for i = 0 to StrTaille -1
randomize
s = s & mid(Dictionnaire, int(rnd * l)+1, 1)
next
CreateAleatoire = s
end function
function CreateAleatoirenumeric(StrTaille)
if StrTaille = 0 then exit function
Dictionnaire = "123456789"
l = len(Dictionnaire)
for i = 0 to StrTaille -1
randomize
s = s & mid(Dictionnaire, int(rnd * l)+1, 1)
next
CreateAleatoirenumeric = s
end function
function laver(chaine)
varatt = chaine
varatt = replace(varatt,"É","E")
varatt = replace(varatt," ","")
varatt = replace(varatt,"Ô","O")
varatt = replace(varatt,"é","e")
varatt = replace(varatt,"ô","o")
varatt = replace(varatt,"à","a")
varatt = replace(varatt,"'","")
varatt = mid(varatt,1,15)
laver = varatt
end function
function laver2(chaine)
varatt = chaine
varatt = replace(varatt,"É","E")
varatt = replace(varatt,"Ô","O")
varatt = replace(varatt,"é","e")
varatt = replace(varatt,"ô","o")
varatt = replace(varatt,"à","a")
varatt = replace(varatt,"'","")
laver2 = varatt
end function
function verifmessageprecedent(EMETEUR,DESTINATAIRE,OBJETT,MESSAGE,PRECEDENT,affaire)
hr = "select id from messagerie where emeteur="&EMETEUR&" AND DESTINATAIRE="&DESTINATAIRE&" AND affaire="&affaire&" AND OBJET='"&OBJETT&"' AND MESSAGE='"&MESSAGE&"'"
set nn = conn.execute(hr)
if nn.eof then
verifmessageprecedent = false
else
verifmessageprecedent = true
end if
nn.close
set nn = nothing
end function
Function messagerie(EMETEUR, DESTINATAIRE, OBJETT, MESSAGE, PRECEDENT, affaire)
Application.Lock()
msg_lacle = CreateAleatoire(26) & Replace(Time(), ":", "")
Set msg_rs = Server.CreateObject("ADODB.Recordset")
msg_rs.Open "messagerie", conn, 3, 2
msg_rs.AddNew
msg_rs.Fields("CONCERNE") = EMETEUR
msg_rs.Fields("EMETEUR") = EMETEUR
msg_rs.Fields("DESTINATAIRE") = DESTINATAIRE
msg_rs.Fields("OBJET") = SupprimerAccents(EnleverEmojis(OBJETT))
msg_rs.Fields("MESSAGE") = SupprimerAccents(EnleverEmojis(MESSAGE))
msg_rs.Fields("PRECEDENT") = PRECEDENT
msg_rs.Fields("affaire") = affaire
msg_rs.Fields("CLE") = msg_lacle
msg_rs.Fields("VALIDER") = 0
msg_rs.Fields("LU") = 0
msg_rs.Fields("SUPPRIMER") = 0
msg_rs.Fields("COORD") = 0
msg_rs.Fields("VALIDER") = 0
msg_rs.Update
msg_rs.AddNew
msg_rs.Fields("CONCERNE") = DESTINATAIRE
msg_rs.Fields("EMETEUR") = EMETEUR
msg_rs.Fields("DESTINATAIRE") = DESTINATAIRE
msg_rs.Fields("OBJET") = SupprimerAccents(EnleverEmojis(OBJETT))
msg_rs.Fields("MESSAGE") = SupprimerAccents(EnleverEmojis(MESSAGE))
msg_rs.Fields("PRECEDENT") = PRECEDENT
msg_rs.Fields("affaire") = affaire
msg_rs.Fields("CLE") = msg_lacle
msg_rs.Fields("VALIDER") = 0
msg_rs.Fields("LU") = 0
msg_rs.Fields("SUPPRIMER") = 0
msg_rs.Fields("COORD") = 0
msg_rs.Fields("VALIDER") = 0
msg_rs.Update
msg_rs.Close
Set msg_rs = Nothing
Application.UnLock()
End Function
function pluspremium(lasoc)
conn.execute("update societe set premium = 0 where id="&lasoc)
conn.execute("update affaire set aff_premium = 0 where societe="&lasoc)
end function
Function CheckString(s, endChar)
s = Trim(s)
If ( s = "" ) Then
s = " "
End If
pos = InStr(s, "'")
While ( pos > 0 )
s = Mid(s, 1, pos) & "'" & Mid(s, pos + 1)
pos = InStr(pos + 2, s, "'")
Wend
CheckString = "'" & s & "'" & endChar
End Function
Function deduc(societe,NBR)
application.lock
vartp1 = "select uniteDISPO,uniteUTILISEE from unite where societe = "&societe
set varrode = conn.execute(vartp1)
if not varrode.eof then
if varrode("uniteDISPO") <= 1 then
conn.execute("update societe set premium = 0 where id="&societe)
conn.execute("update affaire set aff_premium = 0 where societe="&societe)
end if
if varrode("uniteDISPO") >= NBR then
vartp = "update unite set uniteDISPO = "&(varrode("uniteDISPO") - nbr)&" where societe = "&societe
conn.execute(vartp)
vartp = "update unite set uniteUTILISEE = "&(varrode("uniteUTILISEE") + nbr)&" where societe = "&societe
conn.execute(vartp)
'cette ligne est ajoute le jour du passage a une duree limitee de 1 an
vartp = "update DUREEUNITE set NBUNIT = NBUNIT-1 where societe = "&societe
' response.write vartp
conn.execute(vartp)
deduc = true
else
deduc = false
end if
else
conn.execute("insert into unite (societe,uniteDISPO) values ("&societe&",0)")
deduc = false
end if
varrode.close
set varrode = nothing
application.unlock
End Function
Function deducnew(societe,NBR,service)
application.lock
vartp1 = "select uniteDISPO,uniteUTILISEE from unite where societe = "&societe
set varrode = conn.execute(vartp1)
if not varrode.eof then
if varrode("uniteDISPO") <= 2 then
conn.execute("update societe set premium = 0 where id="&societe)
conn.execute("update affaire set aff_premium = 0 where societe="&societe)
end if
if varrode("uniteDISPO") >= NBR then
vartp = "update unite set uniteDISPO = "&(varrode("uniteDISPO") - nbr)&" where societe = "&societe
conn.execute(vartp)
session("nbunites2") = session("nbunites2") - nbr
vartp = "update unite set uniteUTILISEE = "&(varrode("uniteUTILISEE") + nbr)&" where societe = "&societe
conn.execute(vartp)
'cette ligne est ajoute le jour du passage a une duree limitee de 1 an
vartp = "update DUREEUNITE set NBUNIT = NBUNIT-1 where societe = "&societe
'response.write vartp
deducnew = true
conn.execute("insert into conso_unite (societe,nbunite,service) values ("&societe&","&NBR&",'"&service&"')")
else
deducnew = false
end if
else
conn.execute("insert into unite (societe,uniteDISPO) values ("&societe&",0)")
deducnew = false
end if
varrode.close
set varrode = nothing
application.unlock
End Function
Function addu(societe,NBR)
application.lock
vartp1 = "select uniteDISPO from unite where societe = "&societe
set varrode = conn.execute(vartp1)
IF varrode.eof THEN
conn.execute("insert into unite (societe,uniteDISPO) values ("&societe&","&nbr&")")
conn.execute("update affaire set aff_premium = -1 where societe="&societe)
conn.execute("update societe set premium = -1 where id="&societe)
ELSE
if varrode("uniteDISPO") >= 0 then
vartp = "update unite set unitedispo = "&(varrode("uniteDISPO") + nbr)&" where societe = "&societe
conn.execute("update affaire set aff_premium = -1 where societe="&societe)
conn.execute("update societe set premium = -1 where id="&societe)
conn.execute(vartp)
addu = true
else
addu = false
end if
end if
varrode.close
set varrode = nothing
application.unlock
End Function
Function addusspremium(societe,NBR)
application.lock
vartp1 = "select uniteDISPO from unite where societe = "&societe
set varrode = conn.execute(vartp1)
IF varrode.eof THEN
conn.execute("insert into unite (societe,uniteDISPO) values ("&societe&","&nbr&")")
ELSE
if varrode("unitedispo") >= 0 then
vartp = "update unite set uniteDISPO = "&(varrode("uniteDISPO") + nbr)&" where societe = "&societe
conn.execute(vartp)
addusspremium = true
else
addusspremium = false
end if
end if
varrode.close
set varrode = nothing
application.unlock
End Function
Function stats_liaisons(lcontacteur,lcontacte,ltype,lannonce)
'response.write lcontacte
if lcontacteur <> "" and lcontacte <> "" then
conn.execute("insert into stats_liaisons (contacteur,contacte,annonce,type) values ("&lcontacteur&","&lcontacte&","&lannonce&",'"<ype&"')")
end if
end Function
Function VERIFliaisonunite(societe, affaire)
' Vérifier si les variables sont non vides
If Trim(societe) = "" Or Trim(affaire) = "" Then
VERIFliaisonunite = False
Exit Function
End If
' Requête SQL sécurisée
vartp1 = "SELECT societe, affaire FROM liaisonunite WHERE societe = " & societe & " AND affaire = " & affaire
Set varrode45 = conn.Execute(vartp1)
If varrode45.EOF Then
VERIFliaisonunite = False
Else
VERIFliaisonunite = True
End If
varrode45.Close
Set varrode45 = Nothing
End Function
Function VERIFLIAISONPRODUCTEUR(societe,PRODUCTEUR)
vartp1 = "select societe,PRODUCTEUR from liaisonproducteur where societe = "&societe&" and PRODUCTEUR="&PRODUCTEUR
set varrode = conn.execute(vartp1)
if varrode.eof then
VERIFLIAISONPRODUCTEUR = false
else
VERIFLIAISONPRODUCTEUR = true
end if
varrode.close
set varrode = nothing
End Function
Function ESTCOMPLET(societe)
vartp1 = "select societe from complet where societe = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
ESTCOMPLET = false
else
ESTCOMPLET = true
end if
varrode.close
set varrode = nothing
End Function
Function affaireenattente(societe)
vartp1 = "select enattente from affaire where societe = "&societe &" and enattente = -1 and supprimer=0 AND date >= NOW() - INTERVAL 30 DAY"
set varrode = conn.execute(vartp1)
if varrode.eof then
affaireenattente = false
else
affaireenattente = true
end if
varrode.close
set varrode = nothing
End Function
Function ESTalerteR(societe)
vartp1 = "select societe from alerte where societe = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
ESTalerteR = false
else
ESTalerteR = true
end if
varrode.close
set varrode = nothing
End Function
Function SocieteName(societe)
vartp1 = "select societe from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
SocieteName = ""
else
SocieteName = varrode("societe")
end if
varrode.close
set varrode = nothing
End Function
Function infobasesociete(societe)
vartp1 = "select societe,convert(interlocuteur using utf8mb4) as interlocuteur,adresse,ville,telephone,pays,email from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
infobasesociete = ""
else
infobasesociete = ucase(varrode("societe"))&" "&ucase(varrode("interlocuteur"))&" "&ucase(varrode("adresse"))&" "&ucase(varrode("ville"))&" "&ucase(varrode("pays"))&" tel: "&ucase(varrode("telephone"))&" EMAIL: "&ucase(varrode("EMAIL"))
end if
varrode.close
set varrode = nothing
End Function
Function SocietePays(societe)
vartp1 = "select PAYS from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
SocietePays = ""
else
SocietePays = varrode("PAYS")
end if
varrode.close
set varrode = nothing
End Function
Function Societeville(societe)
vartp1 = "select ville from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
Societeville = ""
else
Societeville = varrode("ville")
end if
varrode.close
set varrode = nothing
End Function
Function SocieteSKYPE(societe)
vartp1 = "select SKYPE from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
SocieteSKYPE = ""
else
SocieteSKYPE = varrode("SKYPE")
end if
varrode.close
set varrode = nothing
End Function
Function LETHEMESKYPE(societe)
vartp1 = "select SKYPE from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
LETHEMESKYPE = ""
else
LETHEMESKYPE = varrode("SKYPE")
end if
varrode.close
set varrode = nothing
End Function
Function PRESENToncfSkype(societe,CONFE)
vartp1 = "select societe from skype where societe = "&societe&" and conf="&CONFE
set varrode = conn.execute(vartp1)
if varrode.eof then
PRESENToncfSkype = false
else
PRESENToncfSkype = true
end if
varrode.close
set varrode = nothing
End Function
Function SocieteIndice(societe)
vartp1 = "select INDICE from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
SocieteIndice = 0
else
SocieteIndice = varrode("INDICE")
end if
varrode.close
set varrode = nothing
End Function
Function societecodetemp(societe)
vartp1 = "select codetemp from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
societecodetemp = 0
else
societecodetemp = varrode("codetemp")
end if
varrode.close
set varrode = nothing
End Function
Function Affaire_societe(affaire2)
vartp1 = "select societe from affaire where id = "&affaire2
set varrode = conn.execute(vartp1)
if varrode.eof then
Affaire_societe = ""
else
Affaire_societe = varrode("societe")
end if
varrode.close
set varrode = nothing
End Function
Function Affaire_TITRE(affaire2)
vartp1 = "select CONVERT(titre USING utf8mb4)as titre from affaire where id = "&affaire2
'response.write vartp1
set varrode = conn.execute(vartp1)
if varrode.eof then
Affaire_TITRE = ""
else
Affaire_TITRE = varrode("TITRE")
end if
varrode.close
set varrode = nothing
End Function
Function Affaire_messagerie(affaire2)
vartp1 = "select titre,paysannonceur from affaire where id = "&affaire2
'response.write vartp1
set varrode = conn.execute(vartp1)
if varrode.eof then
Affaire_messagerie = ""
else
Affaire_messagerie = lcase(varrode("TITRE"))&" ("&varrode("paysannonceur")&")"
end if
varrode.close
set varrode = nothing
End Function
Function Affaire_COMMENTAIRE(affaire2)
vartp1 = "select COMMENTAIRE from affaire where id = "&affaire2
set varrode = conn.execute(vartp1)
if varrode.eof then
Affaire_COMMENTAIRE = ""
else
Affaire_COMMENTAIRE = varrode("COMMENTAIRE")
end if
varrode.close
set varrode = nothing
End Function
Function SocietePays(societe)
vartp1 = "select PAYS from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
SocietePays = ""
else
SocietePays = cleanworddeclarernet(varrode("PAYS"))
end if
varrode.close
set varrode = nothing
End Function
Function SocieteCodetemp(societe)
vartp1 = "select CODETEMP from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
SocieteCodetemp = ""
else
SocieteCodetemp = varrode("CODETEMP")
end if
varrode.close
set varrode = nothing
End Function
Function SocietePASS(societe)
vartp1 = "select MOTDEPASSE from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
SocietePASS = ""
else
'SocietePASS = varrode("MOTDEPASSE")
end if
varrode.close
set varrode = nothing
End Function
Function ToUTF82(str)
Set stream = CreateObject("ADODB.Stream")
stream.Charset = "utf-8" ' Définit l'encodage en UTF-8
stream.Open
stream.WriteText str
stream.Position = 0 ' Remet le curseur au début du flux
stream.Type = 2 ' Définit le type de données en texte
ToUTF82 = cleanworddeclarernet(stream.ReadText(-1)) ' Lit tout le texte en UTF-8
stream.Close
Set stream = Nothing
End Function
Function ObjetMessage(thecle)
vartp1 = "select CONVERT(OBJET USING utf8mb4) as OBJET2 from messagerie where cle = '"&thecle&"'"
set varrode = conn.execute(vartp1)
if varrode.eof then
ObjetMessage = ""
else
ObjetMessage = Server.HTMLEncode(varrode("OBJET2"))
end if
varrode.close
set varrode = nothing
End Function
Function CorpsMessage(thecle)
vartp1 = "select convert(message using utf8mb4) as message from messagerie where cle = '"&thecle&"'"
set varrode = conn.execute(vartp1)
if varrode.eof then
CorpsMessage = ""
else
CorpsMessage = (varrode("message"))
end if
varrode.close
set varrode = nothing
End Function
Function SocieteLOG(societe)
vartp1 = "select LOGIN from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
SocieteLOG = ""
else
SocieteLOG = varrode("LOGIN")
end if
varrode.close
set varrode = nothing
End Function
Function Societemdp(societe)
vartp1 = "select motdepasse from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
Societemdp = ""
else
'Societemdp = varrode("motdepasse")
end if
varrode.close
set varrode = nothing
End Function
Function SocieteEmail(societe)
vartp1 = "select EMAIL from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
SocieteEmail = ""
else
SocieteEmail = varrode("EMAIL")
end if
varrode.close
set varrode = nothing
End Function
Function SocieteEmailEmail(email)
vartp1 = "select EMAIL from societe where email = '"&email&"'"
set varrode = conn.execute(vartp1)
if varrode.eof then
SocieteEmailEmail = false
else
SocieteEmailEmail = true
end if
varrode.close
set varrode = nothing
End Function
Function Societephone(societe)
vartp1 = "select telephone from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
Societephone = ""
else
Societephone = varrode("telephone")
end if
varrode.close
set varrode = nothing
End Function
Function societereglement(CODEEE)
vartp1 = "select societe from reglement_confirm where transaction = '"&CODEEE&"'"
set varrode = conn.execute(vartp1)
if varrode.eof then
societereglement = ""
else
societereglement = varrode("societe")
end if
varrode.close
set varrode = nothing
End Function
Function societeexiste(SOC)
vartp1 = "select id from societe where id = "&SOC
set varrode = conn.execute(vartp1)
if varrode.eof then
societeexiste = FALSE
else
societeexiste = TRUE
end if
varrode.close
set varrode = nothing
End Function
Function SocieteACTIVITE(societe)
vartp1 = "select TYPEACTIVITE from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
SocieteACTIVITE = ""
else
SocieteACTIVITE = varrode("TYPEACTIVITE")
end if
varrode.close
set varrode = nothing
if SocieteACTIVITE="autre" then SocieteACTIVITE = "" end if
End Function
Function Societeinterlocuteur(societe)
vartp1 = "select convert(interlocuteur using utf8mb4) as interlocuteur from societe where id = "&societe
set varrode = conn.execute(vartp1)
if varrode.eof then
Societeinterlocuteur = ""
else
Societeinterlocuteur = varrode("interlocuteur")
end if
varrode.close
set varrode = nothing
End Function
Function liaisonunite(societe,affaire)
application.lock
vartp = "insert into liaisonunite (affaire,societe) values ("&affaire&","&societe&")"
conn.execute(vartp)
liaisonunite = true
application.unlock
End Function
Function liaisonunitemessagerie(societe,messagerie)
application.lock
vartp = "update messagerie set COORD = -1 where id="&messagerie&" and CONCERNE="&societe
conn.execute(vartp)
liaisonunitemessagerie = true
application.unlock
End Function
Function emeteurmessagerie(messagerie)
vartp1 = "select EMETEUR from messagerie where id="&messagerie
set varrode = conn.execute(vartp1)
if not varrode.eof then
emeteurmessagerie = varrode("EMETEUR")
end if
varrode.close
set varrode = nothing
End Function
Function AFFAIREmessagerie(messagerie)
vartp1 = "select AFFAIRE from messagerie where id="&messagerie
set varrode = conn.execute(vartp1)
if not varrode.eof then
AFFAIREmessagerie = varrode("AFFAIRE")
end if
varrode.close
set varrode = nothing
End Function
Function verifliaisonunitemessagerie(societe,messagerie)
application.lock
vartp1 = "select coord from messagerie where id="&messagerie&" and concerne = "&societe
set varrode = conn.execute(vartp1)
if not varrode.eof then
if varrode("coord") = -1 then
verifliaisonunitemessagerie = true
else
verifliaisonunitemessagerie = false
end if
end if
varrode.close
set varrode = nothing
application.unlock
End Function
Function LIAISONontpriscoord(societe,MBAYANTPRIS)
vartp = "insert into ontpriscoord (societe,membreayantpris) values ("&societe&","&MBAYANTPRIS&")"
conn.execute(vartp)
LIAISONontpriscoord = true
End Function
Function fichierexist(filenameR)
set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists("D:\www\espaceagro.com\website\"& filenameR )= true then
fichierexist = true
else
fichierexist = false
end if
set fs=nothing
end function
function count_message()
pal="select count(id) as tot from messagerie where to_days(date) >= TO_DAYS(NOW())-2"
set pann4 = conn.execute(pal)
count_message = cstr(pann4("tot"))
pann4.close
set pann4 = nothing
end function
function count_message_jour(idemeteur)
pal="select count(id) as tot from messagerie where to_days(date) >= TO_DAYS(NOW())-2 and emeteur = "&idemeteur
set pann4 = conn.execute(pal)
count_message_jour = cstr(pann4("tot"))
pann4.close
set pann4 = nothing
end function
function count_message_jour_block(idemeteur)
'pal="select count(id) as tot from messagerie where to_days(date) = TO_DAYS(NOW())-0 and emeteur = "&idemeteur
'set pann4 = conn.execute(pal)
'if not pann4.eof then
' count_message_jour_block = int(cstr(pann4("tot"))/2)
'else
count_message_jour_block = 0
'end if
'pann4.close
'set pann4 = nothing
end function
function count_societe()
pal="select count(id) as tot from societe where to_days(date) >= TO_DAYS(NOW())-2"
set pann4 = conn.execute(pal)
count_societe = cstr(pann4("tot"))
pann4.close
set pann4 = nothing
end function
function count_affaire()
pal="select count(*) as tot from affaire where to_days(date) >= TO_DAYS(NOW())-2"
set pann4 = conn.execute(pal)
count_affaire = cstr(pann4("tot"))
pann4.close
set pann4 = nothing
end function
FUNCTION laCONFSKYPE()
SQL="SELECT * FROM conf_skype where fait = 0 and to_days(date) = to_days(NOW())"
set io = conn.execute(SQL)
if not io.eof then
laCONFSKYPE = true
else
laCONFSKYPE = false
end if
io.close
set io = nothing
end function
%>
- Pas de restriction - 2000 tonnes - Espaceagro
-
N°604661:
Cherche fournisseurs de cuivre
: Pas de restriction
: 2000 tonnes
SET SUR SEPT
Mr. AHMADOU NIANG
87bis boulevard du Général De Gaulle
99 Dakar
:
+221 781152960
:
SET SUR SEPT
Mr. AHMADOU NIANG
87bis boulevard du Général De Gaulle
99 Dakar
:
+221 781152960
RAPPEL DE PRUDENCE
.
:
-
-
- .
-
-
- .
-
- appel whatsapp en video etc ...
:
: