📄 srch_news_2.asp
字号:
<%Response.Buffer=true%>
<%
'修改/删除新闻专题,第二步:新闻专题列表
'修改:佟庆涛
'时间:2001.02.05
'模板设计:秦怀平(jincao@yeah.net)
'开发时间:2000.12
%>
<!--#include file="../include/odbc.asp" -->
<!--#include file="../include/killStr.asp" -->
<!--#include file="../include/checkUser.asp" -->
<!--#include file="../include/checkServer.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="Author" content="QinHuaiPing(秦怀平)">
<link rel="stylesheet" href="../script/style.css" type="text/css">
<script src="../script/trim.js" language="JavaScript"></script>
<script src="../script/validdate.js" language="JavaScript"></script>
<script language='JavaScript'>
function check(form1){
if (isNaN(form1.infoId.value))
{alert('文章编号必须是数字!');
form1.infoId.focus();
form1.infoId.select();
return (false);
}
}
function isDate(theYear,theMonth,theDay)
{
//定义年,月,日变量,赋值
var selYear;
var selMonth;
var selDay;
selYear=parseInt(theYear);
selMonth=parseInt(theMonth);
selDay=parseInt(theDay);
//定义12月的天数数组,赋值
var arrMonthDay;
arrMonthDay=new Array(12);
arrMonthDay[0]=31;
arrMonthDay[1]=28;
arrMonthDay[2]=31;
arrMonthDay[3]=30;
arrMonthDay[4]=31;
arrMonthDay[5]=30;
arrMonthDay[6]=31;
arrMonthDay[7]=31;
arrMonthDay[8]=30;
arrMonthDay[9]=31;
arrMonthDay[10]=30;
arrMonthDay[11]=31;
//判断所选的日期是否合法
if (arrMonthDay[selMonth-1]>=selDay)
{
return(true);
}
else
{
//判断是否选为润年的二月
if ((selMonth==2)&&((selYear%4==0 && selYear%100!=0) ||(selYear%100==0 && selYear%400==0) ))
{
if (selDay<=29)
return(true) ;
else
return(false) ;
}
else
{return(false) ;}
}
}
function check(form1)
{for (var i=0;i<4;i++)
{if ((form1.elements[i].value.indexOf("<") !=-1) || (form1.elements[i].value.indexOf(">") !=-1)||(form1.elements[i].value.indexOf("'") !=-1)||(form1.elements[i].value.indexOf("\"") !=-1))
{alert("字段中不允许含有标注!");
form1.elements[i].focus ();
form1.elements[i].select ();
return (false);
}
}
return true;
}
function daychange()
{
var year
var month
var day
year=document.add.year1.options[document.add.year1.selectedIndex].value;
month=document.add.month1.options[document.add.month1.selectedIndex].value;
day=document.add.day1.options[document.add.day1.selectedIndex].value;
if (!(isDate(year,month,day)))
{
alert("您的日期有错误!");
document.add.month1.selectedIndex=0;
document.add.day1.selectedIndex=0;
}
}
function daychange2()
{
var year
var month
var day
year=document.add.year2.options[document.add.year2.selectedIndex].value;
month=document.add.month2.options[document.add.month2.selectedIndex].value;
day=document.add.day2.options[document.add.day2.selectedIndex].value;
if (!(isDate(year,month,day)))
{
alert("您的日期有错误!");
document.add.month2.selectedIndex=0;
document.add.day2.selectedIndex=0;
}
}
</script>
</head>
<%if request("mySql")="" then '第一次调用
sql=" where right(infoid,4)='0000' and menuid='"&request("menuid")&"'"
if trim(request("newstitle"))<>"" then
if sql<>"" then
sql=sql&" and newstitle like '%"&killStr(request("newstitle"))&"%'"
else
sql="newstitle like '%"&killStr(request("newstitle"))&"%'"
end if
end if
'-------发表时间的查询-------------------
if trim(request("regtime"))="regtimeyes" then
date1=request("year1")&"-"&right("0" &request("month1"),2)&"-"&right("0"&request("day1"),2)
date2=request("year2")&"-"&right("0" &request("month2"),2)&"-"&right("0"&request("day2"),2)
if Sql<>"" then
Sql=Sql & " and "
end if
Sql=Sql & " regtime between '"&date1&"' and '"&date2&"'"
end if
sql="select * from news2_special "&sql&" order by "&request("indexorder")&" desc "
else '翻页调用
sql=request("mySql")
end if
%>
<body bgcolor="#FFFFE0">
<!--#include file="../include/rollPage.asp" -->
<%
set rs=server.CreateObject("adodb.recordset")
%>
<p align=center><u><font size=4 color=#0000FF><b>修改/删除新闻:</b></font></u></p>
<div align=center><center>
<table style="border: 1 solid #0000FF" width=100%>
<%
rs.Open sql, conn, 3, 1
If Not rs.EOF Then
rs.PageSize =10
rs.AbsolutePage = getPageNo(rs)
%>
<form method=POST name=add action=srch_news_3.asp>
<div align=center>
<center>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=left><font color="#0000FF" size="2">Step2:专提列表</font></td>
</tr>
</table>
<table border=1 cellpadding=0 cellspacing=0>
<tr>
<td align=center><b>选择</b></td>
<td align=center><b>专题号</b></td>
<td align=center><b>文章标题</b></td>
<td align=center><b>点击数</b></td>
<td align=center><b>更新时间</b></td>
</tr>
<%For i = 1 To rs.PageSize
If rs.EOF Then Exit For%>
<tr>
<td align=center><input type=radio <% if i=1 then response.write "checked" %> name=infoId value=<%=rs("infoId")%>></td>
<td align=center><a href=../news2_judge/list.asp?infoid=<%=rs("infoId")%>><%=rs("infoId")%> </a></td>
<td align=center><%=rs("newsTitle")%> </td>
<td align=center><%=rs("clickNum")%> </td>
<td align=center><%=rs("regtime")%> </td>
</tr>
<%rs.MoveNext
if rs.eof then exit for
next%>
<tr><td nowrap colspan=6 align=center><br>
<table border="1" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align=right>文章标题:</td>
<td ><input type=Text name=newsTitle size=20 maxLength=400></td>
</tr>
<tr>
<td align=right>更新时间:</td>
<td align=left ><p>是否按时间搜索<input type="checkbox" name="regtime" value="regtimeyes">
<br>起始日期:
<select name="year1" size="1" style=" width:65px" onChange="daychange();">
<%for i=1999 to 2010
if i=year(now) then%>
<option selected value="<%=cstr(year(now))%>"><%=year(now)%></option>
<%else%>
<option value="<%=cstr(i)%>"><%=cstr(i)%></option>
<%end if
next %>
</select>
年<select name="month1" size="1" onchange="daychange();">
<%for i=1 to 12
if i=month(now) then%>
<option selected value="<%=month(now)%>"><%=month(now)%></option>
<%else%>
<option value="<%=i%>"><%=i%></option>
<%end if
next%>
</select>
月<select name="day1" size="1" onchange="daychange();">
<%for i=1 to 31
if i=1 then%>
<option selected value=<%=i%>><%=i%></option>
<%else%>
<option value="<%=i%>"><%=i%></option>
<%end if
next%>
</select>
日<br>终止日期:
<select name="year2" size="1" style=" width:65px" onChange="daychange2();">
<%for i=1999 to 2010
if i=year(now) then%>
<option selected value="<%=cstr(year(now))%>"><%=year(now)%></option>
<%else%>
<option value="<%=cstr(i)%>"><%=cstr(i)%></option>
<%end if
next %>
</select>
年<select name="month2" size="1" onChange="daychange2();">
<%for i=1 to 12
if i=month(now) then%>
<option selected value="<%=month(now)%>"><%=month(now)%></option>
<%else%>
<option value="<%=i%>"><%=i%></option>
<%end if
next%>
</select>
月<select name="day2" size="1" onChange="daychange2();">
<%for i=1 to 31
if i=day(now)+1 then%>
<option selected value="<%=day(now)+1%>"><%=day(now)+1%></option>
<%else%>
<option value="<%=i%>"><%=i%></option>
<%end if
next%>
</select>
日 </p>
</td>
</tr>
<tr>
<td align=right>列表排序:</td>
<td>添加时间:<input type="radio" name="indexorder" value="regtime" checked><br> 点击数:<input type="radio" name="indexorder" value="clicknum"></td>
</tr>
</table></td>
</tr>
<tr><td nowrap colspan=6 align=center><input type=submit value=查询专题新闻 name=nextSubmit></td>
</tr>
<tr><td nowrap colspan=6 align=center>注:点击专题号可以查看网友评论</td>
</tr>
<input type=hidden value=<%=request("menuid")%> name=menuid>
</table>
</form>
<form>
<input type=hidden value=<%=request("menuid")%> name=menuid>
<%call listPage(rs)%>
<%end if%>
</center>
</div>
</form>
</body>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -