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

📄 m_tags.asp

📁 电子备课系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="inc/inc_sys.asp"-->
<!--#include file="../inc/class_blog.asp"-->
<%
If CheckAccess("r_user_tag")=False Then Response.Write "无权操作":Response.End
dim rs, sql
dim TagID,TagSearch,Keyword,strField

keyword=Trim(Request("keyword"))
if keyword<>"" then
	keyword=oblog.filt_badstr(keyword)
end if
strField=Trim(Request("Field"))
TagSearch=Trim(Request("TagSearch"))
Action=Trim(Request("Action"))
TagID=Trim(Request("TagID"))
'ComeUrl=Request.ServerVariables("HTTP_REFERER")
G_P_PerMax=20

if TagSearch="" then
	TagSearch=10
else
	TagSearch=CLng(TagSearch)
end if
G_P_FileName="m_tags.asp?TagSearch=" & TagSearch
if strField<>"" then
	G_P_FileName=G_P_FileName&"&Field="&strField
end if
if keyword<>"" then
	G_P_FileName=G_P_FileName&"&keyword="&keyword
end if
if Request("page")<>"" then
    G_P_This=cint(Request("page"))
else
	G_P_This=1
end if

%>
<SCRIPT language=javascript>
function unselectall()
{
    if(document.myform.chkAll.checked){
	document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    }
}

function CheckAll(form)
{
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll")
       e.checked = form.chkAll.checked;
    }
}
</SCRIPT>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>oBlog--系 统 TAG 管 理</title>
<link rel="stylesheet" href="images/style.css" type="text/css" />
<script src="images/menu.js" type="text/javascript"></script>
</head>
<body>
<div id="main_body">
	<ul class="main_top">
		<li class="main_top_left left">系 统 TAG 管 理</li>
		<li class="main_top_right right"> </li>
	</ul>
	<div class="main_content_rightbg">
		<div class="main_content_leftbg">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
  <form name="form1" action="m_tags.asp" method="get">
    <tr class="tdbg">
      <td width="100" height="30"><strong>快速查找TAG:</strong></td>
      <td  height="30"><select size=1 name="TagSearch" onChange="javascript:submit()">
          <option value=>请选择查询条件</option>
		  <option value="1">使用频率最高的100个TAG</option>
          <option value="2">使用频率最低的100个TAG</option>
          <option value="3">使用率为0的TAG</option>
          <option value="4">被锁定的TAG</option>
        </select>       </td>
    </tr>
  </form>
  <form name="form2" method="post" action="m_tags.asp">
  <tr class="tdbg">
    <td width="100"><strong>高级查询:</strong></td>
    <td>
      <select name="Field" id="Field">
	  <option value="TagName" selected>TAG名称</option>
      <option value="TagID" >TAG ID</option>
      </select>
      <input name="Keyword" type="text" id="Keyword" size="20" maxlength="30">
      <input type="submit" name="Submit2" value=" 查 询 ">
      <input name="TagSearch" type="hidden" id="TagSearch" value="10">
	  若为空,则查询所有TAG</td>
  </tr>
</form>
</table>
		</div>
	</div>
	<ul class="main_end">
		<li class="main_end_left left"></li>
		<li class="main_end_right right"></li>
	</ul>
</div>
<%
if Action="Modify" then
	call Modify()
elseif Action="SaveModify" then
	call SaveModify()
elseif Action="merge" then
	call MergeTags()
elseif Action="batchlock" then
	call batchlock()
elseif Action="batchunlock" then
	call batchUnlock()
elseif Action="batchdel" Then
	call BatchDel
else
	call main()
end if
if FoundErr=true then
	call WriteErrMsg()
end if

sub main()
	sGuide=""
	select case TagSearch
		case 1
			sql="select Top 100 * From oblog_tags Where iState=1 And iNum>0 order by iNum Desc"
			sGuide=sGuide & "使用频率最高的100个TAG"
		case 2
			sql="select Top 100 * From oblog_tags Where iState=1 And iNum>0 order by iNum"
			sGuide=sGuide & "使用频率最低的100个TAG"
		case 3
			sql="select  * From oblog_tags Where iState=1 And iNum=0"
			sGuide=sGuide & "使用率为0的TAG"
		case 4
			sql="select  * From oblog_tags Where iState=0"
			sGuide=sGuide & "被锁定的TAG"
		case 10
			if Keyword="" then
				sql="select Top 100 * From oblog_tags Where  iNum>0 order by iNum Desc"
				sGuide=sGuide & "所有TAG"
			else
				select case UCASE(strField)
				case "TAGID"
					if IsNumeric(Keyword)=false then
						FoundErr=true
						ErrMsg=ErrMsg & "<br><li>TAG ID必须是整数!</li>"
					else
						sql="select * from oblog_tags where Tagid =" & CLng(Keyword)
						sGuide=sGuide & "TAG ID等于<font color=red> " & CLng(Keyword) & " </font>"
					end if
				case "TAGNAME"
						sql="select * from oblog_tags where name like '%" & Keyword & "%' order by iNum Desc"
						sGuide=sGuide & "含有“ <font color=red>" & Keyword & "</font> ”的TAG"
				end select
			end if
		case else
			FoundErr=true
			ErrMsg=ErrMsg & "<br><li>错误的参数!</li>"
	end select

	if FoundErr=true then exit sub
	if not IsObject(conn) then link_database
	Set  rs=Server.CreateObject("Adodb.RecordSet")
	'Response.Write sql
	rs.Open sql,Conn,1,1
  	if rs.eof and rs.bof then
		sGuide=sGuide & "(<font color=red>0</font> )"
		%>
		<div id="main_body">
			<ul class="main_top">
				<li class="main_top_left left"><%=sGuide%></li>
				<li class="main_top_right right"> </li>
			</ul>
		</div>
		<%
	else
    	G_P_AllRecords=rs.recordcount
		sGuide=sGuide & "(<font color=red>" & G_P_AllRecords & "</font>)"
		if G_P_This<1 then
       		G_P_This=1
    	end if
    	if (G_P_This-1)*G_P_PerMax>G_P_AllRecords then
	   		if (G_P_AllRecords mod G_P_PerMax)=0 then
	     		G_P_This= G_P_AllRecords \ G_P_PerMax
		  	else
		      	G_P_This= G_P_AllRecords \ G_P_PerMax + 1
	   		end if

    	end if
	    if G_P_This=1 then
        	showContent
        	Response.write oblog.showpage(true,true,"个 TAG ")
   	 	else
   	     	if (G_P_This-1)*G_P_PerMax<G_P_AllRecords then
         	   	rs.move  (G_P_This-1)*G_P_PerMax
         		dim bookmark
           		bookmark=rs.bookmark
            	showContent
            	Response.write oblog.showpage(true,true,"个 TAG ")
        	else
	        	G_P_This=1
           		showContent
           		Response.write oblog.showpage(true,true,"个 TAG ")
	    	end if
		end if
	end if
	rs.Close
	Set  rs=Nothing
end sub

sub showContent()
   	dim i
    i=0
%>
<div id="main_body">
	<ul class="main_top">
		<li class="main_top_left left"><%=sGuide%></li>
		<li class="main_top_right right"> </li>
	</ul>
	<div class="main_content_rightbg">
		<div class="main_content_leftbg">

  <form name="myform" method="Post" action="m_tags.asp" onsubmit="return confirm('确定要执行选定的操作吗?');">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border">
          <tr class="title">
            <td width="30" align="center"><strong>选中</strong></td>
            <td width="30" align="center"><strong>ID</strong></td>
            <td align="center"><strong>TAG名称</strong></td>
            <td width="60" align="center"><strong>使用次数</strong></td>
            <td width="80" align="center"><strong>状态</strong></td>
            <td width="60" align="center"><strong>操作</strong></td>
          </tr>
          <%do while not rs.EOF %>
          <tr class="tdbg">
            <td align="center"><input name='TagID' type='checkbox' onclick="unselectall()" id="TagID" value='<%=cstr(rs("TagID"))%>'></td>
            <td  align="center"><span style="font-family:Century Gothic,verdana,tahoma,Arial,Helvetica,sans-serif;font-size:10px;font-weight:600;"><%=rs("TagID")%></span></td>
            <td  align="Left" style="word-break: break-all; word-wrap:break-word;">&nbsp;&nbsp;<%
			Response.write "<a href='m_tags.asp?Action=Modify&TagID=" & rs("TagID") & "'"
			Response.write """>" & rs("Name") & "</a>"
			%> </td>
            <td  align="center">
			<span style="font-family:Century Gothic,verdana,tahoma,Arial,Helvetica,sans-serif;font-size:10px;font-weight:600;">
			<%
			if rs("iNum")<>"" then
				Response.write rs("iNum")
			else
				Response.write "0"
			end if
			%>
			</span>
			</td>
            <td  align="center"><%
	  if rs("iState")=1 then
	  	Response.write "<span style=""font-weight:600;color:#090;"">正在使用</span>"
	  else
	  	Response.write "<span style=""font-weight:600;color:#f30;"">被锁定</span>"
	  end if
	  %></td>
   <td  align="center"><%
		Response.write "<a href='m_tags.asp?Action=Modify&TagID=" & rs("TagID") & "'>修改</a>&nbsp;"
		if rs("iState")=1 then
			Response.write "<a href='m_tags.asp?Action=batchlock&TagID=" & rs("TagID") & "'>锁定</a>&nbsp;"
		else
      Response.write "<a href='m_tags.asp?Action=batchunlock&TagID=" & rs("TagID") & "'>解锁</a>&nbsp;"
		end if
		Response.write "<a href='m_tags.asp?Action=batchdel&TagID=" & rs("TagID") & "'>删除</a>&nbsp;"
		%> </td>
          </tr>
          <%
	i=i+1
	if i>=G_P_PerMax then exit do
	rs.movenext

⌨️ 快捷键说明

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