<%
dim conn,db
dim connstr
db="data/abcde.mdb"
on error resume next
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
if err then
err.clear
else
conn.open connstr
end if
sub CloseConn()
conn.close
set conn=nothing
end sub
%>
<%if not request("action")="editselect" then %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body background="images/888.gif">
<form action="" method="post">
<input name="action" type="hidden" value="editselect" />
<table width="100%" border="1"class="jz">
<tr>
<td width="15%" height="20" >部门</td>
<td width="10%" >主管</td>
<td width="25%" >日期</td>
<td width="10%" >值班员</td>
<td width="5%" >复选框</td>
</tr>
</table>
<!------------------------->
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from aqpgdata where datediff('d',shijian,now) = 0 and bumen= '1' order by shijian asc"
rs.open sql,conn,1,3
do while not rs.eof
%>
<!------------------------->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" height="22" border="1" cellspacing="1" bgcolor=<%=rs("aqpg")%>>
<tr class="jz1"><input name="check" type="hidden" jianshi="check" value="<%=rs("ID")%>" />
<td width="15%" ><%=rs("bumen")%></td>
<td width="10%" ><%=rs("zhug")%></td>
<td width="25%" ><%=rs("shijian")%></td>
<td width="10%" ><%=rs("jbmj")%></td>
<td width="5%" ><input name="top_<%=rs("ID")%>" type="checkbox" value="1" <%if rs("select")=true then response.Write("checked")%> checked></td>
</tr>
</table>
</table>
</td>
</tr>
<tr>
<%
rs.movenext
i=i+1
loop
rs.close
set rs=nothing
%>
<tr>
</table>
<tr>
<td colspan="4"><label>
<input type="submit" name="Submit" value="点击" />
</label></td>
</tr>
</table>
</form>
<%
else
%>
<meta http-equiv="refresh" content="3" />
<title>修改成功</title>
<%
set rs1=server.CreateObject("adodb.recordset")
For i = LBound(split(request.form("check"),",")) To UBound(split(request.form("check"),","))
rs1.open "select * from aqpgdata where ID="&cint(split(request.form("check"),",")(i)), conn, 1, 3
if not rs1.eof then
if not request.form("top_"&rs1("ID"))="" then rs1("jbmj")=session("name") else
rs1.update
else
response.write "没找到"
end if
rs1.close
next
%>
<%
response.write "成功,三秒后自动返回"
%>
</p>
<%end if%>
</table>
</body>
</html>
[
本帖最后由 bink0205 于 2011-4-6 16:30 编辑 ]