<%response.Expires = 0 If Session("userlogin") = "" Then Response.Redirect "index.asp" Set Conn = Server.CreateObject("Adodb.Connection") Set rsTown = Server.CreateObject("Adodb.Recordset") dtpath = server.mappath("../dataarty/property.mdb") Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:database password=UNITEKANDUNITEKNET;Data Source=" & dtpath Conn.Open rsTown.open "TypeOfProperty", Conn, 1, 3 opp=Request.QueryString("opp") TownID=Request.QueryString("TownID") Town=Request.Form("Town") If opp=0 Then 'IDLE ElseIf opp=1 Then 'EDIT rsTown.Find "TypeID=" & clng(TownID) ElseIf opp=2 Then 'DELETE rsTown.Find "TypeID=" & clng(TownID) if not rsTown.Eof then Set rsProp=Server.CreateObject("Adodb.Recordset") rsProp.Open "Properties",Conn,1,3 rsProp.Find "TypeID=" & TownID msg=1 if rsProp.Eof Then rsTown.Delete rsTown.Update msg=0 End if end if if rsTown.RecordCount>0 Then rsTown.MoveFirst opp=0 ElseIf opp=3 Then 'UPDATE rsTown.Find "TypeID=" & clng(TownID) if not rsTown.Eof then rsTown("Type")=Town rsTown.Update end if rsTown.MoveFirst opp=0 ElseIf opp=4 Then 'ADD ElseIf opp=5 Then 'ADD_UPDATE rsTown.AddNew rsTown("Type")=Town rsTown.Update rsTown.MoveFirst opp=0 End if %> Property Types
Manage Property Types

Admin   Show All   Add Type   Print

<%If opp=0 Then%>
<%if rsTown.RecordCount>0 Then do until rsTown.eof%> <%rsTown.MoveNext:Loop end if%>
<%=rsTown("TypeID")%> <%=rsTown("Type")%> &opp=1">Edit &opp=2">Delete
<%if rsTown.RecordCount<1 Then%>There are no Property Types in the Database.<%end if%>
<%End If%> <%if opp=1 or opp=4 then%>
<%end if%>" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">

<%if opp<>4 then%>TownID: <%=rsTown("TypeID")%><%elseif opp=4 Then%>New<%end if%>

Type: <%end if%>">

<%end if%>

Admin   Show All   Add Type   Print

Copyright © 2003 UniTekNet. All rights reserved.