⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.asp

📁 关于设备管理的大型系统
💻 ASP
字号:
<!--#include file="user_timeout.asp"-->
<!--#include file="getabcd.asp"-->
<%
page=request("page")
query_time=request("query_time")
'response.write "|"&query_time&"|"
taxis=request("taxis")
if query_time="" or query_time=empty or query_time=null then
	query_time=cstr(year(now()))
end if
'response.write query_time
if taxis="" then
	taxis="zheng"
end if
if query_time="全部" then
	if taxis="zheng" then
		sql="select * from contract order by c_no"
	else
		sql="select * from contract order by c_no desc"
	end if
else
	if taxis="zheng" then
		sql="select * from contract where create_time between #"&query_time&"-1-1 00:00:00# and #"&query_time&"-12-31 23:59:59# order by c_no"
	else
		sql="select * from contract where create_time between #"&query_time&"-1-1 00:00:00# and #"&query_time&"-12-31 23:59:59# order by c_no desc"
	end if
end if
'response.write sql
rs.open sql,conn,1,1
rs.pagesize=10
if page<>"" then
  epage=cint(page)
   if epage<1 then epage=1
   if epage>rs.pagecount then epage=rs.pagecount
else
epage=1
end if
rs.absolutepage=epage

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>北华航天工业学院 设备合同管理系统</title>
<link href="global.css" rel="stylesheet" type="text/css">
<script language=javascript>
	function auto_cal_fpay()
	{
		this.form1.first_payment.value=this.form1.c_total.value*0.9;
	}
</script>
</head>

<body>
<div align="right"><a href="edit_pwd.asp">[修改密码]</a> <a href="help/index.html" target="_black">[帮助]</a> <a href="logout.asp">[退出系统]</a> </div>
<div align="center">
  <p><font face="华文行楷" size="6" color="#FF0000">北华航天工业学院 设备合同管理系统</font></p>
</div>
<hr align="center" width="100%" size="1" noshade="noshade" />
<form id="form2" name="form2" method="post" action="main.asp">
  合同查询:<select name="query_time" id="query_time">
	  <option <%if query_time="全部" then response.write "selected" end if%>>全部</option>
	  <%for i=2005 to cint(year(now()))%>
    	<option <%if query_time=cstr(i) then response.write "selected" end if%>><%=i%></option>
    <%next%>
  </select>年&nbsp;&nbsp;&nbsp;&nbsp;
  <input type="radio" name="taxis" value="zheng" <%if taxis="zheng" then response.write "checked" end if%> />升序排列
  <input type="radio" name="taxis" value="fan" <%if taxis="fan" then response.write "checked" end if%> />降序排列&nbsp;&nbsp;&nbsp;&nbsp;
  <input type="submit" name="Submit" value=" 查 询 " />
</form>

<hr align="center" width="100%" size="1" noshade="noshade" />
<div align="right"><a href="main.asp?query_time=<%=query_time%>&taxis=<%=taxis%>&page=<%=page%>">[刷新数据]</a> </div>
<center>
<%
if rs.eof then
	response.write "暂无数据!"
