⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cat_setting.asp

📁 blog 程序 DIV BLOG 0.6 Readme [ http://www.IamTing.com ] DIV BLOG 0.6版更新说明 =====================
💻 ASP
字号:
<!--#include file="../conn.asp" -->
<!--#include file="admin_lib.asp" -->
<%
'==============================
if not instr(1,Request.ServerVariables("http_Referer"),Request.ServerVariables ("SERVER_NAME"),1)=8 then
message "DLOG错误:提交的数据来自网站外部"
response.end
end if

'checkadmin
    Username=Session("username"&dlog_session)
    Password=Session("password"&dlog_session)
    if username="" or password="" then
            Username=replace(request.Cookies(dlog_cookies_name)("Username"),"'","")
            Password=replace(request.Cookies(dlog_cookies_name)("Password"),"'","")
    end if
    sql= "SELECT isad FROM User_MDB where username = '" & Username & "' and password='" & Password & "'"
    set rs_inc=conn.Execute(sql)
            if not (rs_inc.BOF or rs_inc.eof) then
                ulogin="true" 
            Session("username"&dlog_session) = Username
            Session("password"&dlog_session) = Password
            Session("isad"&dlog_session)=rs_inc("isad")

                isad=Session("isad"&dlog_session)       
            end if
            rs_inc.Close()
        set rs_inc=nothing
  if isad<>-1 then
    Redirect "index.asp","不是真正管理员哦"
  end if
'==============================
%>
<%
dim cat_id,cat_name,cat_action,del_log_count,del_log_r_count
cat_id=request("cat_id")
cat_name=Trim(replace(request("cat_name"),"'","''"))
xh=request("xh")
ifhide=request("ifhide")
select case request("cat_action")
   case "add_cat"
   if cat_name="" or xh="" then
      MESSAGE("添加分类时,分类名称和序号必填哦")
	  response.end
   end if
   sql="INSERT INTO log_cat(cat_name,xh,ifhide)VALUES('"&cat_name&"',"&xh&","&ifhide&")"
   
   case "del_cat"
        del_log_count=0
        SQL = "Select log_id from log where Cat_ID="&Cat_ID
	set tempc=conn.Execute(sql)
	while not tempc.eof
		
			SQL = "delete from log_r where log_ID="&tempc("log_ID")
			conn.Execute(sql)
                        del_log_count=del_log_count+1
			
	tempc.movenext
	wend
        sql= "delete from log where cat_id="&cat_id
        conn.Execute(sql)
        sql= "UPDATE log_count set L_count=L_count- "&del_log_count&" WHERE count_id=1"
        conn.Execute(sql)
	set tempc=nothing
   sql="Delete from log_cat where Id = " & cat_id &""
  

   
   case "edit_cat"   
   if cat_name="" or xh="" then
      MESSAGE("修改分类时,分类名称和序号必填哦")
	  response.end
   end if
   sql="UPDATE log_cat SET cat_name='"&cat_name&"',xh= "&xh&",ifhide="&ifhide&" WHERE id="&cat_id&""
   
   end select
   
if request("cat_action")<>"" and sql<>"" then
   conn.Execute(sql)
   redirect "cat_setting.asp","分类操作成功"
end if

%>
<html>
<head>
<title>LOG MANAGE</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../styles.css">
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<table width="728" border="0" cellspacing="0" cellpadding="0" height="100%">
  <tr>
    <td align="center"> 
	<%if not (isad=-1 and Ulogin="true") then
	        message "对不起,你没有操作权限"
			response.end
end if%>

      <table width="80%" border="0" cellspacing="1" cellpadding="3" bgcolor="#f0f0f0">
        <form name=form1 method="POST" action="cat_setting.asp">
          <tr> 
            <td><b>修改分类:</b></td>
          </tr>
          <tr> 
            <td bgcolor="#FFFFFF"> 
              <select name=cat_id id=cat_id>
                <!--#include file="../cat_list.asp" -->
              </select>
              名称修改为 
              <input type="text" name="cat_name" id="cat_name">
              <select name="ifhide">
                <option value="0" selected>公开</option>
                <option value="1">隐藏</option>
              </select>
              <br>
              排列序号,越大越靠前: 
              <input type="text" name="xh" size="2" maxlength="2" value="1">
              <input type="hidden" name="cat_action" value="edit_cat">
            </td>
          </tr>
          <tr>
            <td align="right"> 
              <input type="submit" name="Submit22" value="修改">
            </td>
          </tr>
        </form>
      </table>
      <br>
      <table width="80%" border="0" cellspacing="1" cellpadding="3" bgcolor="#f0f0f0">
        <form name=form2 method="POST" action="cat_setting.asp">
          <tr> 
            <td valign="top"><b>添加分类:</b></td>
          </tr>
          <tr> 
            <td bgcolor="#FFFFFF" valign="top"> 
              <input type="text" name="cat_name">
              [输入新分类的名称] 排列序号,越大越靠前: 
              <input type="text" name="xh" size="2" maxlength="2" value="1">
              <select name="ifhide">
                <option value="0" selected>公开</option>
                <option value="1">隐藏</option>
              </select>
              <input type="hidden" name="cat_action" value="add_cat">
            </td>
          </tr>
          <tr>
            <td valign="top" align="right"> 
              <input type="submit" name="Submit" value="添加">
            </td>
          </tr>
        </form>
      </table>
      <br>
      <table width="80%" border="0" cellspacing="1" cellpadding="3" bgcolor="#f0f0f0">
        <form name=form3 method="POST" action="cat_setting.asp">
          <tr> 
            <td valign="top"><b>删除分类:</b></td>
          </tr>
          <tr> 
            <td bgcolor="#FFFFFF" valign="top"> 
              <select name=cat_id>
                <!--#include file="../cat_list.asp" -->
              </select>
              [选择要删除的分类的名称] 
              <input type="hidden" name="cat_action" value="del_cat">
            </td>
          </tr>
          <tr>
            <td valign="top" align="right"> <font color="#FF0000">[注意:分类下的所有日志记录将被同时删除]</font> 
              <input type="submit" name="Submit2" value="删除">
            </td>
          </tr>
        </form>
      </table>
      
    </td>
  </tr>
</table>
</body>
</html>
<%
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -