%
dim dsn
dim objConn
dim loginRec
dim i
dim command
dim lastId
if session("access") <> "9" then
response.redirect("http://www.machinedevice.com")
end if
part = request("part")
id = int(request("id"))
text = ""
if part = "Cancel" then
response.redirect("http://www.machinedevice.com/billboard.asp")
end if
if part = "Save" then
dsn="DBQ=" & Server.Mappath("md.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open dsn
Set billboardRec = Server.CreateObject("ADODB.Recordset")
billboardRec.Open "select * from billboard where id = " & id, objConn, 1, 2
billboardRec("txt") = request("text")
billboardRec("color") = request("color")
billboardRec("attrib") = request("attrib")
billboardRec("face") = request("face")
billboardRec.update
billboardRec.close
set billboardRec = nothing
set objConn = nothing
response.redirect("http://www.machinedevice.com/billboard.asp")
end if
if part = "add" then
dsn="DBQ=" & Server.Mappath("md.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open dsn
Set billboardRec = Server.CreateObject("ADODB.Recordset")
billboardRec.Open "select * from billboard order by id DESC", objConn, 1, 2
while not billboardRec.EOF
response.write(billboardRec("id") & "
")
if billboardRec("id") >= id then
response.write(billboardRec("id") & "
")
billboardRec("id") = billboardRec("id") + 1
billboardRec.update
end if
billboardRec.moveNext
wend
billboardRec.AddNew()
billboardRec("id") = id
billboardRec("color") = "Red"
billboardRec("size") = 4
billboardRec("face") = "Arial, sans-serif"
billboardRec("attrib") = "b"
billboardRec("txt") = ""
billboardRec("leftlogo") = ""
billboardRec("rightlogo") = ""
billboardRec.update
billboardRec.close
set billboardRec = nothing
set objConn = nothing
response.redirect("http://www.machinedevice.com/billboard.asp")
end if
if part = "delete" then
dsn="DBQ=" & Server.Mappath("md.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open dsn
Set billboardRec = Server.CreateObject("ADODB.Recordset")
billboardRec.Open "DELETE * FROM billboard WHERE id=" & id, objConn, 1, 2
set billboardRec = nothing
set objConn = nothing
response.redirect("http://www.machinedevice.com/billboard.asp")
end if
if part = "text" then
dsn="DBQ=" & Server.Mappath("md.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open dsn
Set billboardRec = Server.CreateObject("ADODB.Recordset")
billboardRec.Open "select * from billboard where id = " & id, objConn, 1, 2
text = billboardRec("txt")
color = billboardRec("color")
size = billboardRec("size")
face = billboardRec("face")
attrib = billboardRec("attrib")
billboardRec.close
set billboardRec = nothing
set objConn = nothing
end if
%>
|
|||||
<% if part = "text" then %> <% end if %> <% if part = "leftlogo" or part="rightlogo" then %> <% end if %> |
|||||
|