📄 cost_detail.asp
字号:
<%@language=vbscript codepage=936 %>
<%
Option Explicit
%>
<!--#include file="sysconfig.asp"-->
<!--#include file="Inc/Function_1.asp"-->
<%
dim totalPut,CurrentPage,TotalPages
dim i
dim id
dim pinmu,cost_no,isok
dim sql,rs
dim guikou_id,danwei_id,xiangmu_id,rs1,rs2
dim strAdmin,arrAdmin
const MaxPerPage=20
pinmu=Trim(request("pinmu"))
id=Request("id")
guikou_id=Trim(request("guikou_id"))
danwei_id=Trim(request("danwei_id"))
xiangmu_id=Trim(request("xiangmu_id"))
cost_no=Trim(request("cost_no"))
isok=Trim(request("isok"))
dim strFileName
strFileName="cost_detail.asp?guikou_id=" & guikou_id& "&danwei_id=" & danwei_id & "&xiangmu_id=" & xiangmu_id '& "&pinmu=" &pinmu& "&cost_no=" & cost_no& "&isok=" & isok
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
sql="select * from cost_detail where cost_delete=0 "
if isok<>"" then
sql=sql & " and isok='" & isok & "'"
end if
if pinmu<>"" then
sql=sql & " and pinmu_j like '%" & pinmu & "%'"& " or pinmu_r like '%" & pinmu & "%'"
end if
if cost_no<>"" then
sql=sql & " and cost_no_j="& cost_no&"or cost_no_r="& cost_no& ""
end if
if guikou_id<>"" then
sql=sql & " and guikou_id='" & guikou_id & "'"
if danwei_id<>"" then
sql=sql & " and danwei_id='" & danwei_id & "'"
if xiangmu_id<>"" then
sql=sql & " and xiangmu_id='" & xiangmu_id & "'"
end if
end if
end if
sql=sql & " order by id "
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
%>
<SCRIPT language=javascript>
function unselectall()
{
if(document.del.chkAll.checked)
{
document.del.chkAll.checked = document.del.chkAll.checked;
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll")
e.checked = form.chkAll.checked;
}
}
function ConfirmDel()
{
if(confirm("确定要删除选中的支出吗?一旦删除将不能恢复!"))
return true;
else
return false;
}
</SCRIPT>
<!-- #include file="Inc/Head.asp" -->
<BR>
<table cellpadding="2" cellspacing="1" border="0" align="center" class="a2">
<tr>
<td width="783" height="25" align="center" class="a1"><strong>支 出 管 理</strong></td>
</tr>
<tr class="a4">
<td align="center">
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="2" class="border">
<tr class="title">
<td height="28" bgcolor="#C0C0C0" class="t1"><a href="cost_detail.asp">所有支出</a>
|
<%
dim sqlguikou,sqldanwei,sqlxiangmu,rsguikou,rsdanwei,rsxiangmu,rsa,rsb,rsc
sqlguikou="select * from guikou"
Set rsguikou= Server.CreateObject("ADODB.Recordset")
rsguikou.open sqlguikou,conn,1,1
if rsguikou.eof then
response.Write("还没有任何归口,请首先添加归口。")
end if
do while not rsguikou.eof
if rsguikou("id")=guikou_id then
response.Write("<font color='#FF0000'><a href='cost_detail.asp?guikou_id=" & rsguikou("id") & "'>" & rsguikou("guikou_name") & "</a></font> | ")
else
response.Write("<a href='cost_detail.asp?guikou_id=" & rsguikou("id") & "'>" & rsguikou("guikou_name") & "</a> | ")
end if
rsguikou.movenext
loop
rsguikou.close
set rsguikou=nothing
%>
</td>
</tr>
<%
if guikou_id<>"" then
sqldanwei="select * from danwei where cost_delete=0 and guikou_id='" & guikou_id & "'"
Set rsdanwei= Server.CreateObject("ADODB.Recordset")
rsdanwei.open sqldanwei,conn,1,1
if not (rsdanwei.bof and rsdanwei.eof) then
response.write "<tr class='t1'><td bgcolor='#E3E3E3'>"
do while not rsdanwei.eof
if rsdanwei("id")=danwei_id then
response.Write("<font color='#FF0000'> <a href='cost_detail.asp?guikou_id=" & rsdanwei("guikou_id") & "&danwei_id=" & rsdanwei("id") & "'>" & rsdanwei("danwei_name") & "</a></font> ")
else
response.Write(" <a href='cost_detail.asp?guikou_id=" & rsdanwei("guikou_id") & "&danwei_id=" & rsdanwei("id") & "'>" & rsdanwei("danwei_name") & "</a> ")
end if
rsdanwei.movenext
loop
response.write "</td></tr>"
end if
rsdanwei.close
set rsdanwei=nothing
end if
%>
<%
if danwei_id<>"" then
sqlxiangmu="select * from xiangmu where cost_delete=0 and guikou_id='" & guikou_id & "'and danwei_id='" & danwei_id & "'"
Set rsxiangmu= Server.CreateObject("ADODB.Recordset")
rsxiangmu.open sqlxiangmu,conn,1,1
if not (rsxiangmu.bof and rsxiangmu.eof) then
response.write "<tr class='t1'><td bgcolor='#EEEEEEE'>"
do while not rsxiangmu.eof
if rsxiangmu("id")=danwei_id then
response.Write("<font color='#FF0000'> <a href='cost_detail.asp?guikou_id=" & rsxiangmu("guikou_id") & "&danwei_id=" & rsxiangmu("danwei_id") &"&xiangmu_id=" & rsxiangmu("id") & "'>" & rsxiangmu("xiangmu_name") & "</a></font> ")
else
response.Write(" <a href='cost_detail.asp?guikou_id=" & rsxiangmu("guikou_id") & "&danwei_id=" & rsxiangmu("danwei_id") &"&xiangmu_id=" & rsxiangmu("id") & "'>" & rsxiangmu("xiangmu_name") & "</a> ")
end if
rsxiangmu.movenext
loop
response.write "</td></tr>"
end if
rsxiangmu.close
set rsxiangmu=nothing
end if
%>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="border">
<tr class="tdbg">
<form name="search" method="get" action="cost_detail.asp">
<td height="25" class="t1"> <strong>查找条件:<font color="#FF0000"><strong>
<select name="isok" size="1" id="isok">
<option value="" selected>状 态</option>
<option value="0">未确认</option>
<option value="1">已确认</option>
</select>
</strong></font> <font color="#FF0000">“品目”</font></strong>
<input name="pinmu" type="text" class=smallInput id="pinmu" size="20" maxlength="50">
<font color="#FF0000">“ <strong>函号”</strong></font>
<input name="cost_no" type="text" class=smallInput id="cost_no" size="10" maxlength="50">
<font color="#FF0000"><strong> </strong></font>
<input name="Query" type="submit" id="Query" value="查 询">
如果为空,则查找所有支出。</td>
</form>
</tr>
</table>
<form name="del" method="Post" action="cost_detail_Del.asp" onSubmit="return ConfirmDel();">
<table width="100%" border="0" cellpadding="0" cellspacing="2">
<tr>
<td height="25" bgcolor="#CCCCCC" class="t1"><a href="cost_detail.asp"> 支出管理</a>
>>
<%
if request.querystring="" then
response.write "所有支出"
else
if request("Query")<>"" then
if pinmu<>"" then
response.write "品目中含有“<font color=blue>" & pinmu & "</font>”的支出"
else
response.Write("所有支出")
end if
else
if guikou_id<>"" then
set rsa=conn.execute("select * from guikou where cost_delete=0 and id="&guikou_id&"")
response.write rsa("guikou_name")
response.write "<a href='cost_detail.asp?guikou_id=" & guikou_id & "'>(" & guikou_id & ")</a> >> "
if danwei_id<>"" then
set rsb=conn.execute("select * from danwei where cost_delete=0 and id="&danwei_id&"")
response.write rsb("danwei_name")
response.write "<a href='cost_detail.asp?guikou_id=" & guikou_id & "&danwei_id=" & danwei_id & "'>(" & danwei_id & ")</a> >> "
if xingmu_id<>"" then
set rsc=conn.execute("select * from xiangmu where cost_delete=0 and id="&xiangmu_id&"")
response.write rsc("xiangmu_name")
response.write "<a href='cost_detail.asp?guikou_id=" & guikou_id & "&danwei_id=" & danwei_id & "&xiangmu_id=" & xiangmu_id & "'>(" & xiangmu_id & ")</a>"
end if
else
response.write "所有单位所有项目"
end if
end if
if SpecialName<>"" then
response.write "<font color=#FF0000>[关注]</font> " & SpecialName
end if
end if
end if
%>
</td>
<td width="150" bgcolor="#CCCCCC" class="t1">
<%
if rs.eof and rs.bof then
response.write "共有 0 个支出</td></tr></table>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
response.Write "共找到 " & totalPut & " 个支出"
%>
</td>
</tr>
</table>
<%
if currentPage=1 then
showContent
showpage strFileName,totalput,MaxPerPage,true,false,"个支出"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage strFileName,totalput,MaxPerPage,true,false,"个支出"
else
currentPage=1
showContent
showpage strFileName,totalput,MaxPerPage,true,false,"个支出"
end if
end if
end if
%>
<%
sub showContent()
dim i
i=0
%>
<table class="border" border="0" cellspacing="2" width="100%" cellpadding="0" >
<tr bgcolor="#C0C0C0" class="t1">
<td width="5%" height="25" align="center"><strong>选中</strong></td>
<td width="15%" height="25" align="center" bgcolor="#C0C0C0"><strong>单位名称</strong></td>
<td width="10%" align="center" bgcolor="#C0C0C0"><strong>项目名称</strong></td>
<td width="10%" align="center" bgcolor="#C0C0C0" ><strong>计划支出</strong></td>
<td width="10%" align="center" bgcolor="#C0C0C0" ><strong>计划品目</strong></td>
<td width="10%" align="center" bgcolor="#C0C0C0" ><strong>计划时间</strong></td>
<td width="10%" align="center" bgcolor="#C0C0C0" ><strong>确认支出</strong></td>
<td width="10%" align="center" ><strong>确认时间</strong></td>
<td width="5%" align="center" ><strong>确认</strong></td>
<td width="15%" align="center" ><strong>操作</strong></td>
</tr>
<%do while not rs.eof%>
<tr class="t1">
<td width="5%" height="22" align="center" bgcolor="#C0C0C0"> <input name='id'type='checkbox'onclick="unselectall()" id="id" value='<%=cstr(rs("id"))%>'>
</td>
<td width="15%" align="center" bgcolor="#E3E3E3">
<%set rs1=conn.execute("select * from danwei where cost_delete=0 and id="&rs("danwei_id")&"")%> <%=rs1("danwei_name")%></td>
<td width="10%" align="center" bgcolor="#E3E3E3"> <%set rs2=conn.execute("select * from xiangmu where cost_delete=0 and id="&rs("xiangmu_id")&"")%> <%=rs2("xiangmu_name")%></td>
<td width="10%" align="center" bgcolor="#E3E3E3"><%=rs("cost_number_j")%> </td>
<td width="10%" align="center" bgcolor="#E3E3E3"><%=rs("pinmu_j")%> </td>
<td width="10%" align="center" bgcolor="#E3E3E3"><%= FormatDateTime(rs("UpdateTime_j"),2) %></td>
<td width="10%" align="center" bgcolor="#E3E3E3"><%=rs("cost_number_r")%></td>
<td width="10%" align="center" bgcolor="#E3E3E3"><%= FormatDateTime(rs("UpdateTime_r"),2) %></td>
<td width="5%" align="center" bgcolor="#E3E3E3"> <%if rs("isok") then%>
确认
<%else%>
未
<%end if%> </td>
<td width="15%" align="center" bgcolor="#E3E3E3">
<%if admin_quanli=1 then%> <a href="cost_detail_edit.asp?id=<%=rs("id")%>">修改</a>
<a href="cost_detail_Del.asp?id=<%=rs("id")%>&Action=Del" onClick="return ConfirmDel();">删除</a>
<%else if admin_quanli=2 and rs("guikou_id")=admin_guikou_id then %> <a href="cost_detail_edit.asp?id=<%=rs("id")%>">修改</a>
<%else%> <%end if%> <%end if%> <a href="cost_detail_show.asp?id=<%=rs("id")%>">详情</a>
</td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="250" height="30" class="t1">
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
选中本页显示的所有支出</td>
<td class="t1">
<%if admin_quanli=1 then%>
<input name="submit" type='submit'value='删除选定的支出'<%if session("purview")>=3 and session("purview")<=4 and PurviewChecked=False then response.write "disabled"%>>
<input name="Action" type="hidden" id="Action" value="Del">
<%else %>
<%end if%></td>
</tr>
</table>
<%
end sub
%>
</form>
</td>
</tr>
</table>
<BR>
<%
rs.close
set rs=nothing
%>
<%
set rs = Server.CreateObject("ADODB.Recordset")
sqltext="select * from Admin where username='"+Session("username")+"'"
rs.Open sqltext,conn,1,1
if not rs.EOF then
realname=trim(rs("realname"))
lastloginip=trim(rs("lastloginip"))
LastLoginTime=rs("LastLoginTime")
logintimes=rs("logintimes")
idcount=rs(0)
else
end if
rs.Close
%>
<br>
<%htmlend%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -