📄 admin_config_groupcats.asp
字号:
'## Forum_SQL
strSql = "DELETE FROM " & strTablePrefix & "GROUP_NAMES "
strSql = strSql & " WHERE GROUP_ID = " & cLng("0" & Request.Form("GroupID"))
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
strSql = "DELETE FROM " & strTablePrefix & "GROUPS "
strSql = strSql & " WHERE GROUP_ID = " & cLng("0" & Request.Form("GroupID"))
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><b>Category Group Deleted!</b></font></p>" & vbNewLine & _
" <meta http-equiv=""Refresh"" content=""1; URL=admin_config_groupcats.asp"">" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""admin_config_groupcats.asp"">Back To Group Categories Configuration</a></font></p>" & vbNewLine
else
'## Forum_SQL
strSql = "SELECT GROUP_ID, GROUP_NAME "
strSql = strSql & " FROM " & strTablePrefix & "GROUP_NAMES "
strSql = strSql & " WHERE GROUP_ID <> 1 "
strSql = strSql & " AND GROUP_ID <> 2 "
strSql = strSql & " ORDER BY GROUP_NAME ASC "
Set rsgroups = Server.CreateObject("ADODB.Recordset")
rsgroups.Open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
If rsgroups.EOF then
recGroupCount = ""
Else
allGroupData = rsgroups.GetRows(adGetRowsRest)
recGroupCount = UBound(allGroupData, 2)
End if
rsgroups.Close
Set rsgroups = Nothing
Response.Write " <script language=""JavaScript"" type=""text/javascript"">" & vbNewLine & _
" <!--" & vbNewLine & _
" function confirmDelete(){" & vbNewLine & _
" var where_to= confirm(""Do you really want to Delete this Group Category?"", ""Yes"", ""No"");" & vbNewLine & _
" if (where_to)" & vbNewLine & _
" return true;" & vbNewLine & _
" else" & vbNewLine & _
" return false;" & vbNewLine & _
" }" & vbNewLine & _
" //-->" & vbNewLine & _
" </script>" & vbNewLine
Response.Write " <form action=""admin_config_groupcats.asp?method=Delete"" method=""post"" id=""Add"" name=""Add"">" & vbNewLine & _
" <input type=""hidden"" name=""Method_Type"" value=""Delete_Category"">" & vbNewLine & _
" <table border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table width=""100%"" align=""center"" border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"" bgcolor=""" & strCategoryCellColor & """ colspan=""2""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Delete Group Categories</font></b></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine
if recGroupCount <> "" then
Response.Write " <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <b>Choose Group To Delete:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" <select name=""GroupID"" size=""1"">" & vbNewLine
for iGroup = 0 to recGroupCount
Response.Write " <option value=""" & allGroupData(0, iGroup) & """" & chkSelect(cLng(group),cLng(allGroupData(0,iGroup))) & ">" & chkString(allGroupData(1, iGroup),"display") & "</option>" & vbNewLine
next
Response.Write " </select>" & vbNewLine & _
" </font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ valign=""middle"" align=""center"" colspan=""2"" nowrap><input class=""button"" value="" Delete "" type=""submit"" onClick=""return confirmDelete()""> <input name=""Reset"" type=""reset"" value=""Reset""></td>" & vbNewLine
else
Response.Write " <td bgColor=""" & strPopUpTableColor & """ align=""center"" colspan=""2"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <b><i>No Groups Available To Delete</i></b> </font></td>" & vbNewLine
end if
Response.Write " </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </form>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""admin_config_groupcats.asp"">Back To Group Categories Configuration</a></font></p>" & vbNewLine
end if
Case "Edit"
if Request.Form("Method_Type") = "Write_Configuration" then
txtGroupName = chkString(Request.Form("strGroupName"),"SQLString")
txtGroupDescription = chkString(Request.Form("strGroupDescription"),"message")
txtGroupIcon = chkString(Request.Form("strGroupIcon"),"SQLString")
txtGroupTitleImage = chkString(Request.Form("strGroupTitleImage"),"SQLString")
if trim(txtGroupName) = "" then
Err_Msg = Err_Msg & "<li>You Must Enter a Name for your New Group.</li>"
end if
if trim(txtGroupDescription) = "" then
Err_Msg = Err_Msg & "<li>You Must Enter a Description for your New Group.</li>"
end if
if Err_Msg = "" then
'## Forum_SQL - Do DB Update
strSql = "UPDATE " & strTablePrefix & "GROUP_NAMES "
strSql = strSql & " SET GROUP_NAME = '" & txtGroupName & "'"
strSql = strSql & ", GROUP_DESCRIPTION = '" & txtGroupDescription & "'"
strSql = strSql & ", GROUP_ICON = '" & txtGroupIcon & "'"
strSql = strSql & ", GROUP_IMAGE = '" & txtGroupTitleImage & "'"
strSql = strSql & " WHERE GROUP_ID = " & cLng("0" & Request.Form("GROUP_ID"))
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
updateGroupCategories(Request.Form("GROUP_ID"))
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Category Group Updated!</font></p>" & vbNewLine & _
" <meta http-equiv=""Refresh"" content=""2; URL=admin_config_groupcats.asp"">" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Congratulations!</font></p>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""admin_config_groupcats.asp"">Back To Group Categories Configuration</a></font></p>" & vbNewLine
else
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
" <table align=""center"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Correct The Problem</a></font></p>" & vbNewLine
end if
elseif Request.Form("Method_Type") = "Edit_Category" then
if Request.Form("GroupID") <> "" then
'## Forum_SQL
strSql = "SELECT GROUP_ID, GROUP_NAME, GROUP_DESCRIPTION, GROUP_ICON, GROUP_IMAGE "
strSql = strSql & " FROM " & strTablePrefix & "GROUP_NAMES "
strSql = strSql & " WHERE GROUP_ID = " & cLng("0" & Request.Form("GroupID"))
set rsGroups = Server.CreateObject("ADODB.Recordset")
rsGroups.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rsGroups.EOF then
recGroupCnt = ""
else
allGroupData = rsGroups.GetRows(adGetRowsRest)
recGroupCnt = UBound(allGroupData,2)
gGROUP_ID = 0
gGROUP_NAME = 1
gGROUP_DESCRIPTION = 2
gGROUP_ICON = 3
gGROUP_IMAGE = 4
end if
rsGroups.close
set rsGroups = nothing
if recGroupCnt <> "" then
txtGroupID = allGroupData(gGROUP_ID,0)
txtGroupName = allGroupData(gGROUP_NAME,0)
txtGroupDescription = allGroupData(gGROUP_DESCRIPTION,0)
txtGroupIcon = allGroupData(gGROUP_ICON,0)
txtGroupTitleImage = allGroupData(gGROUP_IMAGE,0)
Response.Write " <form action=""admin_config_groupcats.asp?method=Edit"" method=""post"" id=""Edit"" name=""Edit"">" & vbNewLine & _
" <input type=""hidden"" name=""Method_Type"" value=""Write_Configuration"">" & vbNewLine & _
" <input type=""hidden"" name=""GROUP_ID"" value=""" & txtGroupID & """>" & vbNewLine & _
" <table border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table width=""100%"" align=""center"" border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"" bgcolor=""" & strCategoryCellColor & """ colspan=""2""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Edit Existing Category Group</font></b></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <b>Group Name:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""left""><input maxLength=""50"" name=""strGroupName"" value=""" & txtGroupName & """ tabindex=""1"" size=""46""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""top"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <b>Group Description:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""left""><textarea rows=""5"" cols=""35"" name=""strGroupDescription"" maxLength=""255"" tabindex=""2"">" & txtGroupDescription & "</textarea></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <b>Group Icon:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""left""><input maxLength=""255"" name=""strGroupIcon"" value=""" & txtGroupIcon & """ tabindex=""3"" size=""46""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <b>Group Title Image:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""left""><input maxLength=""255"" name=""strGroupTitleImage"" value=""" & txtGroupTitleImage & """ tabindex=""4"" size=""46""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <b>Categories:</b> </font></td>" & vbNewLine
strSql = "SELECT CAT_ID, CAT_NAME "
strSql = strSql & " FROM " & strTablePrefix & "CATEGORY "
strSql = strSql & " ORDER BY CAT_NAME ASC "
set rsCats = Server.CreateObject("ADODB.Recordset")
rsCats.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rsCats.EOF then
recCatCnt = ""
else
allCatData = rsCats.GetRows(adGetRowsRest)
recCatCnt = UBound(allCatData,2)
cCAT_ID = 0
cCAT_NAME = 1
end if
rsCats.close
set rsCats = nothing
tmpStrUserList = ""
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -