<%@ Language=VBScript %> <%Option Explicit%> <% Dim RS2 : Set RS2 = Server.CreateObject("ADODB.Recordset") Dim sesid,sesid2,username, mpasse ConnectRS select case Request.Form("action") case "login": if Request.Form("username") <> "" then 'Prise de l'information de l'acheteur selon son nom d'utilisateur (..., (SELECT COUNT(ID_Transaction) FROM tblTransaction WHERE ID_ach = a.ID_ach) AS [transac]...) strSQL = "SELECT a.ID_Ach, 0 AS [ID_Assistant], webActif, webPassword, webDateFin, (SELECT COUNT(ID_CCach) FROM tblCCAch WHERE ID_ach = a.ID_ach) AS [CCACH] FROM tblSUBAcheteur AS a WHERE webUsername = '" & replace(lcase(Request.Form("username")), "'", "''") & "'" & _ " UNION SELECT ID_Ach, ID_Assistant, webActif, webPassword, webDateFin, 0 FROM tblAssistant WHERE webUsername = '" & replace(lcase(Request.Form("username")), "'", "''") & "'" 'Response.Write "" RS.Open strSQL, CNRS 'ouverture de la requête if RS.EOF then 'vérification qu'un nom a été trouvé vMess = "Nom d'utilisateur inconnu" else if RS.Fields("webPassword") <> Request.form("password") then 'vérification du mot de passe vMess = "Mot de passe incorrect" else Session("user") = UCase(Request.Form("username")) 'l'utilisateur est identifié Session("Userid") = RS.Fields("ID_Ach") Session("Assistid") = RS.Fields("ID_Assistant") Session("CCACH") = RS.Fields("CCACH") 'Session("Transac") = RS.Fields("transac") if Session("CCACH") > 0 then dim RScc: Set RScc = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT MAX(Date_CCAch) FROM tblCCach WHERE ID_ach = " & Session("Userid") & " AND ID_EtapeCCach = 1" RScc.Open strSQL, CNRS Response.Write "" if RScc.EOF then Session("CCACH") = 0 else if DateDiff("m", RScc.Fields(0), Date) > 12 then Session("CCACH") = 0 end if end if end if if not RS.Fields("webActif") then 'vérification de l'état de son accès vMess = "Vous êtes identifié mais votre accès a été révoqué" else if datediff("d", RS.Fields("webDateFin"), date) > 0 then 'vérification de la fin de son accès vMess = "Vous êtes identifié mais votre accès a prit fin le " & RS.Fields("webDateFin") else Session("perm") = 1 strSQL = " SELECT d.Nom_dos" & _ " FROM tblDossier AS d INNER JOIN tblSUBAcheteur AS a ON d.ID_dos = a.ID_dos" & _ " WHERE a.ID_Ach = " & Session("Userid") RS2.Open strSQL, CNRS sesid = RS2.Fields(0) RS2.Close() if Session("Userid") <> 1 then SendEMail EMAIL_FROM, EMAIL_TO, "","L'ach. #"& Session("Userid") & " : " & sesid & " vient de se connecter sur le site immobilier !!! ", " " end if end if end if end if end if RS.Close end if case "logout": Session.Abandon Response.Redirect "index.asp" end select %> <% function DateForm2(vDat) dim Days, Months, strReturn Days = array("Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi") Months = array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre") strReturn = "" strReturn = strReturn & Day(vDat) & " " strReturn = strReturn & Months(Month(vDat) - 1) & " " strReturn = strReturn & Year(vDat) & " [" strReturn = strReturn & right(FormatNumber(Hour(vDat) / 100, 2), 2) & ":" & right(FormatNumber(Minute(vDat) / 100, 2), 2) & "]" DateForm2 = strReturn end Function function validateComment(vCom) dim nrC nrC=0 For I = 1 To 6 if Mid(vCom,I,1) <> "a" and Mid(vCom,I,1) <> "e" and Mid(vCom,I,1) <> "i" and Mid(vCom,I,1) <> "o" and Mid(vCom,I,1) <> "u" and Mid(vCom,I,1) <> "y" then nrC = nrC +1 end if Next validateComment = nrC end function Dim ShowContent 'As Boolean 'Should the form be Displayed ShowContent = True 'The form should be displayed if Request.Form <> "" then 'If there is data in the request.form dim vSubject dim vContent dim vData dim vName dim vLocs dim vLocsID dim vTab dim vComment vMess = "" if Request.Form("txtNom") = "" then vName = "Sans Nom" else vName = Trim(Request.Form("txtNom")) end if vSubject = "Commentaire laissé par " & vName & " le " & FormatDate(Now, "dd-mmm-yyyy") & " (site RP)" vContent = "" vData = vData & vName & chr(20) vContent = vContent & "

" & vbcrlf vContent = vContent & "
" & vbcrlf vContent = vContent & "" & vbcrlf if Request.Form("txtVille") <> "" then vContent = vContent & Request.Form("txtVille") vData = vData & Request.Form("txtVille") & chr(20) end if if Request.Form("txtComments") <> "" then vContent = vContent & "

Commentaires

" & vbcrlf vContent = vContent & Request.Form("txtComments") else vMess = vMess & "txtComments;" end if vData = vData & Request.Form("txtComments") & chr(20) vContent = vContent & "
" vComment = Request.Form("txtComments") if vMess = "" and validateComment(vComment) < 5 then 'Response.Write vContent SendEMail EMAIL_FROM, EMAIL_TO, "", vSubject, vContent showContent = false end if end if %> Richard Perreault
<% Dim noBrp strSQL = " SELECT Max(Last_brp) FROM tblBrp" RS2.Open strSQL, CNRS noBrp = RS2.Fields(0) RS2.Close noBrp = noBrp & "Web.html"%>

Mandats

<% if Session("Perm") = 1 then %> <%else %> <% end if%>

Achat - Vente

Calculez

Qui suis-je ?

Contacts

Laissez vos commentaires

<%if Session("Userid")<> "" then%>

Identification

Vous êtes connecté
en tant que : <%=username%>

<%=vMess%>

<%else%>

Identification

Utilisateur : <%if username <> "" then%> <%else %> " size="20" /> <%end if %>

Mot de passe : <%if mpasse <>"" then %> <%else %> <%end if %>

<%=vMess%>

< S'INSCRIRE >

<%if vMess = "" then%> <%end if%> <%end if%>

Liens utiles

<%if ShowContent then %>

Veuillez utiliser ce formulaire pour nous poser des questions ou nous faire part de vos commentaires.

<% ShowFieldsComment %>
Commentaires
<%else %>

Vos commentaires nous tiennent à coeur!
Merci d'avoir pris le temps de nous laisser vos commentaires.

<%end if %>
<% EndConnect %>