else
%>
<table width="100%" border="1" cellpadding="0" bordercolorlight="#000000" bordercolordark="#FFFFFF">
  <caption>
    <%=query_time%>年设备合同一览表
  </caption>
  <tr bgcolor="#cccccc" align="center">
    <td>合同号</td>
    <td>合同内容</td>
    <td>总金额</td>
    <td>录入时间</td>
    <td>审核时间</td>
    <td>首款</td>
    <td>批首款时间</td>
    <td>尾款</td>
    <td>批尾款时间</td>
    <td width=60>合同状态</td>
    <td width=85>操作</td>
  </tr>
  <%
  for i=0 to rs.pagesize-1
	if rs.bof or rs.eof then exit for
  %>
  <tr onMouseOver="this.style.backgroundColor='#eeeeee'" onMouseOut ="this.style.backgroundColor=''">
    <td align="center">
    <%
    if rs("c_file")="nothing" then
    	response.write rs("c_no")
    else
    	response.write "<a href='con_files/"&rs("c_file")&"' target='_black'>"&rs("c_no")&"</a>"
    end if
    	%></td>
    <td align="left"><%=rs("c_content")%></td>
    <td align="right"><%=FormatCurrency(rs("c_total"))%></td>
    <td align="left"><%=rs("create_time")%></td>
    <td align="left"><%=rs("audit_time")%>&nbsp;</td>
    <td align="right"><%=FormatCurrency(rs("first_payment"))%></td>
    <td align="left"><%=rs("firstpay_time")%>&nbsp;</td>
    <td align="right">
    	<%
    	if rs("last_payment")=0 then
    		response.write "¥0.00"
    	else
    		response.write FormatCurrency(rs("last_payment"))
    	end if
    	%></td>
    <%
    if rs("c_state")="l_passed" then
			lastpay_time="<font color=#000000>"&rs("lastpay_time")&"</font>"
		else
			if datediff("d",now(),rs("lastpay_time"))>0 then
				lastpay_time="<font color=#0000bb>"&rs("lastpay_time")&"</font>"
			else
				if datediff("d",now(),rs("lastpay_time"))>-90 then
					lastpay_time="<font color=#bbbb00>"&rs("lastpay_time")&"</font>"
				else
					lastpay_time="<font color=#bb0000>"&rs("lastpay_time")&"</font>"
				end if
			end if
		end if
		%>
    <td align="left"><%=lastpay_time%>&nbsp;</td>
    <%
    if rs("c_state")="new" then
			c_state="<font color=#000099>未审核</font>"
		end if
		if rs("c_state")="audited" then
			c_state="<font color=#009900>已审核</font>"
		end if
		if rs("c_state")="f_passed" then
			c_state="<font color=#999900>已批首款</font>"
		end if
		if rs("c_state")="l_passed" then
			c_state="<font color=#990000>已批尾款</font>"
		end if
		%>
    <td align="center"><%=c_state%></td>
    <td>
   	<%if session("u_level")="inputter" and rs("c_state")="new" then%>
   		<a href="edit_contract.asp?c_no=<%=rs("c_no")%>">[编辑]</a><br><a href="is_del.asp?c_no=<%=rs("c_no")%>">[删除]</a>
   	<%end if%>
   	<%if session("u_level")="auditor" and rs("c_state")="new" then%>
   		<a href="audit_contract.asp?c_no=<%=rs("c_no")%>&c_content=<%=rs("c_content")%>&c_total=<%=rs("c_total")%>&first_payment=<%=rs("first_payment")%>&last_payment=<%=rs("last_payment")%>">[审核]</a>
   	<%end if%>
   	<%if session("u_level")="auditor" and rs("c_state")="audited" then%>
   		<a href="unaudit_contract.asp?c_no=<%=rs("c_no")%>">[取消审核]</a>
   	<%end if%>
   	<%if session("u_level")="master" and rs("c_state")="audited" then%>
   		<a href="pass_fpay.asp?c_no=<%=rs("c_no")%>">[批首款]</a>
   	<%end if%>
   	<%if session("u_level")="master" and rs("c_state")="f_passed" then%>
   		<a href="unpass_fpay.asp?c_no=<%=rs("c_no")%>">[取消首款]</a><br><a href="pass_lpay.asp?c_no=<%=rs("c_no")%>">[批尾款]</a>
   	<%end if%>
   	<%if session("u_level")="master" and rs("c_state")="l_passed" then%>
   		<%if rs("last_payment")=0 then%>
   			<a href="unpass_fpay.asp?c_no=<%=rs("c_no")%>">[取消首款]</a>
   		<%else%>
   			<a href="unpass_lpay.asp?c_no=<%=rs("c_no")%>">[取消尾款]</a>
   		<%end if%>
   	<%end if%>
    &nbsp;</td>
  </tr>
  <%
  	rs.movenext
  next
  %>
</table>
<p align="right">
共查询到<font color=red><%=rs.recordcount%></font>项符合条件的合同记录&nbsp;
<%if epage=1 then%>首页<%else%><a href="main.asp?query_time=<%=query_time%>&taxis=<%=taxis%>&page=1">首页</a><%end if%>&nbsp;
<%if epage=1 then%>前一页<%else%><a href="main.asp?query_time=<%=query_time%>&taxis=<%=taxis%>&page=<%=epage-1%>">前一页</a><%end if%>&nbsp;
<%if epage=rs.pagecount then%>后一页<%else%><a href="main.asp?query_time=<%=query_time%>&taxis=<%=taxis%>&page=<%=epage+1%>">后一页</a><%end if%>&nbsp;
<%if epage=rs.pagecount then%>末页<%else%><a href="main.asp?query_time=<%=query_time%>&taxis=<%=taxis%>&page=<%=rs.pagecount%>">末页</a><%end if%>&nbsp;
<%=epage%>/<%=rs.pagecount%>页</p>
<%
end if
rs.close
%>
<center><a href="query_to_xls.asp?query_time=<%=query_time%>&taxis=<%=taxis%>">[导出合同数据到Excel]</a></center>
<%if session("u_level")="inputter" then%>
<hr align="center" width="100%" size="1" noshade="noshade" />
<p><font  size="4" color="#FF0000">录入新合同</font></p>
<form id="form1" name="form1" method="post" action="add_contract.asp">
  <table width="90%" border="1" cellpadding="0" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF">
    <tr align="center">
      <td bgcolor="#cccccc">合同号</td>
      <td bgcolor="#cccccc">合同内容</td>
      <td bgcolor="#cccccc">合同文件</td>
      <td bgcolor="#cccccc">总金额</td>
      <td bgcolor="#cccccc">首款</td>
    </tr>
    <%
    '自动生成合同号
    sql1="select c_no from contract where create_time between #"&year(now())&"-1-1 00:00:00# and #"&year(now())&"-12-31 23:59:59#"
    'response.write sql
    'response.end
    rs.open sql1,conn,1,1
    query_num=rs.recordcount
    rs.close
    'response.write query_num
    'response.end
    if query_num<=0 then
    	tmp="HT"&mid(cstr(year(now())),3,2)&"001"
    	'response.write tmp
    else
    	sql2="select max(c_no) from contract where create_time between #"&year(now())&"-1-1 00:00:00# and #"&year(now())&"-12-31 23:59:59#"
    	rs.open sql2,conn,1,1
    	tmp=cstr(cint(mid(rs(0),5,3))+1)
    	if len(tmp)=1 then
    		tmp="00"&tmp
    	elseif len(tmp)=2 then
    		tmp="0"&tmp
    	end if
    	tmp=mid(rs(0),1,4)&tmp
    	'response.write tmp
    	rs.close
    end if
   	
    'mid(rs(0),5,3)
    %>
    <tr align="center">
      <td><input name="c_no" type="text" id="c_no" value="<%=tmp%>" size="7" /></td>
      <td><input name="c_content" type="text" id="c_content" size="45" /></td>
      <td><input name="c_file" type="file" id="c_file" size="24" /></td>
      <td><input name="c_total" type="text" id="c_total" size="12" onchange="auto_cal_fpay()" /></td>
      <td><input name="first_payment" type="text" id="first_payment" size="12" /></td>
    </tr>
  </table>
  <p align="center">
    <input type="submit" name="Submit" value=" 提 交 " />
    <input type="reset" name="Submit2" value=" 重 置 " />
  </p>
</form>
<%end if%>
</center>
<%
if session("u_level")="master" then
	stat_all_num=0
	stat_all_pay=0.00
	stat_unpay_num=0
	stat_unpay_pay=0.00
	stat_fpay_num=0
	stat_fpay_pay=0.00
	stat_f_payed=0.00'已支付的首款总额
	stat_l_unpay=0.00'未支付的尾款总额
	stat_lpay_num=0
	stat_lpay_pay=0.00
	rs.open sql,conn,1,1
	for i=1 to rs.recordcount
		stat_all_num=stat_all_num+1
		stat_all_pay=stat_all_pay+rs("c_total")
		if rs("c_state")="new" or rs("c_state")="audited" then
			stat_unpay_num=stat_unpay_num+1
			stat_unpay_pay=stat_unpay_pay+rs("c_total")
		elseif rs("c_state")="f_passed" then
			stat_fpay_num=stat_fpay_num+1
			stat_fpay_pay=stat_fpay_pay+rs("c_total")
			stat_f_payed=stat_f_payed+rs("first_payment")
			stat_l_unpay=stat_l_unpay+rs("last_payment")
		else
			stat_lpay_num=stat_lpay_num+1
			stat_lpay_pay=stat_lpay_pay+rs("c_total")
		end if
		rs.movenext
	next
%>
	<hr align="center" width="100%" size="1" noshade="noshade" /><br>
	<table width="90%" border="1" cellpadding="0" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF">
  <caption>
    <%=query_time%>年设备合同情况统计
  </caption>
  <tr>
    <td bgcolor="#CCCCCC"><div align="center">&nbsp;</div></td>
    <td bgcolor="#CCCCCC"><div align="center">项目数</div></td>
    <td bgcolor="#CCCCCC"><div align="center">金额</div></td>
    <td bgcolor="#CCCCCC"><div align="center">比例</div></td>
  </tr>
  <tr onMouseOver="this.style.backgroundColor='#eeeeee'" onMouseOut ="this.style.backgroundColor=''">
    <td bgcolor="#CCCCCC"><div align="center">全部项目</div></td>
    <td><div align="center"><%=stat_all_num%></div></td>
    <td><div align="center"><%=FormatCurrency(stat_all_pay)%></div></td>
    <td><div align="center">——</div></td>
  </tr>
  <tr onMouseOver="this.style.backgroundColor='#eeeeee'" onMouseOut ="this.style.backgroundColor=''">
    <td bgcolor="#CCCCCC"><div align="center"><a href="contract_class.asp?query_time=<%=query_time%>&con_class=l_passed" target="_black">已完成项目</a></div></td>
    <td><div align="center"><%=stat_lpay_num%></div></td>
    <td><div align="center"><%=FormatCurrency(stat_lpay_pay)%></div></td>
    <td><div align="center"><%=stat_lpay_num%>/<%=stat_all_num%>(<%=FormatPercent(stat_lpay_num/stat_all_num)%>)</div></td>
  </tr>
  <tr onMouseOver="this.style.backgroundColor='#eeeeee'" onMouseOut ="this.style.backgroundColor=''">
    <td bgcolor="#CCCCCC"><div align="center"><a href="contract_class.asp?query_time=<%=query_time%>&con_class=f_passed" target="_black">仅付首款项目</a></div></td>
    <td><div align="center"><%=stat_fpay_num%></div></td>
    <td><div align="center"><%=FormatCurrency(stat_fpay_pay)%>(已付:<%=FormatCurrency(stat_f_payed)%>,未付:<%=FormatCurrency(stat_l_unpay)%>)</div></td>
    <td><div align="center"><%=stat_fpay_num%>/<%=stat_all_num%>(<%=FormatPercent(stat_fpay_num/stat_all_num)%>)</div></td>
  </tr>
  <tr onMouseOver="this.style.backgroundColor='#eeeeee'" onMouseOut ="this.style.backgroundColor=''">
    <td bgcolor="#CCCCCC"><div align="center"><a href="contract_class.asp?query_time=<%=query_time%>&con_class=unpay" target="_black">未付款项目</a></div></td>
    <td><div align="center"><%=stat_unpay_num%></div></td>
    <td><div align="center"><%=FormatCurrency(stat_unpay_pay)%></div></td>
    <td><div align="center"><%=stat_unpay_num%>/<%=stat_all_num%>(<%=FormatPercent(stat_unpay_num/stat_all_num)%>)</div></td>
  </tr>
</table>
<center><a href="stat_to_xls.asp?query_time=<%=query_time%>&taxis=<%=taxis%>">[导出统计数据到Excel]</a></center>
<%
end if
rs.close
%>
<hr align="center" width="100%" size="1" noshade="noshade" />
<div align="center">
  <p>版权所有 北华航天工业学院</p>
</div>
</body>
</html>
<%call DBConnEnd()%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -