UnRegulatenewEdit.asp
资源名称:eat.rar [点击查看]
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:18k
源码类别:
数据库编程
开发平台:
ASP/ASPX
- <% Option Explicit %>
- <!--#include file="../../FS_Inc/Const.asp" -->
- <!--#include file="../../FS_Inc/Function.asp"-->
- <!--#include file="../../FS_InterFace/MF_Function.asp" -->
- <!--#include file="../../FS_InterFace/NS_Function.asp" -->
- <!--#include file="lib/cls_main.asp" -->
- <!--#include file="../../FS_Inc/Func_page.asp" -->
- <!--#include file="NF_News_Function.asp"-->
- <%
- response.buffer=true
- Response.CacheControl = "no-cache"
- Dim Conn,User_Conn
- MF_Default_Conn
- MF_Session_TF
- if not MF_Check_Pop_TF("NS046") then Err_Show
- GetFunctionstr
- dim CharIndexStr
- dim Fs_news
- set Fs_news = new Cls_News
- Fs_News.GetSysParam()
- Dim Str_PopID
- %>
- <head>
- <title>不规则新闻 规则管理</title>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
- <script language="JavaScript" src="js/Public.js"></script>
- <script language="javascript" src="../../Fs_inc/CheckJs.js"></script>
- <script language="javascript" src="../../FS_INC/prototype.js"></script>
- <script language="JavaScript">
- String.prototype.trim=function(){
- return this.replace(/(^s*)|(s*$)/g,"");
- }
- function listnumber(){
- document.getElementById("addnew").style.display="";
- }
- function listnews(obj,NewsID)
- {
- var UnAll;
- if(document.SearchForm.UnAll.checked)
- {
- UnAll=document.SearchForm.UnAll.value;
- }
- else
- UnAll="";
- location="?ClassID="+document.SearchForm.ClassID.value+"&Action=Edit&NewsID="+NewsID+"&UnAll="+UnAll;
- }
- function listSearch(NewsID){
- var KeyWord=document.SearchForm.SearchKey.value;
- var NewsID=NewsID;
- location="?SearchKey="+KeyWord+"&Action=Edit&NewsID="+NewsID;
- }
- function Show(){
- $("NF_UnregNewsTitle").innerHTML="";
- document.all("yn").style.display=""
- var Strbr;
- var Arr=new Array(document.all("NewsID").length);
- for(var q=0;q<Arr.length;q++)
- {
- Arr[q]=new String("");
- }
- document.all("yn").style.display="";
- for (var i=0;i<document.all("NewsID").length;i++){
- if(document.all("NewsID")[i].checked){
- if(isNaN(document.all("Rows")[i].value) || document.all("Rows")[i].value<1 || document.all('File_'+document.all("NewsID")[i].value+'').value.trim()==""){
- alert("你填写的第"+(i+1)+"信息不对");
- document.all("yn").style.display="none";
- }
- else{
- if (document.all("Rows")[i].value>Arr.length)
- {
- alert("你输入的行数有误.不通超过新闻条数!");
- document.all("yn").style.display="none";
- }
- Arr[Math.round(Math.abs(document.all("Rows")[i].value))-1]=Arr[Math.round(Math.abs(document.all("Rows")[i].value))-1]+" "+document.all('File_'+(document.all("NewsID")[i].value)).value;
- }
- }
- }
- //开始显示
- for(i=0;i<document.all("NewsID").length;i++)
- {
- if(Arr[i].trim()!="")
- {
- Arr[i]="<table width='100%' border='0' cellpadding='0' cellspacing='0' ><tr><td border=1>"+Arr[i]+"</td></tr></table>";
- }
- }
- for(i=0;i<document.all("NewsID").length;i++)
- {
- $("NF_UnregNewsTitle").innerHTML+=Arr[i];
- }
- }
- -->
- </script>
- </head>
- <body>
- <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
- <tr class="hback">
- <td class="xingmu" colspan="4">不规则新闻管理</td>
- </tr>
- <tr>
- <td height="26" colspan="5" valign="middle" class="hback">
- <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="5%" align="center" vlign="middle"class="hback"><a href="UnRegulatenewAdd.asp">添加</a></td>
- <td width="2%" align="center" vlign="middle"class="Gray">|</td>
- <td width="5%" align="center" vlign="middle" class="hback"><a href="DefineNews_Manage.asp">返回</a></td>
- <td width="2%" align="center" vlign="center" class="Gray">|</td>
- <td width="5%" align="center" vlign="center" class="hback"><a href="../../help?Lable=UnRegualNewAdd" target="_blank" style="cursor:help;">帮助</a></td>
- <td> </td>
- </tr>
- </table>
- </td>
- </tr>
- <%
- IF Request.QueryString("Action")="Edit" Then
- Dim NewsID,NewsMainRs,NewsMainSql,NewsUnRs,NewsUnSql,TempRs,Str12,TempStr,Maxrow,RowRs,MainTopic,TmpRsObj,RowValue,NTitle
- NewsID=CStr(Trim(Request.QueryString("NewsID")))
- Set NewsMainRs = server.createobject(G_FS_RS)
- Set NewsUnRs = server.createobject(G_FS_RS)
- Set TempRs= server.createobject(G_FS_RS)
- Set RowRs = server.createobject(G_FS_RS)
- Maxrow=1
- %><tr ><td colspan="2" width="98%" class="hback" >
- <form name="GetNewsIDForm" action="SetUnRegulate.asp?Action=Add" method=post>
- <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" style="display1:" id="yn" class="table">
- <tr>
- <td width="16%" class="hback">
- <div align="right">不规则新闻标题</div>
- </td>
- <td width="84%" align="left" class="hback">
- <div style="overflow:scroll;height:auto;" id="NF_UnregNewsTitle">
- <%
- Set TmpRsObj=server.CreateObject(G_FS_RS)
- TmpRsObj.open "Select ID,UnregulatedMain,MainUnregNewsID,UnregNewsName,Rows from FS_NS_News_Unrgl Where UnregulatedMain='"&NewsID&"' order by Rows,AddTime DESC",Conn,1,3
- Do While Not TmpRsObj.eof
- response.Write(""&TmpRsObj("UnregNewsName")&"")
- RowValue=Cint(TmpRsObj("Rows"))
- TmpRsObj.movenext
- if not TmpRsObj.eof then
- if Cint(TmpRsObj("Rows"))=RowValue then
- response.Write(" "&TmpRsObj("UnregNewsName")&"")
- else
- Response.Write("<br>")
- end if
- end if
- Loop
- TmpRsObj.close
- SEt TmpRsObj=nothing
- %></DIV>
- </td>
- </tr>
- <tr>
- <td colspan="2" class="hback">
- <input type="button" name="Submit" value="保 存" onClick="SElectForm.submit()">
- <input type="reset" value="重 置">
- </td>
- </tr>
- </table>
- </form>
- </td></tr></table>
- <table width="100%" id="addnew">
- <tr>
- <td width="100%">
- <%
- '定义分页函数的参数
- Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
- int_RPP=50 '设置每页显示数目
- int_showNumberLink_=8 '数字导航显示数目
- showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
- str_nonLinkColor_="#999999" '非热链接颜色
- toF_="<font face=webdings>9</font>" '首页
- toP10_=" <font face=webdings>7</font>" '上十
- toP1_=" <font face=webdings>3</font>" '上一
- toN1_=" <font face=webdings>4</font>" '下一
- toN10_=" <font face=webdings>8</font>" '下十
- toL_="<font face=webdings>:</font>" '尾页
- %>
- <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="table" >
- <%
- Dim obj_news_rs,obj_news_sql,DefaultRs
- KeyWord=request.Form("SearchKey")
- obj_news_sql="Select ID,ClassID,ClassName from FS_NS_NewsClass where Parentid = '0' and ReycleTF<>1 order by OrderID desc"
- %>
- <form name='SearchForm' method="get" target='_self' action="?">
- <tr height="21" bgcolor="#FFFFFF">
- <td align="center" valign="middle" class="hbank">
- <%if Request.QueryString("UnAll")<>"" then
- Response.Write("<td width=""11%"" height=""35"" align=""center"" class=""hback"" ><input type=""checkbox"" name=""UnAll"" value=""UnNews"" checked>")
- else
- response.Write("<td width=""11%"" height=""35"" align=""center"" class=""hback"" ><input type=""checkbox"" name=""UnAll"" value=""UnNews"">")
- end if%>
- 不规则新闻 </td>
- <td width="11%" height="35" align="center" class="hback" >栏目列表</td>
- <td align="center" width="40%" class="hback" >
- <select name="ClassID" onChange="listnews(this,'<%=NewsID%>')" style="width:100%">
- <option value="" selected>所有栏目</option>
- <%
- if Request.QueryString("ClassID")<>"" then
- Set DefaultRs=Conn.execute("Select ClassID,ClassName From FS_NS_NewsClass Where ClassID='"&request.QueryString("ClassID")&"'")
- if not DefaultRs.eof then
- %>
- <option value=<%=DefaultRs("ClassID")%> selected><%=DefaultRs("ClassName")%></option>
- <%
- end if
- Set DefaultRs=nothing
- end if
- Dim rs_movelist_rs,str_tmp_move
- Set rs_movelist_rs = server.CreateObject(G_FS_RS)
- rs_movelist_rs.Open "Select ID,ClassID,ClassName,ParentID,ReycleTF from FS_NS_NewsClass where ParentID='0' and ReycleTF=0 order by AddTime DESC",Conn,1,3
- str_tmp_move = ""
- do while not rs_movelist_rs.eof
- str_tmp_move = str_tmp_move & "<option value="""& rs_movelist_rs ("ClassID") &""">"& rs_movelist_rs ("ClassName") &"</option>"
- str_tmp_move = str_tmp_move & Fs_news.News_ChildNewsList(rs_movelist_rs("ClassID"),"")
- rs_movelist_rs.movenext
- Loop
- Response.Write str_tmp_move
- rs_movelist_rs.close:set rs_movelist_rs=nothing
- %>
- </select>
- </td>
- <td align="center" width="40%" class="hback" >
- <input type="text" name="SearchKey" value="<%=KeyWord%>">
- <input name="submit2" type="button" value="搜 索" onClick="listSearch('<%=Request.QueryString("NewsID")%>')">
- </td>
- </tr>
- </form>
- </table>
- <form name="SElectForm" method="post" action="SetUnRegulate.asp?Action=Edit&MainNewsID=<%=NewsID%>">
- <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table" > <tr>
- <td colspan=4 class="hback" align="center">
- <input type="button" name="show" value="生 成 预 览" onClick="Show()">
- </td>
- </tr>
- <tr class="xingmu">
- <td width="8%" align=center class="xingmu">选择新闻</td>
- <td width="35%" align="center" class="xingmu">输入不规则标题</td>
- <td width="40%" align="center" class="xingmu">新闻标题</td>
- <td width="*%" align=center class="xingmu">输入行数(正整数)</td>
- </tr>
- <%
- '开始显示已有的不规则新闻
- Set TmpRsObj=server.CreateObject(G_FS_RS)
- TmpRsObj.open "Select ID,UnregulatedMain,MainUnregNewsID,UnregNewsName,Rows from FS_NS_News_Unrgl Where UnregulatedMain='"&NewsID&"' order by Rows",Conn,1,1
- Do While Not TmpRsObj.eof
- %>
- <tr>
- <td class="xingmu" align="center">
- <input title="选择不规则新闻" type='checkbox' name='NewsID' id='NewsID' value="<%=TmpRsObj("MainUnregNewsID")%>" checked>
- </td>
- <td class="xingmu">
- <input title='修改不规则调用时使用的标题' type=text name="File_<%=TmpRsObj("MainUnregNewsID")%>" style='width:100%' value="<%=TmpRsObj("UnregNewsName")%>">
- </td>
- <%
- '_____________________________________________________________________________
- '查找新闻的原标题
- Set NTitle=Conn.execute("Select NewsID,NewsTitle,CurtTitle from FS_NS_News where NewsID='"&TmpRsObj("MainUnregNewsID")&"'")
- %>
- <td class="xingmu">
- <%
- if not NTitle.eof then
- if NTitle("CurtTitle")<>"" then
- Response.write("<a href='"&(NTitle("NewsID"))&"' target=_blank title=点击查看本条新闻>"&left(NTitle("CurtTitle"),29)&"</a>")
- else
- Response.write("<a href='"&(NTitle("NewsID"))&"' target=_blank title=点击查看本条新闻>"&left(NTitle("NewsTitle"),29)&"</a>")
- end if
- else
- Response.Write("原新闻已被删除了")
- end if
- Set NTitle=nothing
- %>
- </td>
- <td align=center class="xingmu">
- <input title='输入行数' type='text' size="4" name='Col<%=TmpRsObj("MainUnregNewsID")%>' id='Rows' value="<%=TmpRsObj("Rows")%>" >
- </td>
- </tr>
- <%
- TmpRsObj.movenext
- Loop
- TmpRsObj.close
- SEt TmpRsObj=nothing
- ' 结束已有有新闻的显示
- Dim temp
- Dim IDList : IDList = "," '列出不重复的新闻ID
- Dim ListObj,ListSql
- Dim TempClassID,KeyWord
- TempClassID = Cstr(Request.QueryString("ClassID"))
- KeyWord = NoCSSHackAdmin(Request.QueryString("SearchKey"),"关键字")
- set ListObj = server.CreateObject(G_FS_RS)
- ListSQL="select ID,NewsID,ClassID,NewsTitle,CurtTitle From FS_NS_News where NewsID not In(Select MainUnregNewsID From FS_NS_News_Unrgl Where UnregulatedMain='"&NewsID&"') and NewsID<>'"&NewsID&"' and isLock<>1 and isRecyle=0 and "&CharIndexStr&"(NewsProperty,17,1)=1 Order By PopId Desc "
- '全部新闻
- If Request("UnAll")="" then
- ListSQL="select ID,NewsID,ClassID,NewsTitle,CurtTitle From FS_NS_News where NewsID not In(Select MainUnregNewsID From FS_NS_News_Unrgl Where UnregulatedMain='"&NewsID&"') and NewsID<>'"&NewsID&"' and isLock<>1 and isRecyle=0 Order By PopId Desc "
- If KeyWord<>"" Then
- If TempClassID<>"" Then
- ListSQL = "select ID,NewsID,ClassID,NewsTitle,CurtTitle From FS_NS_News where NewsID not In(Select MainUnregNewsID From FS_NS_News_Unrgl Where UnregulatedMain='"&NewsID&"') and NewsID<>'"&NewsID&"' and (KeyWords like '%"&KeyWord&"%' or NewsTitle like '%"&KeyWord&"%') and ClassID='"&TempClassID&"'and isLock<>1 and isRecyle=0 Order By PopId Desc"
- Else
- ListSQL = "select ID,NewsID,ClassID,NewsTitle,CurtTitle From FS_NS_News where NewsID not In(Select MainUnregNewsID From FS_NS_News_Unrgl Where UnregulatedMain='"&NewsID&"') and NewsID<>'"&NewsID&"' and (KeyWords like '%"&KeyWord&"%' or NewsTitle like '%"&KeyWord&"%') and isLock<>1 and isRecyle=0 Order By PopId Desc"
- End If
- else if TempClassID<>"" then
- ListSQL = "select ID,NewsID,ClassID,NewsTitle,CurtTitle From FS_NS_News where NewsID not In(Select MainUnregNewsID From FS_NS_News_Unrgl Where UnregulatedMain='"&NewsID&"') and NewsID<>'"&NewsID&"' and ClassID='"&TempClassID&"'and isLock<>1 and isRecyle=0 and "&CharIndexStr&"(NewsProperty,17,1)=1 Order By PopId Desc"
- end if
- End IF
- Else
- ListSQL="select ID,NewsID,ClassID,NewsTitle,CurtTitle From FS_NS_News where NewsID not In(Select MainUnregNewsID From FS_NS_News_Unrgl Where UnregulatedMain='"&NewsID&"') and NewsID<>'"&NewsID&"' and isLock<>1 and isRecyle=0 and "&CharIndexStr&"(NewsProperty,17,1)=1 Order By PopId Desc "
- If KeyWord<>"" Then
- If TempClassID<>"" Then
- ListSQL = "select ID,NewsID,ClassID,NewsTitle,CurtTitle From FS_NS_News where NewsID not In(Select MainUnregNewsID From FS_NS_News_Unrgl Where UnregulatedMain='"&NewsID&"') and NewsID<>'"&NewsID&"' and (KeyWords like '%"&KeyWord&"%' or NewsTitle like '%"&KeyWord&"%') and ClassID='"&TempClassID&"'and isLock<>1 and isRecyle=0 and "&CharIndexStr&"(NewsProperty,17,1)=1 Order By PopId Desc"
- Else
- ListSQL = "select ID,NewsID,ClassID,NewsTitle,CurtTitle From FS_NS_News where NewsID not In(Select MainUnregNewsID From FS_NS_News_Unrgl Where UnregulatedMain='"&NewsID&"') and NewsID<>'"&NewsID&"' and (KeyWords like '%"&KeyWord&"%' or NewsTitle like '%"&KeyWord&"%') and isLock<>1 and isRecyle=0 and "&CharIndexStr&"(NewsProperty,17,1)=1 Order By PopId Desc"
- End If
- else if TempClassID<>"" then
- ListSQL = "select ID,NewsID,ClassID,NewsTitle,CurtTitle From FS_NS_News where NewsID not In(Select MainUnregNewsID From FS_NS_News_Unrgl Where UnregulatedMain='"&NewsID&"') and NewsID<>'"&NewsID&"' and ClassID='"&TempClassID&"'and isLock<>1 and isRecyle=0 and "&CharIndexStr&"(NewsProperty,17,1)=1 Order By PopId Desc"
- end if
- End IF
- ENd IF
- ListObj.open ListSQL,Conn,1,1
- if Not ListObj.eof Then
- ListObj.PageSize=int_RPP
- cPageNo=NoSqlHack(Request.QueryString("Page"))
- If cPageNo="" Then cPageNo = 1
- If not isnumeric(cPageNo) Then cPageNo = 1
- cPageNo = Clng(cPageNo)
- If cPageNo<=0 Then cPageNo=1
- If cPageNo>ListObj.PageCount Then cPageNo=ListObj.PageCount
- ListObj.AbsolutePage=cPageNo
- FOR int_Start=1 TO int_RPP
- If Instr(IDList,","&ListObj("ID")&",")=0 Then
- 'Response.write "<tr><td colspan=5 class=""hback""></td></tr>"
- if trim(ListObj("CurtTitle"))<>"" then
- temp=ListObj("CurtTitle")
- else
- temp=ListObj("NewsTitle")
- end if
- %>
- <tr>
- <td class="hback" align=center>
- <input title="选择不规则新闻" type='checkbox' name='NewsID' id='NewsID' value="<%=ListObj("NewsID")%>" >
- </td>
- <td class="hback"><a href='<%=(ListObj("NewsID"))%>' target=_blank title=点击查看本条新闻>
- <input title='修改不规则调用时使用的标题' type='text' name='File_<%=ListObj("NewsID")%>' style='width:100%' value='<%=temp%>'>
- </a></td>
- <td class="hback"> <a href='<%=(ListObj("NewsID"))%>' target=_blank title=点击查看本条新闻><%=ListObj("NewsTitle")%></a> </td>
- <td align=center class="hback">
- <input title='输入行数' type='text' size="4" name='Col<%=ListObj("NewsID")%>' id='Rows' >
- </td>
- </tr>
- <%
- End If
- IDList = IDList & ListObj("ID") & ","
- ListObj.MoveNext
- if ListObj.eof or ListObj.bof then exit for
- NEXT
- Response.Write("<tr><td class=""xingmu"" colspan=""4"" align=""right"">"&fPageCount(ListObj,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo) & vbcrlf&"</td></tr>")
- Else
- Response.write "<tr><td colspan=4 class=""hback""></td></tr><tr><td colspan=5 height=23>没有相关的新闻</td></tr>"
- End If
- %>
- <tr>
- <td colspan=4 class="hback" align="center">
- <input type="button" name="show" value="生 成 预 览" onClick="Show()">
- </td>
- </tr>
- <%
- ListObj.Close
- Set ListObj=nothing
- %>
- </table>
- </form>
- </td>
- </tr>
- </table>
- <%
- End if
- Set Conn=nothing
- 'document.all("NewsBsr")[0].checked
- %>
- </body>
- </html>