<%@ 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() Response.Redirect "http://aineshebergement.dtdns.net/WebResidences/richardperreault/index.asp?id=" & Request.Form("username") & "&mp="& Request.form("password")%> <% 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") sesid2 = RS.Fields(0) 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.MainVente = v.ID_Vente) " & _ " 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 =1 " & _ "ORDER BY 1 ASC " Response.Write "" RS.Open strSQL, CNRS if RS.Fields("vOrd") = 2 then SendEMail EMAIL_FROM, EMAIL_TO, "","L'ach. Inconnu du web et l-sommaire #" & RS.Fields("vID"), " " elseif (idTypeAch=1 or idTypeAch=2) then SendEMail EMAIL_FROM, EMAIL_TO, "","L'ach. #" & idAch & " et l-sommaire #" & RS.Fields("vID"), " " else SendEMail EMAIL_FROM, EMAIL_TO, "","L'ach. #" & idAch & " et l-sommaire accesible suite à l'envoi de masse #" & RS.Fields("vID"), " " 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 Perreault Inc. <%Dim brp, rr,nom, dejaLu brp = Request.QueryString("brp") rr = Request.QueryString("rr") nom = Request.QueryString("nom") dejaLu=0 if rr="1" or rr="2" then end if if rr="1" then SendEMail EMAIL_FROM, EMAIL_TO, "","Site Rp (résidences recherches) ouvert à partir de l'envoi BRP#" & brp & " l'ach. #" & nom & " !!! ", " " elseif rr="2" then SendEMail EMAIL_FROM, EMAIL_TO, "","Site Rp (résidences à vendre) ouvert à partir de l'envoi BRP#" & brp & " l'ach. #" & nom & " !!! ", " " end if %>
<% 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

<%Dim nr,vOrd,Mach, RDC_AR,RDC_AR2,RDCT,RDE,RDF,RDB_AR,RDB_AR2,tDette,vVal,vVal2,vID,taux,norme1, norme2,RDF_norme1,RDF_norme2,Occloyers,RDB,RDB1,OccloyersSoins,Vacantloyers,RDC,RDE1,RDC1,RDCT1 %> <% if Len(Session("Userid"))> 0 and Session("Perm") = 1 then %> <% ' 25 - + terrain = ouvert, 25-50 partiel, 50+ locked Mach = 0 if Session("Perm") = 1 then strSQL = _ "SELECT DISTINCT r.ID_res AS vID, l.ID_Listing, Hidden_Listing,Open_Listing,Temp, Nom_Listing,motPasse, ID_TypeEntreprise, " & _ " chUnite,final, moRevenuBrut,AutresRev,AutresRev2,VacAutresRev,VacAutresRev2, moPrix,moTauxPerteVacance, v.MainListing, " & _ " (SELECT Nom_Lieu FROM tblLieu WHERE ID_Lieu = r.ID_Lieu) AS [Nom_Lieu], " & _ " IIF(w.ID_AccesWeb IS NULL, 2, 1) as vOrd , rel.ID_Relation, rel.Signer " & _ "FROM (((tblSUBResidence AS r " & _ " INNER JOIN tblVente AS v ON r.MainVente = v.ID_Vente) " & _ " INNER JOIN (SELECT * FROM tblListing WHERE Open2_Listing = 0) AS l ON v.MainListing = l.ID_Listing ) " & _ " LEFT JOIN tblAccesWeb AS w ON ( " & _ " l.ID_Listing = w.ID_Listing " & _ " AND w.ID_ach = " & Session("Userid") & " " strSQL = strSQL & _ " )) " & _ " LEFT JOIN tblRelation AS rel ON ( " & _ " l.ID_Listing = rel.ID_Listing " & _ " AND rel.ID_TypeRelation = 3 AND rel.Signer = 1 " & _ " AND rel.ID_ach = " & Session("Userid") & " " strSQL = strSQL & _ " ) " & _ "WHERE Actif_Listing=1 " & _ "ORDER BY 1 ASC " else strSQL = _ "SELECT r.ID_res AS vID, ID_Listing, Hidden_Listing,Open_Listing,Temp, Nom_Listing,motPasse, ID_TypeEntreprise, " & _ " chUnite,final, moRevenuBrut,AutresRev,AutresRev2,VacAutresRev,VacAutresRev2, moPrix,moTauxPerteVacance, v.MainListing, " & _ " (SELECT Nom_Lieu FROM tblLieu WHERE ID_Lieu = r.ID_Lieu) AS [Nom_Lieu], " & _ " 2 as vOrd " & _ "FROM (tblSUBResidence AS r " & _ " INNER JOIN tblVente AS v ON r.MainVente = v.ID_Vente) " & _ " INNER JOIN (SELECT * FROM tblListing WHERE Open2_Listing = 0) AS l ON v.MainListing = l.ID_Listing " & _ "WHERE Actif_Listing=1 " & _ "ORDER BY 1 ASC " end if Response.Write "" RS.Open strSQL, CNRS %>

LISTINGS ACCESSIBLES

    <% do while not RS.EOF nr=1 if RS.Fields("chUnite") > 49 then if (Not RS.Fields("Hidden_Listing")) and RS.Fields("vOrd") < 2 then %>
  • <% if RS.Fields("ID_TypeEntreprise") = 5 then %>TERRAIN<% Else %>RÉSIDENCE #<% end if if RS.Fields("Temp") then %>VF<% end if if RS.Fields("Open_Listing") <> 0 then Mach = 1 %> <%= ((RS.Fields("vID") +3000) Mod 1804) + RS.Fields("vID") %> <% if RS.Fields("vID") < 300 then Response.Write "Z" else if RS.Fields("vID") >1499 then Response.Write "H" else Response.Write "B" end if if Session("Userid")=1 then Response.Write "/" & RS.Fields("vID") end if else Mach =0 %><%=RS.Fields("vID")%> <% if RS.Fields("Hidden_Listing") then%>C<%end if %> <% end if if RS.Fields("MainListing") <> RS.Fields("ID_Listing") then Response.Write " (Projection)" end if %>

    <%if RS.Fields("Open_Listing") <> 0 then%> Mandat acheteur seulement
    <% end if%> <% RDB_AR2 = RS.Fields("AutresRev2") RDB_AR = RS.Fields("AutresRev") RDC_AR =0 RDC_AR2 =0 if RDB_AR = 111111 then RDB_AR =0 else RDC_AR = RDB_AR - RS.Fields("VacAutresRev") end if if RDB_AR2 = 111111 then RDB_AR2 =0 else RDC_AR2 = RDB_AR2 - RS.Fields("VacAutresRev2")end if if RS.Fields("vOrd") < 2 OR RS.Fields("chUnite") < 25 then Response.Write nr & ". Prix: " & FormatNumber(RS.Fields("moPrix") * MD, 0, , , True) & " " & SD& "
    " nr=nr+1 end if Response.Write nr & ". " & RS.Fields("Nom_Lieu") & "
    " nr=nr+1 if RS.Fields("ID_TypeEntreprise") = 2 then Response.Write "Immeuble Vacant
    " if RS.Fields("moRevenuBrut") > 0 then Response.Write nr & ". Revenu brut suggéré: " & FormatNumber((RS.Fields("moRevenuBrut")+RS.Fields("AutresRev")+RS.Fields("AutresRev2")) * MD, 0, , , True) & " " & SD & "
    " nr=nr+1 end if elseif RS.Fields("ID_TypeEntreprise") = 5 then Response.write "Terrain vacant
    " else if RS.Fields("Open_Listing") <> 0 then Response.Write nr & ". Revenu brut? : (514-644-4444)"& "
    " nr=nr+1 else Response.Write nr & ". Revenu brut: " & FormatNumber((RS.Fields("moRevenuBrut")+RDB_AR+RDB_AR2) * MD, 0, , , True) & " " & SD & "
    " nr=nr+1 end if end if %> <% tDette =0 vVal = 0 vVal2 = 0 vID = RS.Fields("ID_Listing") strSQL = " SELECT ID_TypePret, Hypotheque_cre, TauxInteret_cre, Mensuel_cre, Amortissement_cre,ID_TypeCreancier,Date_Solde,Date_Client" & _ " FROM tblCreancier" & _ " WHERE ID_Listing = " & RS.Fields("ID_Listing") & " AND (ID_TypePret = 1 or ID_TypePret = 2 or ID_TypePret = 4 )" RS2.Open strSQL, CNRS do while not RS2.EOF tDette = tDette + RS2.Fields("Hypotheque_cre") vVal2 = vVal2 + RS2.Fields("Mensuel_cre") taux = RS2.Fields("TauxInteret_cre") RS2.MoveNext loop RS2.Close RS2.Open " SELECT SUM(Valeur_Depense) as vRet FROM tblDepense WHERE Valeur_Depense <> 111111 and ID_Listing = " & vID, CNRS if not isnull(RS2.Fields(0)) then vVal = RS2.Fields(0) RS2.Close if RS.Fields("chUnite")>49 then norme1 = 75 norme2 = 85 else norme1 = 65 norme2 = 75 end if RDF_norme1 = CalculerMensualite(norme1*RS.Fields("moPrix")/ 100,25,taux)*12 RDF_norme2 = CalculerMensualite(norme2*RS.Fields("moPrix")/ 100,25,taux)*12 %> <% RS2.Open " SELECT SUM (Tarif)" & _ " FROM tblLoyers" & _ " WHERE Tarif <> 111111 and ID_Listing = " & vID,CNRS %> <% Occloyers = 12 * RS2.Fields(0) RS2.Close%> <% RS2.Open " SELECT SUM (Soin)" & _ " FROM tblLoyers" & _ " WHERE Soin <> 111111 and ID_Listing = " & vID,CNRS %> <% OccloyersSoins = 12 * RS2.Fields(0) RS2.Close%> <% if isnull(OccloyersSoins) then OccloyersSoins=0 end if%> <% if Occloyers <> 0 then RDB = Occloyers + OccloyersSoins else RDB = RS.Fields("moRevenuBrut") end if%> <% Vacantloyers = 0 RDC =0 RDC1=0 RS2.Open " SELECT SUM (Tarif)" & _ " FROM tblLoyers" & _ " WHERE Tarif <> 111111 and Vacante = 1 AND ID_Listing = " & vID,CNRS if not isnull(RS2.Fields(0)) then Vacantloyers = 12 * RS2.Fields(0) end if if not isnull(RS2.Fields(0)) then RDC = RDB - Vacantloyers else RDC=RDB end if RS2.Close RDB1 = RDB * RS.Fields("moTauxPerteVacance") RDC1 = RDB - RDB1 %> <% RDCT = RDC + RDC_AR +RDC_AR2 RDCT1 = RDC1 + RDC_AR +RDC_AR2 RDE = RDCT - vVal RDE1 = RDCT1 - vVal RDF = vVal2 * 12 %> <%if RDE <> 0 and RDF_norme1 <>0 then if RS.Fields("Open_Listing") = 0 then Response.Write nr & ". Net(avant hyp.) : " & FormatNumber(RDE1 * MD, 0, , , True) & " " & SD & "
    " nr=nr+1 end if %> <% dim BalanceAss0,AssHyp0 BalanceAss0 = 0 AssHyp0=0 strSQL = " SELECT Hypotheque_cre" & _ " FROM tblCreancier" & _ " WHERE ID_Listing = " & vID & " AND ID_TypePret = 2 " RS2.Open strSQL, CNRS do while not RS2.EOF BalanceAss0 = BalanceAss0 + RS2.Fields("Hypotheque_cre") RS2.MoveNext loop RS2.Close strSQL = " SELECT ID_TypePret, Hypotheque_cre,Hypotheque2_cre, TauxInteret_cre, Mensuel_cre, Amortissement_cre,ID_TypeCreancier,Date_Solde,Date_Client" & _ " FROM tblCreancier" & _ " WHERE ID_Listing = " & vID & " and ID_TypeCreancier<>20 AND ID_TypePret = 1 " RS2.Open strSQL, CNRS do while not RS2.EOF AssHyp0 = AssHyp0 + RS2.Fields("Hypotheque2_cre") RS2.MoveNext loop RS2.Close Response.Write nr & ". Mise de fonds (ref.) : " & FormatNumber((RS.Fields("moPrix")-BalanceAss0 -AssHyp0) * MD, 0, , , true) nr=nr+1%> $
    <% dim BalanceAss,AssHyp BalanceAss = 0 AssHyp=0 strSQL = " SELECT Hypotheque_cre" & _ " FROM tblCreancier" & _ " WHERE ID_Listing = " & vID & " AND ID_TypePret = 5 " RS2.Open strSQL, CNRS do while not RS2.EOF BalanceAss = BalanceAss + RS2.Fields("Hypotheque_cre") RS2.MoveNext loop RS2.Close strSQL = " SELECT ID_TypePret, Hypotheque_cre,Hypotheque2_cre, TauxInteret_cre, Mensuel_cre, Amortissement_cre,ID_TypeCreancier,Date_Solde,Date_Client" & _ " FROM tblCreancier" & _ " WHERE ID_Listing = " & vID & " and ID_TypeCreancier<>20 AND ID_TypePret = 3 " RS2.Open strSQL, CNRS do while not RS2.EOF AssHyp = AssHyp + RS2.Fields("Hypotheque2_cre") RS2.MoveNext loop RS2.Close Response.Write nr & ". Mise de fonds (ass.) : " & FormatNumber((RS.Fields("moPrix")-BalanceAss -AssHyp) * MD, 0, , , true) nr=nr+1 %> $
    <%Response.Write nr & ". Financement" nr=nr+1%>   /  <%Response.Write "Ratio c.d.d. "%>
    <% Response.Write ""& norme2& "%"%> --> <% Response.Write ""& FormatNumber(Div0(RDE,RDF_norme2), 2, , , true)%>
    <% Response.Write nr & ". MRN:  " nr=nr+1%> <%Response.Write FormatNumber(Div0(RS.Fields("moPrix"),RDE1), 2, , , true)&"(a1) /  "%> <%Response.Write FormatNumber(Div0(RS.Fields("moPrix"),RDE), 2, , , true)&"(a2)"%>
    <% Response.Write nr & ". TGA : " nr=nr+1%>   <%Response.Write FormatNumber(Div0(RDE,RS.Fields("moPrix"))*100, 2, , , true)%>%
    <% end if%>
    <% resid = RS.Fields("vID") if RS.Fields("vOrd") < 2 then %> &pid=False&ids=5251&mac=<%=lettreID() & lettreOpen(lettreID()) %>"> Fiche sommaire disponible Listing sommaire
    <% Dim dosC,myDate myDate =Year(Date())& deuxChiffre(Month(Date()))& deuxChiffre(Day(Date())+14) dosC=0 RS2.Open "select ID_Relation from tblRelation where ID_Ach = " & Session("Userid") &_ " and iD_TypeRelation =4 and Date_Relation > Date()-30 and ID_Listing = " & vID,CNRS if (RS2.EOF And RS2.BOF) then dosC=0 elseif not isnull(RS2.Fields(0)) then dosC = RS2.Fields(0) end if RS2.Close if dosC <>0 then %> &mtp=<%=myDate%>&ida=<%=Session("Userid")%>"> Fiche complète Listing complet (reçu)
    <%else %> <%if Isnull(RS.Fields("ID_Relation"))and Session("Userid")<> 1 then %> &resid=<% =RS.Fields("vID")%>&ids=<%=Session("Userid")%>&mac=<%=lettreVF(lettreID())& lettreID() & lettreOpen(lettreID()) %>"> <%elseif Session("Userid")=1 then%> &resid=<% =RS.Fields("vID")%>&usid=<% =RS.Fields("motPasse")%>&ids=<% =Session("Userid")%>&mac=<%=lettreVF(lettreID())& lettreID() & lettreOpen(lettreID()) %>"> <% elseif Mach =1 then %> &resid=<% =RS.Fields("vID")%>&ids=<% =Session("Userid")%>&ids2=111&mac=<%=lettreVF(lettreID())& lettreID() & lettreOpen(lettreID()) %>"> <%else %> &resid=<% =RS.Fields("vID")%>&ids=<% =Session("Userid")%>&mac=<%=lettreVF(lettreID())& lettreID() & lettreOpen(lettreID()) %>"> <%end if%> Fiche complète Listing complet (à demander)
    <% end if %> <% end if %> &idAch=<% =Session("Userid")%>"> Fiche complète Faites vos projections !
    <% if RS.Fields("vOrd") = 1 then if Isnull(RS.Fields("ID_Relation")) then %> Entente de confidentialité Entente de confidentialité
    <% else %>
    Entente de confidentialité
    Entente de confidentialité  (signée)<% end if end if %>
  • <%end if end if RS.MoveNext loop RS.Close %>
 
<%end if %> <% ' 25 - + terrain = ouvert, 25-50 partiel, 50+ locked Mach = 0 if Session("Perm") = 1 then strSQL = _ "SELECT DISTINCT r.ID_res AS vID, l.ID_Listing, Hidden_Listing,Open_Listing,Temp, Nom_Listing,motPasse, ID_TypeEntreprise, " & _ " chUnite,final, moRevenuBrut,AutresRev,AutresRev2,VacAutresRev,VacAutresRev2, moPrix,moTauxPerteVacance, v.MainListing, " & _ " (SELECT Nom_Lieu FROM tblLieu WHERE ID_Lieu = r.ID_Lieu) AS [Nom_Lieu], " & _ " IIF(w.ID_AccesWeb IS NULL, 2, 1) as vOrd , rel.ID_Relation, rel.Signer " & _ "FROM (((tblSUBResidence AS r " & _ " INNER JOIN tblVente AS v ON r.MainVente = v.ID_Vente) " & _ " INNER JOIN (SELECT * FROM tblListing WHERE Open2_Listing = 0) 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 & _ " )) " & _ " LEFT JOIN tblRelation AS rel ON ( " & _ " l.ID_Listing = rel.ID_Listing " & _ " AND rel.ID_TypeRelation = 3 AND rel.Signer = 1 " & _ " AND rel.ID_ach = " & Session("Userid") & " " strSQL = strSQL & _ " ) " & _ "WHERE Actif_Listing=1 " & _ "ORDER BY 1 ASC " else strSQL = _ "SELECT r.ID_res AS vID, ID_Listing, Hidden_Listing,Open_Listing,Temp, Nom_Listing,motPasse, ID_TypeEntreprise, " & _ " chUnite,final, moRevenuBrut,AutresRev,AutresRev2,VacAutresRev,VacAutresRev2, moPrix,moTauxPerteVacance, v.MainListing, " & _ " (SELECT Nom_Lieu FROM tblLieu WHERE ID_Lieu = r.ID_Lieu) AS [Nom_Lieu], " & _ " 2 as vOrd " & _ "FROM (tblSUBResidence AS r " & _ " INNER JOIN tblVente AS v ON r.MainVente = v.ID_Vente) " & _ " INNER JOIN (SELECT * FROM tblListing WHERE Open2_Listing = 0) AS l ON v.ID_Vente = l.ID_Vente " & _ "WHERE Actif_Listing=1 " & _ "ORDER BY 1 ASC " end if Response.Write "" RS.Open strSQL, CNRS %>

