<% Dim objRS, arrCSS, iCss, objCon, strSQL, formclass, strCSS, strCSS_4, strCSS_5 if request.queryString("do") <> "addnew" then set objCon = server.createobject("adodb.connection") objCon.open datastore if request.form <> "" or request.queryString <>"" then strSQL = "" if request.form("submit")="Add New!" then strSQL = " If not exists(SELECT * FROM pgd_CSS WHERE class='"&request.form("class")&"' AND browser="&request.form("browser")&") "&_ " Insert into pgd_CSS VALUES ('"&request.form("class")&"','"&Trim(SQLAccessInput(request.form("property")))&"',"&request.form("browser")&") " elseif request.queryString("do") = "delete" then strSQL = "DELETE FROM pgd_CSS WHERE classid="&request.queryString("class") else for each formclass in request.form If instr(formclass,"_browser") OR formclass="Apply" OR formclass="submit" then ' Browser radio, ignore else strSQL = strSQL & " Update pgd_css Set property='"&Trim(SQLAccessInput(request.form(formclass).item))&"',browser="&request.form(formclass&"_browser").item &" WHERE classid="&formclass&"; " End if next end if objCon.execute strSQL, , adcmdText+adExecuteNoRecords end if set objRS = server.createobject("adodb.recordset") With objRS .open "SELECT classid, class, property, browser FROM pgd_Css ORDER BY class", objCon, , , adCmdText if not (.eof and .bof) then arrCSS = .getrows .close End With set objRS = nothing objCon.close set objCon = nothing for iCSS = 0 to ubound(arrCSS,2) Select Case arrCSS(3,iCSS) Case 4 strCSS_4 = strCSS_4 & arrCSS(1,iCSS)&" {"&arrCSS(2,iCSS)&"}"&VBCRLF Case 5 strCSS_5 = strCSS_5 & arrCSS(1,iCSS)&" {"&arrCSS(2,iCSS)&"}"&VBCRLF Case ELSE strCSS = strCSS & arrCSS(1,iCSS)&" {"&arrCSS(2,iCSS)&"}"&VBCRLF End Select next Application.lock Application(dbName&"CSS") = strCSS Application(dbName&"CSS_4") = strCSS_4 Application(dbName&"CSS_5") = strCSS_5 Application.unlock end if %> Dynamic CSS : <%= OutputCSS() %>
Dynamic CSS :       Help

<% if request.queryString("do") = "addnew" then %> <% end if %> <% if isArray(arrCSS) then %> <% for iCss = 0 to ubound(arrCSS,2) %> <% next %> <% end if %>
Dynamic CSS Definition
>Class >Properties
valign="top"> >
All   4 Series   5+ Series
valign="top"><%= arrCSS(1,iCss) %> <%If arrCSS(3,iCss) <> "1" then Response.write " ("&arrCSS(3,iCss)&" Series)"%> >
>All   > 4 Series   > 5+ Series

<% if request.queryString("do") <> "addnew" then %> <% else %> <% end if %>

<% if request.queryString("do") <> "addnew" then %> <% end if %>
Final CSS Definition
colspan=2>

All browsers

<%= replace(replace(replace(Application(dbName&"css"),vbcrlf,"
"),"}","
}


"),"{","{
") %>

4 Series Browsers

<%= replace(replace(replace(Application(dbName&"css_4"),vbcrlf,"
"),"}","
}


"),"{","{
") %>

5+ Series Browsers

<%= replace(replace(replace(Application(dbName&"css_5"),vbcrlf,"
"),"}","
}


"),"{","{
") %>