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

📄 admin_sourcemanage.asp

📁 个人网站比较简短
💻 ASP
📖 第 1 页 / 共 5 页
字号:
        FoundErr = True
        ErrMsg = ErrMsg & "<li>数据库中已经存在此作者!</li>"
        rsAuthor.Close
        Set rsAuthor = Nothing
        Exit Sub
    End If
    rsAuthor.addnew
    rsAuthor("ChannelID") = ChannelID
    rsAuthor("AuthorName") = AuthorName
    rsAuthor("Sex") = Sex
    If Birthday <> "" Then rsAuthor("BirthDay") = Birthday
    If Address <> "" Then rsAuthor("Address") = Address
    If Tel <> "" Then rsAuthor("Tel") = Tel
    If Fax <> "" Then rsAuthor("Fax") = Fax
    If Company <> "" Then rsAuthor("Company") = Company
    If Department <> "" Then rsAuthor("Department") = Department
    If ZipCode <> "" Then rsAuthor("ZipCode") = ZipCode
    If Homepage <> "" Then rsAuthor("HomePage") = Homepage
    If Email <> "" Then rsAuthor("Email") = Email
    If QQ <> "" Then rsAuthor("QQ") = PE_CLng(QQ)
    If Intro <> "" Then rsAuthor("Intro") = Intro
    If Photo <> "" Then rsAuthor("Photo") = Photo
    rsAuthor("AuthorType") = PE_CLng(AuthorType)
    rsAuthor("LastUseTime") = Now()
    rsAuthor("Passed") = True
    rsAuthor("TemplateID") = PE_CLng(Trim(Request("TemplateID")))
    rsAuthor.Update
    rsAuthor.Close
    Set rsAuthor = Nothing
    Call CloseConn
    Response.Redirect "Admin_SourceManage.asp?ChannelID=" & ChannelID & "&TypeSelect=Author"
End Sub

Sub SaveModifyAuthor()
    Dim AuthorName, AuthorID, Sex, Birthday, Address, Tel, Fax, Company, Department, ZipCode, Homepage, Email, QQ, Intro, Photo, AuthorType
    Dim rsAuthor, sqlAuthor
    AuthorName = Trim(Request("AuthorName"))
    If AuthorName = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定要修改的作者姓名!</li>"
    End If
    AuthorID = Trim(Request("ID"))
    If AuthorID <> "" Then
        If InStr(AuthorID, ",") > 0 Then
            AuthorID = ReplaceBadChar(AuthorID)
        Else
            AuthorID = PE_CLng(AuthorID)
        End If
    Else
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定要修改的作者ID!</li>"
    End If
    
    If FoundErr = True Then
        Exit Sub
    End If
    Sex = PE_CLng(Request("Sex"))
    Birthday = Trim(Request("BirthDay"))
    Photo = Trim(Request("Photo"))
    Address = Trim(Request("Address"))
    Tel = Trim(Request("Tel"))
    Fax = Trim(Request("Fax"))
    Company = Trim(Request("Company"))
    Department = Trim(Request("Department"))
    ZipCode = Trim(Request("ZipCode"))
    Homepage = Trim(Request("HomePage"))
    Email = Trim(Request("Email"))
    QQ = Trim(Request("QQ"))
    Intro = Trim(Request("Intro"))
    AuthorType = Trim(Request("AuthorType"))
    Set rsAuthor = Server.CreateObject("Adodb.RecordSet")
    sqlAuthor = "Select * from PE_Author where ID=" & AuthorID
    rsAuthor.Open sqlAuthor, Conn, 1, 3
    If Not (rsAuthor.BOF And rsAuthor.EOF) Then
        rsAuthor("ChannelID") = ChannelID
        If AuthorName <> "" Then rsAuthor("AuthorName") = AuthorName
        rsAuthor("Sex") = Sex
        If Birthday <> "" Then rsAuthor("BirthDay") = Birthday
        rsAuthor("Intro") = Intro
        rsAuthor("Address") = Address
        rsAuthor("Tel") = Tel
        rsAuthor("Fax") = Fax
        rsAuthor("Company") = Company
        rsAuthor("Department") = Department
        rsAuthor("ZipCode") = ZipCode
        rsAuthor("HomePage") = Homepage
        rsAuthor("Email") = Email
        rsAuthor("QQ") = PE_CLng(QQ)
        If Photo <> "" Then rsAuthor("Photo") = Photo
        rsAuthor("AuthorType") = PE_CLng(AuthorType)
        rsAuthor("TemplateID") = PE_CLng(Trim(Request("TemplateID")))
        rsAuthor.Update
    End If
    rsAuthor.Close
    Set rsAuthor = Nothing
    Call CloseConn
    Response.Redirect "Admin_SourceManage.asp?ChannelID=" & ChannelID & "&TypeSelect=Author"
End Sub

Sub DelAuthor()
    Dim AuthorID
    AuthorID = Trim(Request("ID"))
    If IsValidID(AuthorID) = False Then
        AuthorID = ""
    End If
    If AuthorID = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定要删除的作者ID</li>"
        Exit Sub
    End If
    If InStr(AuthorID, ",") > 0 Then
        Conn.Execute ("delete from PE_Author where ID in (" & AuthorID & ")")
    Else
        Conn.Execute ("delete from PE_Author where ID=" & AuthorID & "")
    End If
    Call CloseConn
    Response.Redirect "Admin_SourceManage.asp?ChannelID=" & ChannelID & "&TypeSelect=Author"
End Sub

Function GetAuthorType(TypeID)
     '1为国内 2为港台 3为海外 4为本站特约 0为其他
    Select Case TypeID
    Case 1
        GetAuthorType = XmlText("ShowSource", "ShowAuthor/AuthorType1", "大陆作者")
    Case 2
        GetAuthorType = XmlText("ShowSource", "ShowAuthor/AuthorType2", "港台作者")
    Case 3
        GetAuthorType = XmlText("ShowSource", "ShowAuthor/AuthorType3", "海外作者")
    Case 4
        GetAuthorType = XmlText("ShowSource", "ShowAuthor/AuthorType4", "本站特约")
    Case Else
        GetAuthorType = XmlText("ShowSource", "ShowAuthor/AuthorType5", "其他作者")
    End Select
End Function

Function GetSex(SexID)
    If SexID = "" Or SexID = 0 Then
        GetSex = XmlText("BaseText", "Girl", "女")
    Else
        GetSex = XmlText("BaseText", "Man", "男")
    End If
End Function


'**************
'来源处理部分
'**************

Sub CopyFrom()
    Dim rsCopyFrom, sqlCopyFrom, rsChannelCopyFrom
    Dim iCount
   
    Response.Write "<br><table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'><tr class='title'><td height='22'> | "
    If ChannelID = 0 Then
        Response.Write "<font color='red'>全站来源</font>"
    Else
        Response.Write "<a href='Admin_SourceManage.asp?ChannelID=0&TypeSelect=CopyFrom&ItemType=" & ItemType & "'>全站来源</a>"
    End If
    Set rsChannelCopyFrom = Conn.Execute("select ChannelID,ChannelName from PE_Channel Where ModuleType in (1,2,3) and Disabled=" & PE_False & " order by OrderID")
    Do While Not rsChannelCopyFrom.EOF
        If rsChannelCopyFrom("ChannelID") = ChannelID Then
            Response.Write " | <font color='red'>" & rsChannelCopyFrom("ChannelName") & "</font>"
        Else
            Response.Write " | <a href='Admin_SourceManage.asp?ChannelID=" & rsChannelCopyFrom("ChannelID") & "&TypeSelect=CopyFrom&ItemType=" & ItemType & "'>" & rsChannelCopyFrom("ChannelName") & "</a>"
        End If
        rsChannelCopyFrom.MoveNext
    Loop
    Set rsChannelCopyFrom = Nothing
    Response.Write " |</td></tr></table>"

    Response.Write "<br><table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'><tr class='title'><td height='22'> | <a href='Admin_SourceManage.asp?ChannelID=" & ChannelID & "&TypeSelect=CopyFrom&ItemType=1'>"
    If ItemType = 1 Then
        Response.Write "<font color=red>" & XmlText("ShowSource", "ShowCopyFrom/CopyFromType1", "友情站点") & "</font>"
    Else
        Response.Write XmlText("ShowSource", "ShowCopyFrom/CopyFromType1", "友情站点")
    End If
    Response.Write "</a> | <a href='Admin_SourceManage.asp?ChannelID=" & ChannelID & "&TypeSelect=CopyFrom&ItemType=2'>"
    If ItemType = 2 Then
        Response.Write "<font color=red>" & XmlText("ShowSource", "ShowCopyFrom/CopyFromType2", "中文站点") & "</font>"
    Else
        Response.Write XmlText("ShowSource", "ShowCopyFrom/CopyFromType2", "中文站点")
    End If
    Response.Write "</a> | <a href='Admin_SourceManage.asp?ChannelID=" & ChannelID & "&TypeSelect=CopyFrom&ItemType=3'>"
    If ItemType = 3 Then
        Response.Write "<font color=red>" & XmlText("ShowSource", "ShowCopyFrom/CopyFromType3", "外文站点") & "</font>"
    Else
        Response.Write XmlText("ShowSource", "ShowCopyFrom/CopyFromType3", "外文站点")
    End If
    Response.Write "</a> | <a href='Admin_SourceManage.asp?ChannelID=" & ChannelID & "&TypeSelect=CopyFrom&ItemType=0'>"
    If ItemType = 4 Then
        Response.Write "<font color=red>" & XmlText("ShowSource", "ShowCopyFrom/CopyFromType4", "其他来源") & "</font>"
    Else
        Response.Write XmlText("ShowSource", "ShowCopyFrom/CopyFromType4", "其他来源")
    End If
    Response.Write "</a> |</td></tr></table><br>"
    Response.Write "  <form name='myform' method='Post' action='Admin_SourceManage.asp' onsubmit=""return confirm('确定要删除选中的来源吗?');"">"
    Response.Write "<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>"
    Response.Write "  <tr align='center' class='title'>"
    Response.Write "    <td width='30'><strong>选中</strong></td>"
    Response.Write "    <td width='40' height='22'><strong>序号</strong></td>"
    Response.Write "    <td width='150' height='22'><strong>名称</strong></td>"
    Response.Write "    <td width='150' height='22'><strong>地址</strong></td>"
    Response.Write "    <td height='22'><strong>简介</strong></td>"
    Response.Write "    <td width='80' height='22'><strong>来源分类</strong></td>"
    Response.Write "    <td width='60' height='22'><strong>状态</strong></td>"
    Response.Write "    <td width='150' height='22'><strong>操 作</strong></td>"
    Response.Write "  </tr>"
    
    Set rsCopyFrom = Server.CreateObject("Adodb.RecordSet")
    sqlCopyFrom = "select * from PE_CopyFrom Where ChannelID=" & ChannelID
    If Keyword <> "" Then
        Select Case strField
        Case "name"
            sqlCopyFrom = sqlCopyFrom & " and SourceName like '%" & Keyword & "%' "
        Case "address"
            sqlCopyFrom = sqlCopyFrom & " and Address like '%" & Keyword & "%' "
        Case "Phone"
            sqlCopyFrom = sqlCopyFrom & " and Tel like '%" & Keyword & "%' "
        Case "intro"
            sqlCopyFrom = sqlCopyFrom & " and Intro like '%" & Keyword & "%' "
        Case "ContacterName"
            sqlCopyFrom = sqlCopyFrom & " and ContacterName like '%" & Keyword & "%' "
        Case Else
            sqlCopyFrom = sqlCopyFrom & " and SourceName like '%" & Keyword & "%' "
        End Select
    End If
    If ItemType < 999 Then
        sqlCopyFrom = sqlCopyFrom & " and SourceType =" & ItemType
    End If
    sqlCopyFrom = sqlCopyFrom & " order by ID Desc"
    
    rsCopyFrom.Open sqlCopyFrom, Conn, 1, 1
    If rsCopyFrom.BOF And rsCopyFrom.EOF Then
        rsCopyFrom.Close
        Set rsCopyFrom = Nothing
        Response.Write "  <tr class='tdbg'><td colspan='8' align='center'><br>没有任何来源!<br><br></td></tr>"
        Response.Write "</Table>"
        Exit Sub
    End If
    
    totalPut = rsCopyFrom.RecordCount
    If CurrentPage < 1 Then
        CurrentPage = 1
    End If
    If (CurrentPage - 1) * MaxPerPage > totalPut Then
        If (totalPut Mod MaxPerPage) = 0 Then
            CurrentPage = totalPut \ MaxPerPage
        Else
            CurrentPage = totalPut \ MaxPerPage + 1
        End If
    End If
    If CurrentPage > 1 Then
        If 

⌨️ 快捷键说明

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