<% ' ********************************************************************** ' * ' * 762 10/13/2007 corrected format of owner city state zip ' * 713 04/28/2007 police report ' * ' * ' ********************************************************************** ' ***** Initialize Query ***** Dim ConnStr Dim Conn Dim rs Dim SQL Dim CaseID Dim ClientID Dim AgentID Dim Lname Dim Fname Dim Addr1 Dim Addr2 Dim City Dim State Dim Zip Dim Year Dim Make Dim Model Dim Plate Dim PlateState Dim PlateExp Dim VIN Dim ClientName Dim Lienholder Dim c Dim PoliceID Dim PoliceNbr Dim PoliceCity Dim RepoDate Dim StorageLoc Dim PDlname Dim PDaddr1 Dim PDaddr2 Dim PDcity Dim PDstate Dim PDzip Dim strErrorMsg Dim UserClass Dim UserType Dim Comment ' Company Information Dim CompName Dim CompAddr1 Dim CompCity Dim CompState Dim CompZip Dim CompPhone Dim CompStateNbr ' On Error Resume Next strErrorMsg = "" CaseID = Request.QueryString("CaseID") CaseID = trim(CaseID) ' *************************************** ' Connect to Database ' *************************************** connectdb If Err.number <> 0 Then strErrorMsg = strErrorMsg & "305. Error Unable to connect to database.
" Err.Clear End If ' *************************************** ' Select Company Information ' *************************************** if strerrormsg = "" then SQL = "SELECT Name, " SQL = SQL & "Addr1, " SQL = SQL & "City, " SQL = SQL & "State, " SQL = SQL & "Zip, " SQL = SQL & "Phone, " SQL = SQL & "StateNbr " SQL = SQL & "FROM Company " ' ***** Run Query ***** Set rs = Conn.Execute(SQL) If Err.number <> 0 Then strErrorMsg = strErrorMsg & "Error Unable to read company information.
" Err.Clear End If end if if strerrormsg = "" then if Not rs.EOF then if NOT isnull(rs.fields("Name")) then CompName = rs.fields("Name") end if if NOT isnull(rs.fields("Addr1")) then CompAddr1 = rs.fields("Addr1") end if if NOT isnull(rs.fields("City")) then CompCity = rs.fields("City") end if if NOT isnull(rs.fields("State")) then CompState = rs.fields("State") end if if NOT isnull(rs.fields("Zip")) then CompZip = rs.fields("Zip") end if if NOT isnull(rs.fields("Phone")) then CompPhone = rs.fields("Phone") end if if NOT isnull(rs.fields("StateNbr")) then CompStateNbr = rs.fields("StateNbr") else CompStateNbr = "" end if On Error Resume Next on error goto 0 end if rs.close set rs = nothing end if ' *************************************** ' Select Case Information ' *************************************** if strerrormsg = "" then SQL = "SELECT C.CaseID, " SQL = SQL & "C.Agent, " SQL = SQL & "R1.Lname, " SQL = SQL & "R1.Fname, " SQL = SQL & "R1.Addr1, " SQL = SQL & "R1.Addr2, " SQL = SQL & "R1.City, " SQL = SQL & "R1.State, " SQL = SQL & "R1.Zip, " SQL = SQL & "C.Year, " SQL = SQL & "C.Make, " SQL = SQL & "C.Model, " SQL = SQL & "C.Plate, " SQL = SQL & "C.PlateState, " SQL = SQL & "C.PlateExp, " SQL = SQL & "C.VIN, " SQL = SQL & "C.Lienholder, " SQL = SQL & "C.PoliceNbr, " SQL = SQL & "C.PoliceCity, " SQL = SQL & "C.PoliceID, " SQL = SQL & "C.RepoDate, " SQL = SQL & "C.StorageLoc, " SQL = SQL & "R3.Lname as ClientLname, " SQL = SQL & "R3.ID as ClientID " SQL = SQL & "FROM tCase C, Rdex R1, Rdex R3 " SQL = SQL & "Where CaseID = " & CaseID & " " SQL = SQL & "AND C.CaseID = R1.ID " SQL = SQL & "AND R1.MasterID = R3.ID " ' ***** Run Query ***** Set rs = Conn.Execute(SQL) If Err.number <> 0 Then strErrorMsg = strErrorMsg & "Error Unable to read assignment information.
" Err.Clear End If end if if strerrormsg = "" then if Not rs.EOF then CaseID= rs.fields("CaseID") AgentID= rs.fields("Agent") ClientID= rs.fields("ClientID") if isnull(rs.fields("Lname")) then Lname = " " else Lname= rs.fields("Lname") end if if isnull(rs.fields("Fname")) then Fname = " " else Fname= rs.fields("Fname") end if if isnull(rs.fields("Addr1")) then addr1 = " " else Addr1= rs.fields("Addr1") end if if isnull(rs.fields("Addr2")) then addr2 = "" else Addr2= rs.fields("Addr2") end if if isnull(rs.fields("City")) then City = " " else City= rs.fields("City") end if if isnull(rs.fields("State")) then State = " " else State= rs.fields("State") end if if isnull(rs.fields("Zip")) then Zip = " " else Zip= rs.fields("Zip") end if if isnull(rs.fields("Year")) then Year = " " else Year= rs.fields("Year") end if if isnull(rs.fields("Make")) then Make = " " else Make= rs.fields("Make") end if if isnull(rs.fields("Model")) then Model = " " else Model= rs.fields("Model") end if if isnull(rs.fields("Plate")) then Plate = " " else Plate= rs.fields("Plate") end if if isnull(rs.fields("PlateState")) then PlateState = "" else PlateState= rs.fields("PlateState") end if if isnull(rs.fields("PlateExp")) then PlateExp = "" else PlateExp = rs.fields("PlateExp") end if if isnull(rs.fields("VIN")) then VIN = " " else VIN= rs.fields("VIN") end if if isnull(rs.fields("PoliceNbr")) then PoliceNbr = " " else PoliceNbr = rs.fields("PoliceNbr") end if if isnull(rs.fields("PoliceCity")) then PoliceCity = " " else PoliceCity = rs.fields("PoliceCity") end if if isnull(rs.fields("PoliceID")) then PoliceID = " " else PoliceID = rs.fields("PoliceID") end if if isnull(rs.fields("RepoDate")) then RepoDate = " " else RepoDate = rs.fields("RepoDate") end if if isnull(rs.fields("StorageLoc")) then StorageLoc = " " else StorageLoc = rs.fields("StorageLoc") end if if isnull(rs.fields("ClientLName")) then ClientName = " " else ClientName= rs.fields("ClientLName") end if if isnull(rs.fields("Lienholder")) then Lienholder = ClientName ClientName = "" else Lienholder = rs.fields("Lienholder") end if end if rs.close set rs = nothing end if ' *************************************** ' Select Agent Information ' *************************************** if strerrormsg = "" then strAgentName = "" if Session("UserType") = 3 then strAgentName = Session("FullName") else if AgentID > 0 then SQL = "SELECT " SQL = SQL & "R2.Lname as AgentLname, " SQL = SQL & "R2.Fname as AgentFname " SQL = SQL & "FROM Rdex R2 " SQL = SQL & "Where R2.ID = " & AgentID & " " SQL = SQL & "AND R2.type = '4' " ' ***** Run Query ***** Set rs = Conn.Execute(SQL) If Err.number <> 0 Then strErrorMsg = strErrorMsg & "306. Error Unable to read assignment information.
" Err.Clear End If if Not rs.EOF then strAgentName = rs.fields("AgentLname") if rs.fields("AgentFname") > "" then strAgentName = strAgentName & ", " & rs.fields("AgentFname") end if end if rs.close set rs = nothing end if end if end if ' *************************************** ' Select Police Dept Information ' *************************************** SQL = "SELECT " SQL = SQL & "Lname, " SQL = SQL & "Addr1, " SQL = SQL & "Addr2, " SQL = SQL & "City, " SQL = SQL & "State, " SQL = SQL & "Zip " SQL = SQL & "FROM Rdex " SQL = SQL & "Where ID = " & PoliceID & " " SQL = SQL & "AND Type = 'P' " ' ***** Run Query ***** Set rs = Conn.Execute(SQL) If Err.number <> 0 Then strErrorMsg = strErrorMsg & "Error: Unable to police address information.
" Err.Clear End If if Not rs.EOF then if isnull(rs.fields("Lname")) then PDlname = " " else PDlname= rs.fields("Lname") end if if isnull(rs.fields("Addr1")) then PDAddr1 = " " else PDAddr1= rs.fields("Addr1") end if if isnull(rs.fields("Addr2")) then PDAddr2 = "" else PDAddr2 = rs.fields("Addr2") end if if isnull(rs.fields("City")) then PDCity = " " else PDCity = rs.fields("City") end if if isnull(rs.fields("State")) then PDState = " " else PDState = rs.fields("State") end if if isnull(rs.fields("Zip")) then PDZip = " " else PDZip = rs.fields("Zip") end if end if rs.close set rs = nothing ' *********************************************************************** ' ** Begin Html ' *********************************************************************** if strerrormsg = "" then %> Case: <%=Cstr(CaseID)%>
<%=CompName%>
<%=CompAddr1%>
<% if trim(Compaddr2) > "" then %> <%=CompAddr2%>
<% end if %> <%=CompCity%>, <%=CompState%>  <%=CompZip%>
<%=Compphone%>
<%=CompStateNbr%>

VEHICLE REPOSSESSION POLICE REPORT

<%=FormatDateTime(Date)%>

<%=PDlname%>
<%=PDaddr1%>
<% if trim(PDaddr2) > "" then %> <%=PDAddr2%>
<% end if %> <%=PDCity%>, <%=PDState%>  <%=PDZip%>

ATTN: Vehicle Records

RE: File# <%=PoliceNbr%>or Name of officer notified and/or badge #<%=PoliceCity%>


<% if CompState = "CA" then %> In compliance with Section 28, California Vehicle Code, the following information is submitted regarding a repossessed vehicle from your jurisdiction: <% else %> The following information is submitted regarding a repossessed vehicle from your jurisdiction: <% end if %>

DATE/TIME OF REPOSSESSION: <%=FormatDateTime(RepoDate,2)%>  <%=FormatDateTime(RepoDate,3)%>
REPOSSESSOR: <%=strAgentName%>
VEHICLE YEAR/MAKE/MODEL: <%=Cstr(year)%>   <%=Make%>  <%=Model%>
LICENSE PLATE (STATE & exp): <%=Plate%> <% if PlateState > "" then %> -<%=PlateState%> <% end if %> <% if PlateExp > "" then %> (<%=PlateExp%>) <% end if %>
VEHICLE IDENTIFICATION NUMBER: <%=VIN%>
CASE ID: <%=CaseID%>
REGISTERED OWNER: <%=lname%>, <%=fname%>
<%=Addr1%>
<% if addr2 > "" then %> <%=Addr2%>
<% end if %> <%=City%>, <%=State%>  <%=Zip%>
ASSIGNOR/LIENHOLDER: <% if Leinholder > "" then %> <%=Lienholder%>
<% end if %> <%=ClientName%>
STORAGE LOCATION: <%=StorageLoc%>
ADDITIONAL REMARKS:  
<% ' *********************************************************************** ' ** End Html ' *********************************************************************** end if conn.close set conn = nothing if strErrorMsg > "" then ShowError(strErrorMsg) end if %>