<% '################################################################################# '## Copyright (C) 2000 Michael Anderson '## '## This program is free software; you can redistribute it and/or '## modify it under the terms of the GNU General Public License '## as published by the Free Software Foundation; either version 2 '## of the License, or any later version. '## '## All copyright notices regarding Snitz Forums 2000 '## must remain intact in the scripts and in the outputted HTML '## The "powered by" text/logo with a link back to '## http://forum.snitz.com in the footer of the pages MUST '## remain visible when the pages are viewed on the internet or intranet. '## '## This program is distributed in the hope that it will be useful, '## but WITHOUT ANY WARRANTY; without even the implied warranty of '## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '## GNU General Public License for more details. '## '## You should have received a copy of the GNU General Public License '## along with this program; if not, write to the Free Software '## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. '## '## Support can be obtained from support forums at: '## http://forum.snitz.com '## '## Correspondence and Marketing Questions can be sent to: '## reinhold@bigfoot.com '## '## or '## '## Snitz Communications '## C/O: Michael Anderson '## PO Box 200 '## Harpswell, ME 04079 '################################################################################# '--------------------------------------------------------------------------------------- 'Name Of File : classadmin.asp 'Author : Alan Le (alanle2000@hotmail.com) 'Description : Category admin (add/edit) ' Classified Ads Mod for Snitz Forum 3.1 sr 4 'Created : 1/24/2001 'Modifications ' mm/dd/yyyy - : ' 1) : ' 2) : '--------------------------------------------------------------------------------------- %>
 All Forums
 Classifieds Categories
 Classifieds Categories Admin

<% if mlev <> 4 then Response.Redirect("classifieds.asp") end if dim Category, sMode Category = Request.Form("Category") sMode = Request.QueryString("mode") select case Request.Form("method") case "doAdd" if category = "" then Response.Write "
You Need to have a category name
" else Call DoInsert end if case "doEdit" if category = "" then Response.Write "
You Need to have a category name
" else Call DoUpdate end if case else strSQL="SELECT ID, Category_Name, Description FROM " & strTablePrefix & "ADS_CATEGORY order by category_name" dim rs set rs = server.CreateObject("adodb.recordset") rs.open strSQL, my_Conn Response.Write("
") if sMode = "edit" then%> "> <%else%> <%end if%>
<% if sMode = "edit" then rs.Close strSQL="SELECT ID, Category_Name, Description FROM " & strTablePrefix & "ADS_CATEGORY" strSQL = strSQL & " WHERE ID = " & Request.QueryString("id") rs.open strSQL, my_Conn end if %>
<%= strForumTitle %> Classifieds
Existing Categories  
Category Name:  
Category Description:   
   " id=SUBMIT1 name=SUBMIT1>
<% Response.Write("") rs.Close Set rs = Nothing %>
<% end select WriteFooter Sub DoInsert strSQL = "INSERT INTO " & strTablePrefix & "ADS_CATEGORY (Category_Name, Description) VALUES ('" & chkString(Category, "SQLString") & "', '" & request.form("CategoryDescription") & "')" my_Conn.Execute(strSQL) Response.Write("

Your Category has been successfully added.
") Response.Write("Click here to continue admin functions.
") End Sub Sub DoUpdate strSQL = "UPDATE " & strTablePrefix & "ADS_CATEGORY set Category_Name = '" & chkString(Category, "SQLString") & "', Description = '" & request.form("CategoryDescription") & "'" strSQL = strSQL & " where id = " & Request.Form("id") my_Conn.Execute(strSQL) Response.Write("

Your Category has been successfully updated.
") Response.Write("Click here to continue admin functions.
") End Sub %>