28,391
社区成员
发帖
与我相关
我的任务
分享
<script language="javascript">
var flag=true
function checkForm()
{
if(document.editArticleType.typeName.value=="")
{
alert("请填写类别名称!");
document.editArticleType.typeName.focus()
return false
}
return true
}
function selectAll()
{
for (var i=0;i<document.editArticleType.typeDel.length;i++)
{
var temp=document.editArticleType.typeDel[i];
temp.checked=!temp.checked;
}
if(flag)
{flag=false}
else
{flag=true}
}
function cancelAll()
{
for (var i=0;i<document.editArticleType.typeDel.length;i++)
{
var temp=document.editArticleType.typeDel[i];
temp.checked=!temp.checked;
}
if(flag)
{flag=false}
else
{flag=true}
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<body>
<%
on error resume next
set connLink=server.CreateObject("adodb.connection")
dbpath1=server.MapPath("/ccdata.mdb")
connLink.open "provider=microsoft.jet.oledb.4.0; data source="&dbpath1
if connLink.state <> 1 then
response.write "数据库连接错误,请检查连接字符串!错误描述为:"&err.Description
set connLink=nothing
response.end
end if
%>
<form action="addArticleType.asp" method="post" enctype="application/x-www-form-urlencoded" name="editArticleType" target="_self">
<%
set getRs=Server.CreateObject("Adodb.recordset")
getRs.open"select * from articleType order by listid",connLink,1,1
if getRs.eof then
response.Write("当前还没有文章分类")
else
response.Write "<table width='100%'align='center' border='0'>"&Vbcrlf&_
"<tr><td width='5%'></td><td width='10%'>序号</td>"&Vbcrlf&_
"<td width='40%'>标题</td>"&Vbcrlf&_
"<td width='10%'>删除</td>"&Vbcrlf&_
"<td width='10%'>编辑</td>"&Vbcrlf&_
"<td width='10%'>上移</td>"&Vbcrlf&_
"<td width='10%'>下移</td><td width='5%'></td></tr>"&Vbcrlf
Do While not(getRs.eof)
response.Write "<tr><td width='5%'></td><td width='10%'>"&getRs("id")&"</td>"&Vbcrlf&_
"<td width='40%'>"&getRs("title")&"</td>"&Vbcrlf&_
"<td width='10%'><input id='typeDel' name='typeDel' type='checkbox'value='"&getrs("id")&"'></td>"& Vbcrlf&_
"<td width='10%'>"&"<a href='editType.asp?id="&getRs("id")&"'>编辑</a>"&Vbcrlf&_
"<td width='10%'><a href='editType.asp?"&"id="&getRs("id")&"&action=up' target='_self'>"&"上移</a></d>"&Vbcrlf&_
"<td width='10%'><a href='editType.asp?"&"id="&getRs("id")&"&action=down' target='_self'>"&"下移</a></td>"
getRs.movenext
Loop
end if
set getRs=nothing
%><td width="5%"></td></tr>
</table>
<table width="100%">
<tr><td width="5%"></td>
<td width="10%"><input name="delAll" type="image" value="sellectAll" onclick="selectAll();" src="image/selectAll.gif" alt="选择全部" align="left" /></td>
<td width="10%"><input name="cancelSelect" onclick="cancelAll();" type="image" src="image/cancelSelect.gif" alt="取消所选" align="left" /></td>
<td width="10%"><input name="delSelect" type="image" src="image/delSelect.gif" alt="删除所选" align="left" /></td>
<td width="20%">类别名称:<input name="typeName" type="text" size="10" /></td>
<td width="20%"> <select name="menu" id="menu" >
<option value="请选择类别">--请选择类别--</option>
<%
set rs=Server.CreateObject("Adodb.recordset")
on error resume next
rs.open"select * from articleType order by listid",connLink,1,1
do while not rs.eof
%>
<option value="<%=rs("id")%>"><%=rs("title")%></option>
<%
rs.movenext
loop
set rs=nothing
%>
</select></td>
<td align="left" width="10%"><input id="saveData" name="saveData" type="image" src="image/saveButton.gif" alt="保存所选" align="left" onClick="return checkForm();" /></td><td width="5%"></td>
</tr>
<%
response.Write"</form></table>"
set connLink=nothing
%>
</body>
</html>