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

📄 admin_sourcemanage.asp

📁 个人网站比较简短
💻 ASP
📖 第 1 页 / 共 5 页
字号:
        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 (CurrentPage - 1) * MaxPerPage < totalPut Then
            rsAuthor.Move (CurrentPage - 1) * MaxPerPage
        Else
            CurrentPage = 1
        End If
    End If
  
    Do While Not rsAuthor.EOF
        Response.Write "  <tr align='center' class='tdbg' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"">"
        Response.Write "    <td><input name='ID' type='checkbox' id='ID' value='" & rsAuthor("ID") & "'  onclick='unselectall()'></td>"
        Response.Write "    <td>" & rsAuthor("ID") & "</td>"
        Response.Write "    <td>" & rsAuthor("AuthorName") & "</td>"
        Response.Write "    <td>" & GetSex(rsAuthor("Sex")) & "</td>"
        Response.Write "    <td>" & GetSubStr(nohtml(PE_HtmlDecode(rsAuthor("Intro"))), 24, False) & "</td>"
        Response.Write "    <td>" & GetAuthorType(rsAuthor("AuthorType")) & "</td><td>"
        If rsAuthor("Passed") = True Then
            Response.Write "<font color=""green"">√</font>"
        Else
            Response.Write "<font color=""red"">×</font>"
        End If
        If rsAuthor("onTop") = True Then
            Response.Write "&nbsp;<font color=""blue"">固</font>"
        Else
            Response.Write "&nbsp;&nbsp;&nbsp;"
        End If
        If rsAuthor("isElite") = True Then
            Response.Write "&nbsp;<font color=""green"">荐</font>"
        Else
            Response.Write "&nbsp;&nbsp;&nbsp;"
        End If
        Response.Write "</td><td>"
        Response.Write "<a href='Admin_SourceManage.asp?TypeSelect=ModifyAuthor&ChannelID=" & ChannelID & "&ID=" & rsAuthor("ID") & "'>修改</a>"
        If rsAuthor("Passed") = True Then
            Response.Write "&nbsp;<a href='Admin_SourceManage.asp?TypeSelect=AuthorDis&ChannelID=" & ChannelID & "&ID=" & rsAuthor("ID") & "'>禁用</a>"
        Else
            Response.Write "&nbsp;<a href='Admin_SourceManage.asp?TypeSelect=AuthorEn&ChannelID=" & ChannelID & "&ID=" & rsAuthor("ID") & "'>启用</a>"
        End If
        If rsAuthor("onTop") = True Then
            Response.Write "&nbsp;<a href='Admin_SourceManage.asp?TypeSelect=AuthorDTop&ChannelID=" & ChannelID & "&ID=" & rsAuthor("ID") & "'>解固</a>"
        Else
            Response.Write "&nbsp;<a href='Admin_SourceManage.asp?TypeSelect=AuthorTop&ChannelID=" & ChannelID & "&ID=" & rsAuthor("ID") & "'>固顶</a>"
        End If
        If rsAuthor("isElite") = True Then
            Response.Write "&nbsp;<a href='Admin_SourceManage.asp?TypeSelect=AuthorDElite&ChannelID=" & ChannelID & "&ID=" & rsAuthor("ID") & "'>解荐</a>"
        Else
            Response.Write "&nbsp;<a href='Admin_SourceManage.asp?TypeSelect=AuthorElite&ChannelID=" & ChannelID & "&ID=" & rsAuthor("ID") & "'>推荐</a>"
        End If
        Response.Write "&nbsp;<a href='Admin_SourceManage.asp?TypeSelect=DelAuthor&ChannelID=" & ChannelID & "&ID=" & rsAuthor("ID") & "' onClick=""return confirm('确定要删除作者" & rsAuthor("AuthorName") & "吗?');"">删除</a>"
        Response.Write "</td>"
        Response.Write "</tr>"
        iCount = iCount + 1
        If iCount >= MaxPerPage Then Exit Do
        rsAuthor.MoveNext
    Loop
    rsAuthor.Close
   
    Response.Write "</table>  "
    Response.Write "<table width='100%' border='0' cellpadding='0' cellspacing='0'>"
    Response.Write "  <tr>"
    Response.Write "    <td width='200' height='30'><input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox'> 选中本页显示的所有作者</td>"
    Response.Write "    <td><input name='TypeSelect' type='hidden' id='TypeSelect' value='DelAuthor'>"
    Response.Write "    <input name='ChannelID' type='hidden' id='ChannelID' value=" & ChannelID & ">"
    Response.Write "    <input name='Submit' type='submit' id='Submit' value='删除选中的作者'></td>"
    Response.Write "  </tr>"
    Response.Write "</table>"
    Response.Write "</form>"
    Response.Write ShowPage(strFileName, totalPut, MaxPerPage, CurrentPage, True, True, "个作者", True)
    Response.Write "<br><table width='100%' border='0' cellpadding='0' cellspacing='0' class='border'>"
    Response.Write "<tr class='tdbg'><td width='80' align='right'><strong>作者搜索:</strong></td>"
    Response.Write "<td><table border='0' cellpadding='0' cellspacing='0'>"
    Response.Write "<form method='Get' name='SearchForm' action='Admin_SourceManage.asp'>"
    Response.Write "<input name='ChannelID' type='hidden' id='ChannelID' value='" & ChannelID & "'>"
    Response.Write "<input name='TypeSelect' type='hidden' id='TypeSelect' value='" & TypeSelect & "'>"
    Response.Write "<tr><td height='28' align='center'>"
    Response.Write "<select name='Field' size='1'><option value='name' selected>作者名</option><option value='address'>作者地址</option><option value='Phone'>作者电话</option><option value='intro'>作者简介</option></select>"
    Response.Write "<input type='text' name='keyword' size='20' value='"
    If Keyword <> "" Then
        Response.Write Keyword
    Else
        Response.Write "关键字"
    End If
    Response.Write "' maxlength='50'>"
    Response.Write "<input type='submit' name='Submit' value='搜索'>"
    Response.Write "</td></tr></form></table></td></tr></table>"
End Sub

Sub AddAuthor()
    Call PopCalendarInit
    Response.Write "<form method='post' action='Admin_SourceManage.asp' name='myform' onsubmit='javascript:return CheckInput();'>"
    Response.Write "  <table width='600' border='0' align='center' cellpadding='2' cellspacing='1' class='border' >"
    Response.Write "    <tr class='title'> "
    Response.Write "      <td height='22' colspan='2'> <div align='center'><strong>新 增 作 者 信 息</strong></div></td>"
    Response.Write "    </tr>"
    Response.Write "  <tr class='tdbg'> "
    Response.Write "    <td width='300' class='tdbg'>&nbsp;<strong> 姓名:</strong><input name='AuthorName' type='text' size='20' maxlength='20'> <font color='#FF0000'>*</font></td>"
    Response.Write "    <td rowspan='8' align='center' valign='top' class='tdbg'>"
    Response.Write "        <table width='180' height='200' border='1'>"
    Response.Write "            <tr><td width='100%' align='center'><img id='showphoto' src='" & InstallDir & "AuthorPic/default.gif' width='150' height='172'></td></tr>"
    Response.Write "        </table>"
    Response.Write "        <input name='Photo' type='text' size='25'><strong>:照 片 地 址</strong><br><iframe style='top:2px' ID='uploadPhoto' src='Upload.asp?dialogtype=AuthorPic' frameborder=0 scrolling=no width='285' height='25'></iframe>"
    Response.Write "     </td></tr>"
    Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 频道:</strong><select name='ChannelID'>" & ChannelList & "</select></td></tr>"
    Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 性别:</strong><input name='Sex' type='radio' value='1' checked>男&nbsp;&nbsp;<input type='radio' name='Sex' value='0'>女</td></tr>"
    Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 生日:</strong><input name='BirthDay' type='text' size='20' maxlength='20' value='" & FormatDateTime(Date, 2) & "' maxlength='20'><a style='cursor:hand;' onClick='PopCalendar.show(document.myform.BirthDay, ""yyyy-mm-dd"", null, null, null, ""11"");'><img src='Images/Calendar.gif' border='0' Style='Padding-Top:10px' align='absmiddle'></a></td></tr>"
    Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 地址:</strong><input name='Address' type='text' size='20' maxlength='20'></td></tr>"
    Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 电话:</strong><input name='Tel' type='text' size='20' maxlength='20'></td></tr>"
    Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 传真:</strong><input name='Fax' type='text' size='20' maxlength='20'></td></tr>"
    Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 单位:</strong><input name='Company' type='text' size='20' maxlength='20'></td></tr>"
    Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 部门:</strong><input name='Department' type='text' size='20' maxlength='20'></td><td><strong> 模板:</strong><select name='TemplateID'>" & AuthorTemplateList(0) & "</select></td></tr>"
    Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 邮编:</strong><input name='ZipCode' type='text' size='20' maxlength='20'></td><td><strong> 主页:</strong><input name='HomePage' type='text'></td></tr>"
    Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 邮件:</strong><input name='Email' type='text' size='20' maxlength='20'></td><td><strong> QQ:</strong><input name='QQ' type='text'></td></tr>"
    Response.Write "  <tr class='tdbg'> "
    Response.Write "    <td colspan='2'>&nbsp;<strong>作者分类:</strong><input name='AuthorType' type='radio' value='1' checked>" & XmlText("ShowSource", "ShowAuthor/AuthorType1", "大陆作者") & "&nbsp;<input name='AuthorType' type='radio' value='2'>" & XmlText("ShowSource", "ShowAuthor/AuthorType2", "港台作者") & "&nbsp;<input name='AuthorType' type='radio' value='3'>" & XmlText("ShowSource", "ShowAuthor/AuthorType3", "海外作者") & "&nbsp;<input name='AuthorType' type='radio' value='4'>" & XmlText("ShowSource", "ShowAuthor/AuthorType4", "本站特约") & "&nbsp;<input name='AuthorType' type='radio' value='0'>" & XmlText("ShowSource", "ShowAuthor/AuthorType5", "其他作者") & "&nbsp;</td></tr>"
    Response.Write "  <tr>"
    Response.Write "  <tr class='tdbg'> "
    Response.Write "    <td colspan='2'>&nbsp;<strong>作者简介</strong>↓<br>"
    Response.Write "      <textarea name='Intro' id='Intro' cols='72' rows='9' style='display:none'></textarea>"
    Response.Write "      <iframe ID='editor' src='../editor.asp?ChannelID=1&ShowType=2&tContentid=Intro' frameborder='1' scrolling='no' width='550' height='300' ></iframe>"
    Response.Write "    </td>"
    Response.Write "  </tr>"
    Response.Write "  <tr>"
    Response.Write "  <td height='40' colspan='2' align='center' class='tdbg'>"
    Response.Write "    <input name='TypeSelect' type='hidden' id='TypeSelect' value='SaveAddAuthor'>"
    Response.Write "    <input  type='submit' name='Submit' value=' 添 加 ' style='cursor:hand;'>&nbsp;<input name='Cancel' type='button' id='Cancel' value=' 取 消 ' onClick=""window.location.href='Admin_SourceManage.asp?ChannelID=" & ChannelID & "&TypeSelect=Author';"" style='cursor:hand;'></td>"
    Response.Write "  </tr>"
    Response.Write "</table></form>"
End Sub

Sub ModifyAuthor()
    Dim AuthorID
    Dim rsAuthor, sqlAuthor
    AuthorID = PE_CLng(Trim(Request("ID")))
    If AuthorID = 0 Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定要修改的作者ID</li>"
        Exit Sub
    End If
    sqlAuthor = "Select * from PE_Author where ID=" & AuthorID
    Set rsAuthor = Server.CreateObject("Adodb.RecordSet")
    rsAuthor.Open sqlAuthor, Conn, 1, 1
    If rsAuthor.BOF And rsAuthor.EOF Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>不存在此作者!</li>"
    Else
        Call PopCalendarInit
        Response.Write "<form method='post' action='Admin_SourceManage.asp' name='myform' onsubmit='return CheckInput();'>"
        Response.Write "  <table width='600' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>"
        Response.Write "    <tr class='title'> "
        Response.Write "      <td height='22' colspan='2'> <div align='center'><font size='2'><strong>修 改 作 者 信 息</strong></font></div></td>"
        Response.Write "    </tr>"
        Response.Write "  <tr class='tdbg'> "
        Response.Write "    <td width='300' class='tdbg'>&nbsp;<strong> 姓名:</strong><input name='AuthorName' type='text' value='" & rsAuthor("AuthorName") & "'> <font color='#FF0000'>*</font></td>"
        Response.Write "    <td rowspan='8' align='center' valign='top' class='tdbg'>"
        Response.Write "        <table width='180' height='200' border='1'>"
        Response.Write "            <tr><td width='100%' align='center'>"
        If IsNull(rsAuthor("Photo")) Then
            Response.Write "<img id='showphoto' src='" & InstallDir & "AuthorPic/default.gif' width='150' height='172'>"
        Else
            Response.Write "<img id='showphoto' src='" & rsAuthor("Photo") & "' width='150' height='172'>"
        End If
        Response.Write "        </td></tr></table>"
        Response.Write "        <input name='Photo' type='text' size='25' value='" & rsAuthor("Photo") & "'><strong>:照 片 地 址</strong><br><iframe style='top:2px' ID='uploadPhoto' src='Upload.asp?dialogtype=AuthorPic' frameborder=0 scrolling=no width='285' height='25'></iframe>"
        Response.Write "     </td></tr>"
        Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 频道:</strong><select name='ChannelID'>" & ChannelList & "</select></td></tr>"
        Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 性别:</strong><input name='Sex' type='radio' value='1'"
    If rsAuthor("Sex") = 1 Then Response.Write " Checked"
        Response.Write ">男&nbsp;&nbsp;<input type='radio' name='Sex' value='0'"
    If rsAuthor("Sex") = 0 Then Response.Write " Checked"
        Response.Write ">女</td></tr>"
        Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 生日:</strong><input name='BirthDay' type='text'  value='" & rsAuthor("BirthDAy") & "' maxlength='20'><a style='cursor:hand;' onClick='PopCalendar.show(document.myform.BirthDay, ""yyyy-mm-dd"", null, null, null, ""11"");'><img src='Images/Calendar.gif' border='0' Style='Padding-Top:10px' align='absmiddle'></a></td></tr>"
        Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 地址:</strong><input name='Address' type='text'  value='" & rsAuthor("Address") & "'></td></tr>"
        Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 电话:</strong><input name='Tel' type='text' value='" & rsAuthor("Tel") & "'></td></tr>"
        Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 传真:</strong><input name='Fax' type='text' value='" & rsAuthor("Fax") & "'></td></tr>"
        Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 单位:</strong><input name='Company' type='text' value='" & rsAuthor("Company") & "'></td></tr>"
        Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 部门:</strong><input name='Department' type='text' value='" & rsAuthor("Department") & "'></td><td><strong> 模板:</strong><select name='TemplateID'>" & AuthorTemplateList(rsAuthor("TemplateID")) & "</select></td></tr>"
        Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 邮编:</strong><input name='ZipCode' type='text' value='" & rsAuthor("ZipCode") & "'></td><td><strong> 主页:</strong><input name='HomePage' type='text' value='" & rsAuthor("HomePage") & "'></td></tr>"
        Response.Write "  <tr class='tdbg'><td>&nbsp;<strong> 邮件:</strong><input name='Email' type='text' value='" & rsAuthor("Email") & "'></td><td><strong> QQ:</strong><input name='QQ' type='text' value='" & rsAuthor("QQ") & "'></td></tr>"
        Response.Write "  <tr class='tdbg'> "
        Response.Write "    <td colspan='2'>&nbsp;<strong>作者分类:</strong>"
        Response.Write "<input name='AuthorType' type='radio' value='1'"
    If rsAuthor("AuthorType") = 1 Then Response.Write " checked"
        Response.Write ">" & XmlText("ShowSource", "ShowAuthor/AuthorType1", "大陆作者") & "&nbsp;<input name='AuthorType' type='radio' value='2'"
    If rsAuthor("AuthorType") = 2 Then Response.Write " checked"
        Response.Write ">" & XmlText("ShowSource", "ShowAuthor/AuthorType2", "港台作者") & "&nbsp;<input name='AuthorType' type='radio' value='3'"
    If rsAuthor("AuthorType") = 3 Then Response.Write " checked"
        Response.Write ">" & XmlText("ShowSource", "ShowAuthor/AuthorType3", "海外作者") & "&nbsp;<input name='AuthorType' type='radio' value='4'"
    If rsAuthor("AuthorType") = 4 Then Response.Write " checked"
        Response.Write ">" & XmlText("ShowSource", "ShowAuthor/AuthorType4", "本站特约") & "&nbsp;<input name='AuthorType' type='radio' value='0'"
    If rsAuthor("AuthorType") = 0 Then Response.Write " checked"
        Response.Write ">" & XmlText("ShowSource", "ShowAuthor/AuthorType5", "其他作者") & "&nbsp;</td></tr>"
        Response.Write "  <tr>"
        Response.Write "  <tr class='tdbg'> "
        Response.Write "    <td colspan='2'>&nbsp;<strong>作者简介</strong>↓<br>"
        Response.Write "      <textarea name='Intro' cols='72' rows='9' style='display:none'>"
        If Trim(rsAuthor("Intro") & "") <> "" Then Response.Write Server.HTMLEncode(rsAuthor("Intro"))
        Response.Write "      </textarea>"
        Response.Write "      <iframe ID='editor' src='../editor.asp?ChannelID=1&ShowType=2&tContentid=Intro' frameborder='1' scrolling='no' width='550' height='250' ></iframe>"
        Response.Write "    </td>"
        Response.Write "  </tr>"
        Response.Write "    <tr>"
        Response.Write "      <td colspan='2' align='center' class='tdbg'>"
        Response.Write "      <input name='TypeSelect' type='hidden' id='TypeSelect' value='SaveModifyAuthor'>"
        Response.Write "      <input name='ID' type='hidden' id='ID' value=" & rsAuthor("ID") & ">"
        Response.Write "      <input  type='submit' name='Submit' value='保存修改结果' style='cursor:hand;'>&nbsp;<input name='Cancel' type='button' id='Cancel' value=' 取 消 ' onClick=""window.location.href='Admin_SourceManage.asp?ChannelID=" & ChannelID & "&TypeSelect=Author'"" style='cursor:hand;'></td>"
        Response.Write "    </tr>"
        Response.Write "  </table>"
        Response.Write "</form>"
    End If
    rsAuthor.Close
    Set rsAuthor = Nothing
End Sub

Sub SaveAddAuthor()
    Dim AuthorName, 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>"
    Else
        AuthorName = ReplaceBadChar(AuthorName)
    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 ChannelID=" & ChannelID & " and AuthorName='" & AuthorName & "'"
    rsAuthor.Open sqlAuthor, Conn, 1, 3
    If Not (rsAuthor.BOF And rsAuthor.EOF) Then

⌨️ 快捷键说明

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