28,406
社区成员
发帖
与我相关
我的任务
分享
set rs_user=server.createobject("adodb.recordset")
sql="select * from baoxiu "
rs_user.open sql,conn,3,2
if checkbox.value="1" then
sql="select * from baoxiu order by baoxiu_id desc"
elseif checkbox.value="2" then
sql="select * from baoxiu where mission_n is null or mission_n = '' order by baoxiu_id desc"
elseif checkbox.value="3" then
sql="select * from baoxiu where (not mission_n is null or mission_n<>'') and (weixiu_zhuangtai is null or weixiu_zhuangtai ='') order by baoxiu_id desc"
elseif checkbox.value="4" then
sql="select * from baoxiu where (not mission_n is null or mission_n<>'') and (not weixiu_zhuangtai is null or weixiu_zhuangtai <>'') order by baoxiu_id desc"
end if


<!--#include file="admin/config.asp"-->
<!--#include file="admin/sql.asp"-->
<%
on error resume next
dim conn
dim connstr
'db="../data/#net.mdb" '数据库文件的位置
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("data/net.mdb")
conn.Open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
sub CloseConn()
On Error Resume Next
Conn.close
set Conn=nothing
end sub
%>
<!--#include file ="conn.asp"-->
<script type="text/javascript">
function mission(strID,Mis,mission_b,strType){
var id;
if (confirm("你确定派发任务给"+Mis+"吗?")){
document.location.href="mission.asp?strID="+strID+"&Mis="+Mis+"&mission_b="+mission_b;
}
}
function gourl(obj){
document.form1.what.value=obj;
document.form1.submit();
}
</script>
<style type="text/css">
<!--
.STYLE1 {color: #ECE9D8}
.STYLE2 {color: #000000}
-->
</style>
<%
if session("baoxiuuser_name") = "admin" then
sql="select * from baoxiu order by baoxiu_id desc"
else
Response.Write "<script>alert('你不能查看此项,请联系管理员!');window.location.href='index.asp';</script>"
Response.end
end if
%>
<form action="paigong.asp" method="post" name="form1" class="STYLE1" style="margin:0px">
<input type="hidden" name="what" />
<a href="javascript:" onclick="gourl('1')">全部显示</a> <span class="STYLE2">|</span>
<a href="javascript:" onclick="gourl('2')">未派送</a> <span class="STYLE2">|</span>
<a href="javascript:" onclick="gourl('3')">维修中</a> <span class="STYLE2">|</span>
<a href="javascript:" onclick="gourl('4')">已维修</a>
</form>
<%
dim xx,sqlr
xx=trim(request.form("what"))
if xx="" then
xx="1" '设置默认的查询条件.
end if
set rs=server.createobject("adodb.recordset")
select case xx
case "1"
sqlr="select * from details order by baoxiu_id desc"
case "2"
sqlr="select * from details where mission_n is null or mission_n = '' order by baoxiu_id desc"
case "3"
sqlr="select * from details where (not mission_n is null or mission_n<>'') and (weixiu_zhuangtai is null or weixiu_zhuangtai ='') order by baoxiu_id desc"
case "4"
sqlr="select * from details where (not mission_n is null or mission_n<>'') and (not weixiu_zhuangtai is null or weixiu_zhuangtai <>'') order by baoxiu_id desc"
end select
'数据库以只读模式打开。
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("data/net.mdb") '连接你的数据库
conn.Open connstr
sqlr="select * from details order by baoxiu_id desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sqlr,conn,1,3
set rs=nothing
conn.close
set conn=nothing
%>
<table width="919" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" height="71" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder5">
<tr>
<td width="84" align="center" class="TableTitle1" style="font-weight: bold" >报修编号</td>
<td width="79" align="center" class="TableTitle1" style="font-weight: bold" >报修部门</td>
<td width="78" align="center" class="TableTitle1" ><strong>报修类别</strong></td>
<td width="70" align="center" class="TableTitle1" ><strong>故障明细</strong></td>
<td width="74" height="30" align="center" class="TableTitle1" ><strong> 维修人员ID</strong></td>
<td width="81" height="30" align="center" class="TableTitle1" ><strong> 维修人员姓名</strong></td>
<td width="63" height="30" align="center" class="TableTitle1" ><strong>分配时间</strong></td>
<td width="86" align="center" class="TableTitle1" style="font-weight: bold" >任务状态</td>
<td width="60" height="30" align="center" class="TableTitle1" ><strong>接收时间</strong></td>
<td width="72" height="30" align="center" class="TableTitle1" ><strong>分配人</strong></td>
</tr>
<%
If(rs.Eof)Then
%>
<%
Response.End()
End If
repeat_rows = 0
While(repeat_rows < rs.PageSize and Not rs.Eof)
%>
<tr>
<script type="text/javascript">
function test(str) {
alert (str);
}
</script>
<td width="84" height="36" align="center" class="TableBody1" ><font color="#0099FF"><%=rs("bx_id")%></font></a></td>
<td width="79" height="36" align="center" class="TableBody1" ><span class="style2"><%=rs("baoxiu_bm")%></span></td>
<td width="78" height="36" align="center" class="TableBody1" ><span class="style2"><%=rs("baoxiu_lb")%></span></td>
<td width="70" height="36" align="center" class="TableBody1" ><span class="style2"><%=rs("baoxiu_wp")%></span></td>
<td width="74" height="36" align="center" valign="middle" class="TableBody1" ><form name="form" method="post" action="">
<select name="mission_b" onChange="mission( <%=rs("baoxiu_ID")%>,this.value,mission_b)" >
<%
dim pg
pg =rs("mission_n")
if rs("mission_n") = "" or isnull(rs("mission_n")) then
%>
<option selected>未派送</option>
<option value="xinxi01">xinxi01</option>
<option value="xinxi02">xinxi02</option>
<option value="xinxi03">xinxi03</option>
<%else%>
<option selected>已派送</option>
<%end if%>
</select>
</form>
</td>
<td width="81" height="36" align="center" class="TableBody1" ><%=rs("mission_n")%></td>
<td width="63" height="36" align="center" class="TableBody1" ><%=rs("fenpei_time")%></td>
<td width="86" height="36" align="center" class="TableBody1" ><%if rs("renwu_zhuangtai")="1" then%>
已接收
<%else%>
<font color=red>未接收</font>
<%end if%>
</td>
<td width="60" align="center" class="TableBody1" ><%=rs("jieshou_time")%></td>
<td width="72" align="center" class="TableBody1" ><span class="style2" style="color: #000000; font-family: "宋体"">管理员</span></td>
</tr>
<%
repeat_rows = repeat_rows + 1
rs.MoveNext
Wend
%>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="40%" height="30">[<font color="red"><%=pageno1%></font>/<%=rs.PageCount%>] 每页<font color="red"><%=rs.PageSize%></font>条 共<font color="red"><%=rs_total1%></font>条记录 </td>
<td width="60%" align="right">
<%for i=1 to maxpage%>[<a href="index.asp?pageno=<%=i%>"><%=i%></a>]<%next%> </td>
</tr>
</table></td>
</tr>
</table>
<%
rs.close
Set rs = Nothing
%>