Dim rs,news,sqltext
Dim id,lid,per,ptype,money,pj,menu,tm,io
Dim selname,seltype,listid,pjname,adddate
Set rs=Server.Createobject("Adodb.RecordSet")
sqltext = "Select ID,ListID,Payer,PayType,Money,Project,Menu,Time,InOut From [PayList] "
If Request.QueryString("action") = "search" Then
selname = Request.Form("selname")
seltype = Request.Form("seltype")
adddate = Request.Form("adddate")
listid = Trim(Request.Form("listid"))
pjname = Trim(Request.Form("pjname"))
If selname="" and seltype="" and adddate="" and listid="" and pjname="" Then
sqltext = sqltext & " Order By ID Desc"
Else
sqltext = sqltext & " Where "
If selname"" Then
sqltext = sqltext & "Payer='"&selname&"' "
End if
If seltype"" Then
If selname"" Then sqltext = sqltext & "and "
sqltext = sqltext & "PayType='"&seltype&"' "
End if
If adddate"" Then
If seltype"" Then sqltext = sqltext & "and "
sqltext = sqltext & "Time='"&adddate&"' "
End if
If listid"" Then
If adddate"" Then sqltext = sqltext & "and "
sqltext = sqltext & "ListID="&listid&" "
End if
If pjname"" Then
If listid"" Then sqltext = sqltext & "and "
sqltext = sqltext & " Project like '%"&pjname&"%' "
End if
End if
Else
sqltext = sqltext & " Order By ID Desc"
End if
rs.Open sqltext,Conn,1,3
MaxPerPage=20
text="0123456789"
rs.PageSize=MaxPerPage
for i=1 to Len(Request.QueryString("page"))
checkpage = Instr(1,text,mid(Request.QueryString("page"),i,1))
if checkpage=0 then
exit for
end if
next
If checkpage0 then
If NOT IsEmpty(Request.QueryString("page")) Then
CurrentPage=Cint(Request.QueryString("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > rs.PageCount Then CurrentPage = rs.PageCount
Else
CurrentPage= 1
End If
If not rs.eof Then rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
%>
管理中心
function delpay()
{
if(confirm("确定要删除此吗?"))
return true;
else
return false;
}
报销人
费用类型
日期
单号
项目名称
全部
Dim pa,pt
Set pa=Conn.Execute("Select Payer From [Payer]")
Do While Not pa.Eof
Response.write "" & pa(0) & ""
pa.MoveNext
Loop
pa.Close
Set pa=Nothing
%>
全部
Set pt=Conn.Execute("Select PayType From [PayType]")
Do While Not pt.Eof
Response.write "" & pt(0) & ""
pt.MoveNext
Loop
pt.Close
Set pt=Nothing
%>
所有费用清单
单号
报销人
费用类型
金额
项目名称
说明
日期
操作
i=0
If rs.Eof Then
Response.Write "没有该记录!"
Else
Do While Not rs.Eof
id=rs(0)
lid=rs(1)
per=rs(2)
ptype=rs(3)
money=rs(4)
pj=rs(5)
menu=rs(6)
tm=rs(7)
io=rs(8)
%>
Response.Write "+ " & money
Else
Response.Write "- " & money &""
End if
%>
修改 | 删除
i=i+1
if i >= MaxPerpage then exit do
rs.MoveNext
Loop
End if
Response.Write ""
showpage()
Response.Write ""
If Request.QueryString("action") = "del" Then
Dim dd,delid
delid=Request("id")
Set dd = Conn.Execute("Delete * From [PayList] Where ID ="&delid)
Response.Redirect "Pay_List.asp"
End if
rs.Close
Conn.Close
Set rs = Nothing
Set Conn = Nothing
%>