%@ Language=VBScript %> <%Option Explicit%> <% Dim RS2 : Set RS2 = Server.CreateObject("ADODB.Recordset") Dim sesid 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 %> <%Dim idAch,idTypeAch,idResTemp,resid idResTemp = 0 if Request.Form("hidcheck") = 1 then Sub RunScript Location.Reload(True) End Sub if Session("Userid")<>1 AND Session("perm") = 1 then strSQL = " SELECT d.Nom_dos,a.ID_TypeAcheteur " & _ " FROM tblDossier AS d INNER JOIN tblSUBAcheteur AS a ON d.ID_dos = a.ID_dos" & _ " WHERE a.ID_Ach = " & Session("Userid") RS.Open strSQL, CNRS idAch = Session("Userid") & RS.Fields(0) idTypeAch = RS.Fields("ID_TypeAcheteur") RS.Close() strSQL = _ "SELECT r.ID_res AS vID,l.Open_Listing, IIF(w.ID_AccesWeb IS NULL, 2, 1) as vOrd " & _ "FROM (((tblSUBResidence AS r " & _ " INNER JOIN tblVente AS v ON r.ID_res = v.ID_res) " & _ " INNER JOIN (SELECT * FROM tblListing WHERE Id_Listing = " & Request.Form("hidID") & ") AS l ON v.ID_Vente = l.ID_Vente ) " & _ " LEFT JOIN tblAccesWeb AS w ON ( " & _ " l.ID_Listing = w.ID_Listing " & _ " AND w.ID_ach = " & Session("Userid") & " " strSQL = strSQL & _ " )) " & _ "WHERE Actif_Listing " & _ "ORDER BY 1 ASC " Response.Write "" RS.Open strSQL, CNRS if RS.Fields("vOrd") = 2 then SendEMail EMAIL_FROM, EMAIL_TO, "","L'ach. #" & idAch & " et l-sommaire sans acces client #" & lettreVF(lettreID()) & lettreID() & lettreOpen(lettreID()), " " elseif (idTypeAch=1 or idTypeAch=2) then SendEMail EMAIL_FROM, EMAIL_TO, "","L'ach. #" & idAch & " et l-sommaire #" & lettreVF(lettreID()) & lettreID() & lettreOpen(lettreID()), " " else SendEMail EMAIL_FROM, EMAIL_TO, "","L'ach. #" & idAch & " et l-sommaire accesible suite à l'envoi de masse #" & lettreVF(lettreID()) & lettreID() & lettreOpen(lettreID()), " " end if RS.Close end if Server.Execute "ficheWeb.asp" else '***************************************************************************************************************** dim DD, MD, SD 'DefaultDevise, ModDevise and SymboleDevise if Request.QueryString("d") <> "" then DD = Request.QueryString("d") else DD = Request.Cookies("devise") end if MD = 1 SD = "$" Public Function Div0(ByVal v1, ByVal v2) If Not IsNull(v1) And Not IsNull(v2) Then If v2 <> 0 Then Div0 = v1 / v2 Else Div0 = 0 End If End If End Function Public Function CalculerMensualite(ECapital, EDuree, ETaux) 'set the variables Dim vTaux 'As Double Dim vPaiement 'As Currency Dim vDiviseur 'As Double Dim vNumPaiement 'As Integer Dim vQuotien 'As Double Dim vQuotien1 'As Double If ECapital > 0 And EDuree > 0 Then vTaux = (ETaux) / 2 vQuotien1 = ((1 + vTaux) ^ 2) - 1 vQuotien = ((1 + vQuotien1) ^ (1 / 12)) - 1 vNumPaiement = EDuree * 12 vDiviseur =Div0( (1 - ((1 + vQuotien) ^ (-1 * vNumPaiement))) , vQuotien) if vDiviseur <>0 then vPaiement = ECapital / vDiviseur end if CalculerMensualite = FormatNumber(vPaiement, 2) Else CalculerMensualite = 0 End If End Function Public function ShowProjection() if RS.Fields("final") <> true then Response.Write "Fiche préliminaire(résumé) " else Response.Write "Dossier complet(résumé)" end if End function Public function PN(vVal) if P then dim I dim vRet vRet = "" for I = 1 to len(vVal) vRet = vRet & "-" next PN = vRet else PN = vVal end if end function Public function PS(vVal) if P then PS = "" else PS = vVal end if end function Public function lettreID() if RS.Fields("Temp") or RS.Fields("Open_Listing") <> 0 then lettreID = ((RS.Fields("vID") +3000) Mod 1804) + RS.Fields("vID") else lettreID = RS.Fields("vID") end if end function Public function lettreOpen(rid) if rid <> RS.Fields("vID") and RS.Fields("Open_Listing") then if rid < 300 then lettreOpen = "Z" elseif rid >1499 then lettreOpen = "H" else lettreOpen = "B" end if end if end function Public function lettreVF(rid) if rid <> RS.Fields("vID") then if RS.Fields("Temp") then lettreVF = "VF" end if end if end function Public function deuxChiffre(vVal) if Len(vVal) =1 then deuxChiffre = "0"& vVal else deuxChiffre = vVal end if end function %>
Richard PerreaultLa première étape vers un investissement performant | ||
|
<%end if %>
|
||