% 'ezyEdit 1.0 '8-Mar-2001 'TODO: '# Allow multiple pages. Database is setup up for it. We now need to allow user ' to choose which page to edit and set it to tableid '# Fix input strings to allow "'" 'SETUP INSTRUCTIONS 'If there is more than one table, you need to set Session("tableid") = S where S is the table number. 'To add new templates, edit ' templateSelect.asp *** Shows the drop down box of all available templates ' templateShow.asp *** The output of each template. (What the end user sees... colours,fonts,style) ' templateEdit.asp *** Code the editor sees when they edit their page. 'which together stores the template generation code. 'Change "thispage" to the name of the file which includes ezyedit.asp eg ("products.asp") 'Create a login page or call eelogin.asp which sets Session("EditAccess") = true when password is correct. 'showtable.asp is called by the editable page (eg products.asp) using the following as an example ' ' <% Session("tableID") = 1 % > ' ' ' <% Session("tableID") = 2 % > ' ' ' 'Session("tableID") is the table number you want inserted. The closing tag for table number two 'is present only because table number 2 happens to use a
| Please complete the details to add to the "<%=rsHtmTable("title")%>" table. |
|
<%
Select Case act 'DO PROCESSING
Case "delete"
connVB.Execute("DELETE FROM TEMPLATES WHERE templateID =" & templateid)
response.write("Deleted Successfully")
Case "addatemplate"
strTextA = replace(request("textA"),"'","''")
strTextA = replace(strTextA, "", "")
strTextA = replace(strTextA, "", "")
SQL = "INSERT INTO TEMPLATES (templateType, htmtableID, orderpriority, textA, textB, textC, textD, textE, textF, imageA, imageB, imageC, imageD, imageE, imageF, classA, classB, classC, classD, classE, classF)"
SQL = SQL + " values ('" & request("type") & "', " & TableID & ", " & request("order") & ", '" & strTextA & "', '" & replace(request("textB"),"'","''") & "', '" & replace(request("textC"),"'","''") & "', '" & replace(request("textD"),"'","''") & "', '" & replace(request("textE"),"'","''") & "', '" & replace(request("textF"),"'","''") & "', '" & request("imageA") & "', '" & request("imageB") & "', '" & request("imageC") & "', '" & request("imageD") & "', '" & request("imageE") & "', '" & request("imageF") & "', '" & request("classA") & "', '" & request("classB") & "', '" & request("classC") & "', '" & request("classD") & "', '" & request("classE") & "', '" & request("classF") & "')"
'response.write SQL
connVB.Execute(SQL)
response.write("Added successfully!")
Case "updatetemplate"
strTextA = replace(request("textA"),"'","''")
strTextA = replace(strTextA, "", "")
strTextA = replace(strTextA, "", "")
SQL = "UPDATE TEMPLATES SET " & _
"templateType = '" & request("type") & "' ," & _
" htmtableID = " & tableid & "," & _
" orderpriority = " & request("order") & "," & _
" textA = '" & strTextA & "', " & _
" textB = '" & replace(request("textB"),"'","''") & "', " & _
" textC = '" & replace(request("textC"),"'","''") & "', " & _
" textD = '" & replace(request("textD"),"'","''") & "', " & _
" textE = '" & replace(request("textE"),"'","''") & "', " & _
" textF = '" & replace(request("textF"),"'","''") & "', " & _
" imageA = '" & request("imageA") & "', " & _
" imageB = '" & request("imageB") & "', " & _
" imageC = '" & request("imageC") & "', " & _
" imageD = '" & request("imageD") & "', " & _
" imageE = '" & request("imageE") & "', " & _
" imageF = '" & request("imageF") & "', " & _
" classA = '" & request("classA") & "', " & _
" classB = '" & request("classB") & "', " & _
" classC = '" & request("classC") & "', " & _
" classD = '" & request("classD") & "', " & _
" classE = '" & request("classE") & "', " & _
" classF = '" & request("classF") & "'" & _
" WHERE templateID = " & templateid
'response.write SQL
connVB.Execute(SQL)
response.write("Updated successfully!")
End Select
%>
X Logout and check changes OR open the VIEW page and hit the refresh Button to see changes. Please edit the contents of the "<%=rsHtmTable("title")%>" table |