📄 equipment.asp
字号:
<%
pathlevel="../"
%>
<!--#include file="../database/conn.asp" -->
<!--#include file="../share/checkinput.asp" -->
<!--#include file="../share/checklogin.asp" -->
<script language="javascript">
function del(id,sid,item_id)
{
if(window.confirm("确定要删除此项目吗?"))
{
mystring="del.asp?id="+id+"&sid="+sid+"&item_id="+item_id
setTimeout('location.href=mystring',1)
location.href=mystring
}
}
</script>
<%
mess=request("mess")
select case mess
case 1
message="设备编号不能为空"
case 2
message="设备名称不能为空"
case 3
message="该设备编号已存在"
case 4
message="该设备名称已存在"
case 5
message="数据不存在或被删除"
case 6
message="购入时间格式不对,请按照提示格式输入!"
case 62
message="投入使用时间格式不对,请按照提示格式输入!"
case 7
message="请输入人民币数字!"
case 8
message="在使用年限输入数字!"
case 9
message="使用年限不能0 !"
case 10
message="添加成功!"
case 11
message="修改成功!"
end select
%>
<table width="100%" border="0" valign=top cellpadding="0" cellspacing="0">
<tr>
<td height="25" valign="middle" bgcolor="#C8E0FB"><font size="4"> </font><span class="redfont"><strong><font size="4">设备资料库</font></strong></span></td>
</tr>
<tr>
<form action="index.asp?id=<%=id%>&sid=<%=sid%>" method="post" name="myform" id="myform" onSubmit="return checkinput()">
<td height="36" valign=middle class=blackfont>
<font size="4"> 设备编号:<input name="query_eq_id" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="" maxlength="20">
设备名称:<input name="query_eq_name" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="" maxlength="20">
管理员:<input name="query_admin_name" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="" maxlength="20">
<input type="submit" name="Submit" value="查 询"></font><span class=redfont><font size="4"> ( 输入关键字查询 )</font></span><font size="4">
</font>
</td>
</form>
</tr>
<tr>
<td height="2" valign="middle" bgcolor="#666666"></td>
</tr>
<tr>
<td height=200 valign="top" bgcolor="#C8E0FB">
<table width="100%" border="0" valign=top align="center" cellpadding="0" cellspacing="0" bgcolor="#f0f0f0" class="blackfont">
<tr bgcolor="#8CBDFF">
<td width="10%" align=center height="25"><strong>
<font size="4">设备编号</font></strong></td>
<td width="10%" align=center><strong><font size="4">设备名称</font></strong></td>
<td width="10%" align=center nowrap><strong><font size="4">设备型号</font></strong></td>
<td width="10%" align=center nowrap><strong><font size="4">设备价格</font></strong></td>
<td width="10%" align=center nowrap><strong><font size="4">购入时间</font></strong></td>
<td width="10%" align=center nowrap><strong><font size="4">投入使用时间</font></strong></td>
<td width="10%" align=center nowrap><strong><font size="4">使用年限</font></strong></td>
<td width="10%" align=center nowrap><strong><font size="4">设备现状</font></strong></td>
<td width="10%" align=center nowrap><strong><font size="4">管理员</font></strong></td>
<td width="10%" align=center nowrap><div align="center"><strong>
<font size="4">操 作</font></strong></div></td>
</tr>
<%
query_eq_id=request("query_eq_id")
query_eq_name=request("query_eq_name")
query_admin_name=request("query_admin_name")
spage=request("page")
call checkinput(query_eq_id)
call checkinput(query_eq_name)
call checkinput(query_admin_name)
if not Isnumeric(spage) then
response.redirect"error.asp?err=2"
end if
sql="select * from equipment"
if len(query_eq_id)>0 then
sql=sql&" where eq_id like '%"&query_eq_id&"%'"
if len(query_eq_name)>0 then
sql=sql&" and eq_name like '%"&query_eq_name&"%'"
if len(query_admin_name)>0 then
sql=sql&" and admin_name like '%"&query_admin_name&"%'"
end if
else
if len(query_admin_name)>0 then
sql=sql&" and admin_name like '%"&query_admin_name&"%'"
end if
end if
else
if len(query_eq_name)>0 then
sql=sql&" where eq_name like '%"&query_eq_name&"%'"
if len(query_admin_name)>0 then
sql=sql&" and admin_name like '%"&query_admin_name&"%'"
end if
else
if len(query_admin_name)>0 then
sql=sql&" where admin_name like '%"&query_admin_name&"%'"
end if
end if
end if
set rs=server.CreateObject("adodb.recordset")
rs.Cursorlocation=3
rs.open sql,cn,1,3
if rs.eof then
response.write " <span class='redfont'>查询不到或还未添加任何项目</span>"
else
rs.PageSize=10
pagesize=rs.pagesize
pagecount=rs.PageCount
allcount=rs.RecordCount
if cint(spage)<=pagecount and spage>0 then
rs.AbsolutePage=cint(spage)
else
spage="1"
rs.AbsolutePage=cint(spage)
end if
for i=1 to rs.PageSize
%>
<tr bgcolor="eeeeee">
<td height="25" align=center><font size="4"><%=rs("eq_id")%></font></td>
<td align=center><font size="4"><%=rs("eq_name")%></font></td>
<td align=center nowrap><font size="4"><%=rs("eq_type")%></font></td>
<td align=center nowrap><font size="4">¥<%=rs("buy_price")%></font></td>
<td align=center nowrap><font size="4"><%=rs("buy_time")%></font></td>
<td align=center nowrap><font size="4"><%=rs("puse_time")%></font></td>
<td align=center nowrap><font size="4"><%=rs("useyear_limit")%></font></td>
<td align=center nowrap><font size="4"><%=rs("equ_now")%></font></td>
<td align=center nowrap><font size="4"><%=rs("admin_name")%></font></td>
<td align=center><div align="center">
<font size="4">
<%
link="index.asp?id="&id&"&sid="&sid&"&seq_id="&rs("id")&""
str="<a class=right_white href="&link&" title='修改项目 "&rs("eq_name")&"'>修改</a> | <a class=right_white href='javascript:del("&id&","&sid&","&rs("id")&")' title='删除项目 "&rs("eq_name")&"'>删除</a>"
response.write str
%>
</font>
</td>
</tr>
<%
rs.movenext
if rs.eof then
exit for
end if
next
%>
<tr bgcolor="#8CBDFF">
<td width="100%" height=20 colspan=10 align=center nowrap><div align="right">
<font size="4">共 <%=pagecount%> 页,<%=allcount%> 条记录,每页 <%=pagesize%> 条</font>记录,本页是第 <%=spage%> 页. <a class=right_white href='index.asp?id=<%=id%>&sid=<%=sid%>&page=1&query_eq_id=<%=query_eq_id%>&query_eq_name=<%=query_eq_name%>&query_admin_name=<%=cstr(query_admin_name)%>'>首页</a>
<% if cint(spage)>1 then
Response.write "<a class=right_white href='index.asp?id="&id&"&sid="&sid&"&page="&cstr(spage-1)&"&query_eq_id="&cstr(query_eq_id)&"&query_eq_name="&cstr(query_eq_name)&"&query_admin_name="&cstr(query_admin_name)&"'>上一页</a> "
end if
if cint(spage)<pagecount then
Response.write "<a class=right_white href='index.asp?id="&id&"&sid="&sid&"&page="&cstr(spage+1)&"&query_eq_id="&query_eq_id&"&query_eq_name="&query_eq_name&"&query_admin_name="&cstr(query_admin_name)&"'>下一页</a> "
Response.write "<a class=right_white href='index.asp?id="&id&"&sid="&sid&"&page="&pagecount&"&query_eq_id="&query_eq_id&"&query_eq_name="&query_eq_name&"&query_admin_name="&cstr(query_admin_name)&"'>尾页</a> "
end if
end if
%> </div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="2" valign="middle" bgcolor="#999999"></td>
</tr>
<%
seq_id=request("seq_id")
if not Isnumeric(seq_id) then
response.redirect"error.asp?err=2"
end if
if seq_id>0 then
rs.close
sql="select * from equipment where id="&seq_id
rs.open sql,cn,1,3
if rs.eof then
response.redirect"error.asp?err=1"
else
n=1
end if
end if
%>
<tr>
<td height="25" valign="middle" bgcolor="#C8E0FB"> <span class="redfont"><strong><% if n=1 then response.write "修改" else response.write "添加" end if%>设备资料</strong> *标记为必填项</span></td>
</tr>
<tr>
<td height=200 valign="top" bgcolor="#C8E0FB">
<form action="<% if n=1 then response.write "edit" else response.write "add" end if%>.asp?id=<%=id%>&sid=<%=sid%><%if n=1 then response.write "&seq_id="&rs("id")%>" method="post" name="myform" id="myform" onSubmit="return checkinput()">
<table width="500" border="0" valign=top align="center" cellpadding="0" cellspacing="0" bgcolor="#C8E0FB" class="blackfont">
<tr>
<td height="36" valign=middle class=blackfont>
设备编号 :<input name="eq_id" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("eq_id") end if%>" maxlength="20"><span class="redfont"> *</span>
</td>
<td valign=middle class=blackfont>
设备名称 :<input name="eq_name" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("eq_name") end if%>" maxlength="30"><span class="redfont"> *</span>
</td>
</tr>
<tr>
<td height="36" valign=middle class=blackfont>
设备型号 :<input name="eq_type" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("eq_type") end if%>" maxlength=20>
</td>
<td height="36" valign=middle class=blackfont>
设备价格 :<input name="buy_price" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("buy_price") end if%>" maxlength="20"><span class="redfont"> 数字RMB</span>
</td>
</tr>
<tr>
<td height=36 valign=middle class=blackfont>
使用年限 :<input name="useyear_limit" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("useyear_limit") end if%>" maxlength=20>
</td>
<td valign=middle class=blackfont>
购进时间 :<input name="buy_time" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("buy_time") end if%>" maxlength="20"><span class="redfont"> 格式:2005-05-25</span>
</td>
</tr>
<tr>
<td valign=middle class=blackfont>
管 理 员 :<input name="admin_name" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("admin_name") end if%>" maxlength="20">
</td>
<td height=36 valign=middle class=blackfont>
投入使用时间:<input name="puse_time" type="text" style="width:90px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("puse_time") end if%>" maxlength="20"><span class="redfont"> 格式:2005-05-25</span>
</td>
</tr>
<%
if n=1 then
%>
<tr>
<td height=36 valign=middle colspan=2 class=blackfont>
设备现状 :<select name="equ_now" type="select" style="width:100px;border: 0px solid #CCCCCC;height:20px">
<% if rs("equ_now")="良好" then %>
<option><%=rs("equ_now")%></option>
<option>有故障</option>
<%
end if
if rs("equ_now")="有故障" then %>
<option><%=rs("equ_now")%></option>
<option>良好</option>
<%
end if
%>
<%
if rs("equ_now")="已经报废" then %>
<option><%=rs("equ_now")%></option>
<option>有故障</option>
<%
end if
%>
</select>
</td>
</tr>
<%
end if
%>
<tr>
<td height="36" valign=middle align=right class=blackfont>
<input type="submit" name="Submit" value="<% if n=1 then response.write "修 改" else response.write "添 加" end if%>">
</td>
<td valign=middle align=left class=blackfont>
<input type="reset" name="reset" value="重 置">
</td>
</tr>
<tr>
<td height="20" valign=middle colspan=2 class=blackfont><span class="redfont"><b><%=message%></b></span>
</td>
</tr>
<% if n=1 then
%>
<tr>
<td height="20" colspan=2 valign=middle class=blackfont>
<input name="h_id" type="hidden" value="<%=rs("id")%>" maxlength="20">
</td>
</tr>
<% end if %>
</table>
</form>
</td>
</tr>
</table>
<%
rs.close
set rs=nothing
cn.close
set cn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -