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

📄 admin_label.asp

📁 1
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="../Conn.asp" -->
<!--#include file="../Inc/md5.asp" -->
<!--#include file="../Inc/Admin_checkuser.asp"-->
<%
Call Admin_Check("管理标签","您没有管理标签的权限,请联系管理员新增")
Dim action,classtype,str,line,mycondition,rsaafonta,listtype
action=request("Action")
listtype=FY_CLng(request("listtype"))
classtype=ReplaceBadChar(request("classtype"))
%>
<HTML><HEAD><TITLE>自定义标签管理</TITLE><META http-equiv=MIntro-Type MIntro="text/html; charset=gb2312">
<LINK href="../images/admin/admin.css" type=text/css rel=stylesheet>
<META MIntro="MSHTML 6.00.2800.1126" name=GENERATOR>
<SCRIPT LANGUAGE="JavaScript">
var lang = new Array();
var userAgent = navigator.userAgent.toLowerCase();
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);

function setcopy(text, alertmsg){
	if(is_ie) {
		clipboardData.setData('Text', text);
		alert(alertmsg);
	} else if(prompt('Press Ctrl+C Copy to Clipboard', text)) {
		alert(alertmsg);
	}
}
        function chk(obj)
        {

            if(obj.LabelName.value=="")
            {
                window.alert("标签名称不能为空!");
                obj.LabelName.focus();
                return false;
            }

            if(obj.LabelClass.value=="")
            {
                window.alert("标签分类不能为空!");
                obj.LabelClass.focus();
                return false;
            }

            if(obj.Priority.value=="")
            {
                window.alert("优先级不能为空!");
                obj.Priority.focus();
                return false;
            }

            if(obj.LabelContent.value=="")
            {
                window.alert("标签内容不能为空!");
                obj.LabelContent.focus();
                return false;
            }

        }
  function HideError() {
  return true;
}
function insertLabel(strLabel)
{
  myform.LabelContent.focus();
  var str = document.selection.createRange();
  str.text = strLabel
}
</SCRIPT>
</HEAD><body onkeydown=return(!(event.keyCode==78&&event.ctrlKey))><table align="center" width="100%" border="1" cellspacing="0" cellpadding="4" class=KenQiao_Net_bk style="border-collapse: collapse"><tr class=KenQiao_Net_ss><td colspan="6">自 定 义 标 签 管 理</td></tr><tr align="left" class=KenQiao_Net_ds><td colspan="6">  管理导航:<a href='Admin_Label.asp'>标签管理首页</a>&nbsp;|&nbsp;<a href='Admin_Label.asp?action=addstat'>添加标签</a>&nbsp;|&nbsp;<a href='Admin_Label.asp?action=import'>导入标签</a>&nbsp;|&nbsp;<a href='Admin_Label.asp?action=export'>导出标签</a>&nbsp;|&nbsp;    </td> </tr></table><br>
<%
Call FY_Cache.DelAllCache()
Select Case action
Case "del"
    Call FY_Label_Del
Case "modify"
    Call FY_Label_modify
Case "addstat2"
    Call FY_Label_addstat2
Case "doimport"
    Call FY_Label_doimport
Case "doexport"
    Call FY_Label_doexport
Case "import2"
    Call FY_Label_import2
Case "import"
    Call FY_Label_import
Case "export"
    Call FY_Label_export
Case "modifya"
    Call FY_Label_modifya
Case "addstat"
    Call FY_Label_addstat
Case Else
    Call FY_Label_Main
End Select
Sub FY_Label_Del
Dim labelid
labelid=FY_CLng(trim(request.QueryString("labelid")))
conn.execute("delete from 自定义标签 where LabelID="&labelid)
response.redirect Request.ServerVariables("HTTP_REFERER")
'=================修改==================
End Sub
Sub FY_Label_modify
Dim labelid,KenQiao_LabelName,KenQiao_LabelClass,KenQiao_LabelIntro,KenQiao_Priority,KenQiao_LabelContent
labelid=trim(request.QueryString("labelid"))
KenQiao_LabelName=trim(request.form("LabelName"))
KenQiao_LabelClass=trim(request.form("LabelClass"))
KenQiao_LabelIntro=trim(request.form("LabelIntro"))
KenQiao_Priority=trim(request.form("Priority"))
KenQiao_LabelContent=trim(request.form("LabelContent"))
set rs=server.createobject("adodb.recordset")
sql="select * from 自定义标签 where LabelID="&labelid
rs.open sql,conn,1,3
rs("LabelName")=FormatStr(KenQiao_LabelName)
rs("LabelClass")=FormatStr(KenQiao_LabelClass)
rs("LabelIntro")=FormatStr(KenQiao_LabelIntro)
rs("LabelContent")=FormatStr(KenQiao_LabelContent)
rs("Priority")=KenQiao_Priority
rs.update
rs.close
Call WriteSuccessMsg("<li>修改标签成功!</Li>","Admin_Label.asp")
set rs=nothing
End Sub
'=================添加==================
Sub FY_Label_addstat2
Dim labelid,KenQiao_LabelName,KenQiao_LabelClass,KenQiao_LabelIntro,KenQiao_Priority,KenQiao_LabelContent
KenQiao_LabelName=trim(request.form("LabelName"))
KenQiao_LabelClass=trim(request.form("LabelClass"))
KenQiao_LabelIntro=trim(request.form("LabelIntro"))
KenQiao_Priority=trim(request.form("Priority"))
KenQiao_LabelContent=trim(request.form("LabelContent"))
set rs=server.createobject("adodb.recordset")
rs.open "select * from 自定义标签",conn,1,3
rs.addnew
rs("LabelName")=FormatStr(KenQiao_LabelName)
rs("LabelClass")=FormatStr(KenQiao_LabelClass)
rs("LabelType")=0
rs("LabelIntro")=FormatStr(KenQiao_LabelIntro)
rs("LabelContent")=FormatStr(KenQiao_LabelContent)
rs("Priority")=KenQiao_Priority
rs.update
rs.close
Call WriteSuccessMsg("<li>添加标签成功!</Li>","Admin_Label.asp")
set rs=nothing
End Sub
'===================================
Sub FY_Label_doimport
Dim ItemMdb,TemplateProjectID,FormatConn,connstrexport,connexport,rsb,i
ItemMdb=request("ItemMdb")
TemplateProjectID=request("TemplateProjectID")
FormatConn=request("FormatConn")
connstrexport="DBQ="+server.mappath("../Databackup/"&ItemMdb)+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set connexport=server.createobject("ADODB.CONNECTION")
connexport.open connstrexport
If Err Then
Err.Clear
Set connexport = Nothing
End If
Set rsb = Server.CreateObject("adodb.recordset")
sql = "select * from 自定义标签 where LabelID in("&TemplateProjectID&")"
rsb.Open sql, connexport, 1, 1
i=0
do while not rsb.eof
i=i+1
Dim rse
set rse=server.createobject("adodb.recordset")
rse.open "select * from 自定义标签 where LabelName='"&rsb("LabelName")&"'",conn,1,3
If rse.bof And rse.EOF Then
rse.addnew
End if
rse("LabelName")=rsb("LabelName")
rse("LabelClass")=rsb("LabelClass")
rse("LabelType")=rsb("LabelType")
rse("LabelIntro")=rsb("LabelIntro")
rse("LabelContent")=rsb("LabelContent")
rse("Priority")=rsb("Priority")
rse.update
rse.close
set rse=nothing

rsb.movenext  
loop 
rsb.Close
Set rsb=nothing
Call WriteSuccessMsg("<li>已经成功将所选中的标签导入到数据库中!</li>","Admin_Label.asp")

End Sub
'===================================
Sub FY_Label_doexport
Dim ItemMdb,TemplateProjectID,FormatConn,connstrexport,connexport
ItemMdb=request("ItemMdb")
TemplateProjectID=request("TemplateProjectID")
FormatConn=request("FormatConn")
connstrexport="Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath("../Databackup/"&ItemMdb)
set connexport=server.createobject("ADODB.CONNECTION")
connexport.open connstrexport
If Err Then
Err.Clear
Call WriteErrMsg("<li>目标数据库地址错误,请正确填写!</li>")
Set connexport = Nothing
Else
If FormatConn=1 Then
connexport.execute("delete from 自定义标签")
End If
Dim rsa,i
Set rsa = Server.CreateObject("adodb.recordset")
sql = "select * from 自定义标签 where LabelID in("&TemplateProjectID&")"
rsa.Open sql, Conn, 1, 1
i=0
do while not rsa.eof
i=i+1
Dim rsc
set rsc=server.createobject("adodb.recordset")
rsc.open "select * from 自定义标签 where LabelName='"&rsa("LabelName")&"'",connexport,1,3
If rsc.bof And rsc.EOF Then
rsc.addnew
End if
rsc("LabelName")=rsa("LabelName")
rsc("LabelClass")=rsa("LabelClass")
rsc("LabelType")=rsa("LabelType")
rsc("LabelIntro")=rsa("LabelIntro")
rsc("LabelContent")=rsa("LabelContent")
rsc("Priority")=rsa("Priority")
rsc.update
rsc.close
set rsc=nothing

rsa.movenext  
loop 
rsa.Close
Set rsa=nothing
Call WriteSuccessMsg("<li>已经成功将所选中的标签导出到指定的数据库中!</li>","Admin_Label.asp")
End If
End Sub
'===================================
'导入标签第二步开始
'===================================
Sub FY_Label_import2
Dim ItemMdb,TemplateProjectID,FormatConn,connstrexport,connexport
ItemMdb=request("ItemMdb")
TemplateProjectID=request("TemplateProjectID")
FormatConn=request("FormatConn")
connstrexport="Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath("../Databackup/"&ItemMdb)
set connexport=server.createobject("ADODB.CONNECTION")
connexport.open connstrexport
If Err Then
Err.Clear
Call WriteErrMsg("<li>导入的标签数据库地址错误,请正确填写!</li>")
Set connexport = Nothing
Else
%>
<script language = "JavaScript">
    function CheckForm(){
        if (document.myform.TemplateProjectID.value==""){
            alert("请先选择要导出的标签项目!");
            document.myform.TemplateProjectID.focus();
            return false;
        }
    }
</script>
<form name='myform' action='?action=doimport' method='post' >
  <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='KenQiao_Net_bk' style='border-collapse: collapse'>
    <tr class='KenQiao_Net_ss'>
      <td height='22' align='center'><strong>标签导入(第二步)</strong></td>
    </tr>
    <tr class='KenQiao_Net_ds'>
      <td height='100' align='center'>
        <br>
        <table border='0' cellspacing='0' cellpadding='0'>
          <tr align='center'>
            <td><strong>将被导入的标签项目</strong><br>
<select name='TemplateProjectID' size='2' multiple style='height:300px;width:350px;'>
<%
Dim rsd,I
Set rsd = Server.CreateObject("adodb.recordset")
sql = "select * from 自定义标签"
rsd.Open sql, connexport, 1, 1
If Not(rsd.bof And rsd.EOF) Then
i=0
do while not rsd.eof
i=i+1
%>
<option value="<%=rsd("LabelID")%>">标签[<%=rsd("LabelClass")%>] -- {$MY_<%=rsd("LabelName")%>}</option>
<%
rsd.movenext  
loop 
Else
Response.Write"<option value=""0"">暂无任何标签项目</option>"
End If
rsd.Close
Set rsd=nothing
%>
</select></td>
            <td width='80'><input type='submit' name='Submit' value='导入&gt;&gt;' class='button' onClick="return CheckForm();"></td>
            <td><strong>系统中已经存在的标签项目</strong><br>
<select name='tItemID' size='2' multiple style='height:300px;width:350px;' disabled>
<%
Set rs = Server.CreateObject("adodb.recordset")
sql = "select * from 自定义标签"
rs.Open sql, Conn, 1, 1
If Not(rs.bof And rs.EOF) Then
i=0
do while not rs.eof
i=i+1
%>
<option value="<%=rs("LabelID")%>">标签[<%=rs("LabelClass")%>] -- {$MY_<%=rs("LabelName")%>}</option>
<%
rs.movenext  
loop 
Else
Response.Write"<option value=""0"">暂无任何标签项目</option>"
End If
rs.Close
Set rs=nothing
%>
</select></td>
          </tr>
        </table>
            <br><b>提示:按住“Ctrl”或“Shift”键可以多选</b><br>
        <input name='ItemMdb' type='hidden' id='ItemMdb' value='<%=ItemMdb%>'>
        <br>
      </td>
    </tr>
   </form>
  </table>
<%
End If
End Sub
'===================================
'导入标签第一步开始
'===================================
Sub FY_Label_import
%>
<script language = "JavaScript">
    function CheckForm(){
        if (document.myform.ItemMdb.value==""){
            alert("标签数据库地址不能为空!");
            document.myform.ItemMdb.focus();
            return false;
        }
    }
</script>
<form name='myform' action='?action=import2' method='post' >
  <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='KenQiao_Net_bk' style='border-collapse: collapse'>
    <tr class='KenQiao_Net_ss'>
      <td height='22' align='center'><strong>标签导入(第一步)</strong></td>
    </tr>
    <tr class='KenQiao_Net_ds'>
      <td height='100'>&nbsp;&nbsp;&nbsp;&nbsp;请输入要导入的标签数据库的文件名:
        ../Databackup/<input name='ItemMdb' type='text' id='ItemMdb' value='#KenQiao_Label.Mdb' size='50' maxlength='50'>
        <input name='Submit' type='submit' id='Submit' value=' 下一步 ' class='button' onClick="return CheckForm();"></td>
        <tr class='KenQiao_Net_ds'>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;注意:<b>如果系统存在同名的标签,系统将会采取覆盖处理,而不是跳过!</b></td>
    </tr>
    </tr>
   </form>
  </table>
<%
End Sub
'===================================
'导出标签开始

'===================================
Sub FY_Label_export
%>
<script language = "JavaScript">
    function CheckForm(){
        if (document.myform.ItemMdb.value==""){
            alert("标签数据库地址不能为空!");
            document.myform.ItemMdb.focus();
            return false;
        }
        if (document.myform.TemplateProjectID.value==""){
            alert("请先选择要导出的标签项目!");
            document.myform.TemplateProjectID.focus();
            return false;
        }
    }
<!-- 
  function HideError() {

⌨️ 快捷键说明

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