LISTINGS VISIBLES SANS ACCÈS CLIENT

    <% nr=1 do while not RS.EOF if RS.Fields("chUnite") >49 then if (Not RS.Fields("Hidden_Listing")) and RS.Fields("vOrd") = 2 then %>
  • <% if RS.Fields("ID_TypeEntreprise") = 5 then %>TERRAIN<% Else %>NouveauRÉSIDENCE #<% end if if RS.Fields("Temp") then %>VF<% end if if RS.Fields("Open_Listing") <> 0 then Mach = 1 %> <%= ((RS.Fields("vID") +3000) Mod 1804) + RS.Fields("vID") %> <% if RS.Fields("vID") < 300 then Response.Write "Z" else if RS.Fields("vID") >1499 then Response.Write "H" else Response.Write "B" end if if Session("Userid")=1 then Response.Write "/" & RS.Fields("vID") end if else Mach =0 %><%=RS.Fields("vID")%> <% if RS.Fields("Hidden_Listing") then%>C<%end if %> <% end if if RS.Fields("MainListing") <> RS.Fields("ID_Listing") then Response.Write " (Projection)" end if %>
    <%if RS.Fields("Open_Listing") <> 0 then%> Mandat acheteur seulement
    <%else %> Mandat R.P.
    <% end if%>

    <% RDB_AR2 = RS.Fields("AutresRev2") RDB_AR = RS.Fields("AutresRev") RDC_AR =0 RDC_AR2 =0 if RDB_AR = 111111 then RDB_AR =0 else RDC_AR = RDB_AR - RS.Fields("VacAutresRev") end if if RDB_AR2 = 111111 then RDB_AR2 =0 else RDC_AR2 = RDB_AR2 - RS.Fields("VacAutresRev2")end if %> <% tDette =0 vVal = 0 vVal2 = 0 vID = RS.Fields("ID_Listing") strSQL = " SELECT ID_TypePret, Hypotheque_cre, TauxInteret_cre, Mensuel_cre, Amortissement_cre,ID_TypeCreancier,Date_Solde,Date_Client" & _ " FROM tblCreancier" & _ " WHERE ID_Listing = " & RS.Fields("ID_Listing") & " AND (ID_TypePret = 1 or ID_TypePret = 2 or ID_TypePret = 4 )" RS2.Open strSQL, CNRS do while not RS2.EOF tDette = tDette + RS2.Fields("Hypotheque_cre") vVal2 = vVal2 + RS2.Fields("Mensuel_cre") taux = RS2.Fields("TauxInteret_cre") RS2.MoveNext loop RS2.Close RS2.Open " SELECT SUM(Valeur_Depense) as vRet FROM tblDepense WHERE Valeur_Depense <> 111111 and ID_Listing = " & vID, CNRS if not isnull(RS2.Fields(0)) then vVal = RS2.Fields(0) RS2.Close if RS.Fields("chUnite")>50 then norme1 = 75 norme2 = 85 else norme1 = 65 norme2 = 75 end if RDF_norme1 = CalculerMensualite(norme1*RS.Fields("moPrix")/ 100,25,taux)*12 RDF_norme2 = CalculerMensualite(norme2*RS.Fields("moPrix")/ 100,25,taux)*12 %> <% RS2.Open " SELECT SUM (Tarif)" & _ " FROM tblLoyers" & _ " WHERE Tarif <> 111111 and ID_Listing = " & vID,CNRS %> <% Occloyers = 12 * RS2.Fields(0) RS2.Close%> <% RS2.Open " SELECT SUM (Soin)" & _ " FROM tblLoyers" & _ " WHERE Soin <> 111111 and ID_Listing = " & vID,CNRS %> <% OccloyersSoins = 12 * RS2.Fields(0) RS2.Close%> <% if isnull(OccloyersSoins) then OccloyersSoins=0 end if%> <% if Occloyers <> 0 then RDB = Occloyers + OccloyersSoins else RDB = RS.Fields("moRevenuBrut") end if%> <% Vacantloyers = 0 RDC =0 RDC1=0 RS2.Open " SELECT SUM (Tarif)" & _ " FROM tblLoyers" & _ " WHERE Tarif <> 111111 and Vacante = 1 AND ID_Listing = " & vID,CNRS if not isnull(RS2.Fields(0)) then Vacantloyers = 12 * RS2.Fields(0) end if if not isnull(RS2.Fields(0)) then RDC = RDB - Vacantloyers else RDC=RDB end if RS2.Close RDB1 = RDB * RS.Fields("moTauxPerteVacance") RDC1 = RDB - RDB1 %> <% RDCT = RDC + RDC_AR +RDC_AR2 RDCT1 = RDC1 + RDC_AR +RDC_AR2 RDE = RDCT - vVal RDE1 = RDCT1 - vVal RDF = vVal2 * 12 %> <% BalanceAss0 = 0 AssHyp0=0 strSQL = " SELECT Hypotheque_cre" & _ " FROM tblCreancier" & _ " WHERE ID_Listing = " & vID & " AND ID_TypePret = 2 " RS2.Open strSQL, CNRS do while not RS2.EOF BalanceAss0 = BalanceAss0 + RS2.Fields("Hypotheque_cre") RS2.MoveNext loop RS2.Close strSQL = " SELECT ID_TypePret, Hypotheque_cre,Hypotheque2_cre, TauxInteret_cre, Mensuel_cre, Amortissement_cre,ID_TypeCreancier,Date_Solde,Date_Client" & _ " FROM tblCreancier" & _ " WHERE ID_Listing = " & vID & " and ID_TypeCreancier<>20 AND ID_TypePret = 1 " RS2.Open strSQL, CNRS do while not RS2.EOF AssHyp0 = AssHyp0 + RS2.Fields("Hypotheque2_cre") RS2.MoveNext loop RS2.Close %>
    <%Response.Write "Prix: " & FormatNumber(RS.Fields("moPrix") * MD, 0, , , True) & " " & SD nr=nr+1 %>
    <% Response.Write RS.Fields("Nom_Lieu") nr=nr+1 %>
    <% if RS.Fields("Open_Listing") <> 0 then Response.Write " Revenu brut ? : (514-644-4444)" nr=nr+1 else Response.Write " Revenu brut: " & FormatNumber((RS.Fields("moRevenuBrut")+RDB_AR+RDB_AR2) * MD, 0, , , True) & " " & SD nr=nr+1 end if %>
    <%if RDE <> 0 and RDF_norme1 <>0 then if RS.Fields("Open_Listing") = 0 then Response.Write " Net(avant hyp.) : " & FormatNumber(RDE1 * MD, 0, , , True) & " " & SD nr=nr+1 else Response.Write " Net(avant hyp.) ? : (514-644-4444)" end if %>
    <% Response.Write " Mise de fonds(ref.) : " & FormatNumber((RS.Fields("moPrix")-BalanceAss0 -AssHyp0) * MD, 0, , , true) nr=nr+1%> $
    <%Response.Write " Financement" nr=nr+1%>   /  <%Response.Write "Ratio c.d.d. "%>
    <% Response.Write ""& norme2& "%"%> --> <% Response.Write ""& FormatNumber(Div0(RDE,RDF_norme2), 2, , , true)%>
    <% Response.Write " MRN:  " nr=nr+1%> <%Response.Write FormatNumber(Div0(RS.Fields("moPrix"),RDE1), 2, , , true)&"(a1) /  "%> <%Response.Write FormatNumber(Div0(RS.Fields("moPrix"),RDE), 2, , , true)&"(a2)"%>
    <% Response.Write " TGA : " nr=nr+1%>   <%Response.Write FormatNumber(Div0(RDE,RS.Fields("moPrix"))*100, 2, , , true)%>%
    <% end if%> &pid=True&ids=5251&mac=<%=lettreID() & lettreOpen(lettreID()) %>"> Fiche sommaire disponible Listing sommaire
    &resid=<% =RS.Fields("vID")%>&ids=<%=Session("Userid")%>&mac=<%=lettreVF(lettreID())& lettreID() & lettreOpen(lettreID()) %>"> Fiche complète Listing complet
    Fiche complète Faites vos projections !
    Entente de confidentialité Entente de confidentialité
  • <%end if end if RS.MoveNext loop RS.Close %>
<% EndConnect %>
<%end if %>