<%@ Language=VBScript %> <% Option Explicit %> <% 'Open connection string using App variable Dim con, rs, SQL Set rs=Server.CreateObject("ADODB.Recordset") Set con=Server.CreateObject("ADODB.Connection") con.Open Application("TMAConnectString") 'DONT FORGET TO CLOSE con!! Function QAGrabber(str,MaxChars,QAType) QAGrabber=iif(Len(str)<=MaxChars, str, Left(str, InStr(MaxChars, str & " ", " "))) If Len(str) >= MaxChars then 'add ellipses If QAType="Q" then If Right(str,1) = "?" then QAGrabber=Left(QAGrabber,Len(QAGrabber)-1) & "...?" Else QAGrabber=QAGrabber & "..." End If Else QAGrabber=QAGrabber & "..." End If End If End Function Public Sub CreateQuestionTable(rs) Dim i, sQuestion, sAnswer, QAClass QAClass="QAWhite" Response.Write("" & vbCrLf) If rs.EOF then Response.Write("" & vbCrLf) Else i=1 Do While i<=5 and Not rs.EOF Response.Write("" & vbCrLf) If Right(sQuestion,3) = "..." or Right(sQuestion,4) = "...?" or Right(sAnswer,3)="..." then Response.Write("" & vbCrLf & "" & vbCrLf) End If Else Response.Write("
") Response.Write("   Q: " & sQuestion & "" & vbCrLf) If rs("Type") <> "ToTMA" then Response.Write("" & vbCrLf & "" & vbCrLf) End If End If rs.MoveNext If QAClass="QAWhite" then QAClass="QAGray" Else QAClass="QAWhite" End If i=i+1 Loop End If Response.Write("
No questions found.
" & rs("QuestionDate") & "" & vbCrLf) sQuestion=QAGrabber(rs("Question"),50,"Q") If Len(rs("Answer"))>1 then Response.Write("(answered: " & rs("AnswerDate") & ")
") Response.Write("   Q: " & sQuestion & "
" & vbCrLf) sAnswer=QAGrabber(rs("Answer"),50,"A") Response.Write("   A: " & sAnswer & vbCrLf) Response.Write("
See entire
question
Answer
question
" & vbCrLf) End Sub %> The Modular Advantage: Client Area <% Else %>

No pictures found.

<% End If rs.Close %>
     

Welcome, <%=Session("FName") & "!"%>

Welcome to your very own, personalized New Homeowner's page!  On this page, you will be able to quickly check on the status of your new home, to see the latest photo of your home, and to ask/answer questions about the process.

Latest Photo of Your Home

<% Dim Width, Height, bScrollable 'Get ProjectPics RS SQL="SELECT * FROM ProjectPics WHERE ProjectID=" & Session("ProjID") _ & " ORDER BY PicDate DESC" rs.open SQL, con If Not rs.EOF then 'Set up parameters for popup photo window based on actual pic dimensions Width=rs("PicWidth") + 40 Height=rs("PicHeight") + 75 If Height>550 then Height=550 bScrollable="Yes" Else bScrollable="No" End If %>

','','width=<%=Width%>,height=<%=Height%>,scrollbars=<%=bScrollable%>')">" alt="<%=rs("PicCaption")%>" width="<%=rs("TNWidth")%>" height="<%=rs("TNHeight")%>" border="0" />
Enlarge This Picture

<% 'Get contractors RS SQL= "SELECT Subcontractors.FName, Subcontractors.LName, Subcontractors.PicFileName, " _ & "Subcontractors.PicHeight, Subcontractors.PicWidth, Electrician.PicFileName, Electrician.FName, " _ & "Electrician.LName, Electrician.PicHeight, Electrician.PicWidth, ZZZ.FName, ZZZ.LName, " _ & "ZZZ.PicFileName, ZZZ.PicHeight, ZZZ.PicWidth " _ & "FROM ((Projects LEFT JOIN Subcontractors ON Projects.SubcontractorID = Subcontractors.ID) " _ & "LEFT JOIN Subcontractors AS Electrician ON Projects.ElectricianID = Electrician.ID) " _ & "LEFT JOIN Subcontractors AS ZZZ ON Projects.ZZZID = ZZZ.ID " _ & "WHERE Projects.ID=" & Session("ProjID") rs.open SQL, con %>
Your Sub-contractors

Modular Advantage
" width="<%=rs("Subcontractors.PicWidth")%>" height="<%=rs("Subcontractors.PicHeight")%>" />
<%=rs("Subcontractors.FName")%>
<%=rs("Subcontractors.LName")%>
" width="<%=rs("Electrician.PicWidth")%>" height="<%=rs("Electrician.PicHeight")%>" />
<%=rs("Electrician.FName")%>
<%=rs("Electrician.LName")%>
" width="<%=rs("ZZZ.PicWidth")%>" height="<%=rs("ZZZ.PicHeight")%>" />
<%=rs("ZZZ.FName")%>
<%=rs("ZZZ.LName")%>
<% rs.Close %>
     
<% 'Get ToTMA Questions RS SQL= "SELECT * FROM Questions WHERE ProjectID=" & Session("ProjID") & " AND Type='ToTMA' " _ & " ORDER BY QuestionDate DESC" rs.open SQL, con %>
Questions & Answers
Recent Questions to TMA   Submit a New Question
">VIEW ALL QUESTIONS to make sure there aren't any outstanding, unaddressed issues.
<% CreateQuestionTable rs rs.Close %>  
"> ">

Recent Questions to You    
<% 'Get ToClient Questions RS SQL= "SELECT * FROM Questions WHERE ProjectID=" & Session("ProjID") & " AND Type='ToClient'" _ & " ORDER BY QuestionDate DESC" rs.open SQL, con CreateQuestionTable rs rs.Close %>    
 

  modular@modularadvantage.com