📄 expenselist.asp
字号:
<!--#include file="../function/connect.asp"-->
<%
meth=request("meth")
client_ID=request("client_ID")
if meth="del" and request("IID")<>"" then
strsql="delete from Expense where Expense_ID in (" & request("IID") &")"
objConn.execute strsql
response.redirect "expenselist.asp?client_ID=" & client_ID
end if
if client_ID="all" then
client_ID=""
end if
'strsql="select s.*,cl.client_name,co.Contact_Name,ch.chance_title as Regarding1,st.Expense_Type from Expense s,clients cl,Contacts co,chances ch,Dict_ExpenseTypes st where cl.client_id=s.client_id and co.Contact_ID=s.Contact_ID and ch.chance_id=s.chance_id and st.Expense_Type_ID=s.Expense_Type_ID "
strsql="select s.*,cl.client_name,co.Contact_Name,ch.chance_title as Regarding1,st.Expense_Type from (((Expense s inner join clients cl on cl.client_id=s.client_id) inner join Contacts co on co.Contact_ID=s.Contact_ID) inner join Dict_ExpenseTypes st on st.Expense_Type_ID=s.Expense_Type_ID) left join chances ch on ch.chance_id=s.chance_id where 1=1 "
'response.write strsql
if client_ID<>"" then
strsql=strsql & " and s.client_ID=" & client_ID
end if
strsql=strsql & " and (s.Creator='" & session("loginuser") & "' or s.IsPublic=1) "
strsql=strsql & " order by Expense_ID desc"
'response.write strsql
Set objRs = Server.CreateObject("adodb.recordset")
objRs.Open strsql,objConn,1,1
%>
<html>
<head>
<title>费用</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../cssD.css" rel=stylesheet>
<script>
function checkNum()
{
rNum=0;
var actID=document.all.IID;
for(i=1;i<actID.length;i++){
if(actID[i].checked==true){
rNum=rNum +1 ;
}
}
return rNum;
}
function checkAll()
{
var actID=document.all.IID;
if(document.form1.checkall.checked==false){
for(i=0;i<actID.length;i++){
actID[i].checked=false;
}
}else{
for(i=0;i<actID.length;i++){
actID[i].checked=true;
}
}
}
function modify()
{
if(checkNum()!=1)
{
alert('修改的项目只能是一个.');
}else{
Expense_ID=getValue();
window.open('expense_edit.asp?Expense_ID='+ Expense_ID,'修改费用','left=150,top=150,width=630,height=360');
//document.form1.action="editExpense.asp";
//document.form1.submit();
}
}
function getValue(){
var actID=document.all.IID;
var getv="";
for(i=0;i<actID.length;i++){
if(actID[i].checked==true){
getv=actID[i].value;
}
}
return getv;
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="103%" border="1" cellspacing="0" cellpadding="2" bordercolorlight='#000000' bordercolordark='#FFFFFF'>
<form name="form1" method="post" action="expenselist.asp">
<tr class="tablehead">
<td width="4%"><input type="checkbox" name="checkall" value="1" onclick="checkAll();"><input type="checkbox" name="IID" value="0" disabled style="display:none;"></td>
<td width="30%" nowrap>
<div align="center">费用主题</div>
</td>
<td width="10%" nowrap>
<div align="center">费用发生日期</div>
</td>
<td width="10%" nowrap>
<div align="center">相关客户</div>
</td>
<td width="10%" nowrap>
<div align="center">相关联系人</div>
</td>
<td width="10%" nowrap>
<div align="center">相关机会</div>
</td>
<td width="10%" nowrap>
<div align="center">费用类型</div>
</td>
<td width="10%" nowrap>
<div align="center">详细描述</div>
</td>
<td width="10%" nowrap>
<div align="center">费用金额</div>
</td>
</tr>
<%if not objrs.eof then
do while not objrs.eof
%>
<tr align="center">
<td width="4%" class="tablehead">
<input type="checkbox" name="IID" value="<%=objrs.fields("Expense_ID")%>">
</td>
<td width="30%" nowrap> <a href="#" onclick="window.open('expense_edit.asp?Expense_ID=<%=objrs.fields("Expense_ID")%>','修改费用','left=150,top=150,width=630,height=360');"><%=objrs.fields("Regarding")%></a></td>
<td width="10%" nowrap> <%=objrs.fields("Expense_Date")%></td>
<td width="10%" nowrap> <%=objrs.fields("client_name")%></td>
<td width="10%" nowrap> <%=objrs.fields("Contact_Name")%></td>
<td width="10%" nowrap> <%=objrs.fields("Regarding1")%></td>
<td width="10%" nowrap> <%=objrs.fields("Expense_Type")%></td>
<td width="10%" nowrap> <%=objrs.fields("Details")%></td>
<td width="10%" nowrap> <%=objrs.fields("Amount")%></td>
</tr>
<%
objrs.movenext
loop
else%>
<tr align="center">
<td colspan="9">
没有费用
</td>
</tr>
<%end if%>
<input type="hidden" name="meth" value="del">
<tr align="center">
<td colspan="9">
<input type="button" value=" 添加 " class="button" onclick="window.open('expense.asp?ID=<%=ID%>','费用','left=150,top=150,width=630,height=360');"> <input type="submit" value=" 删除 " class="button"> <input type="button" value=" 修改 " class="button" onclick="modify();">
</td>
</tr>
</form>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -