📄 actlist.asp
字号:
<!--#include file="../function/connect.asp"-->
<%
meth=request("meth")
ID=request("client_ID")
if ID<>"" then
session("Client_ID")=ID
end if
if ID="" and session("Client_ID")<>"" then
ID=session("Client_ID")
end if
if ID="all" then
ID=""
end if
if meth="del" and request("act_ID")<>"" then
strsql="delete from acts where act_ID in (" & request("act_ID") &")"
objConn.execute strsql
response.redirect "actlist.asp?ID=" & ID
end if
gdate=request("gdate")
'strsql="select a.*,cl.client_name,co.Contact_Name,ch.chance_title from acts a,clients cl,contacts co,chances ch where a.act_chance=ch.chance_id and cl.client_id=a.act_client and a.act_contact=co.Contact_ID and act_owner='" & session("loginuser") & "'"
'左联结
strsql="select a.*,cl.client_name,co.Contact_Name,ch.chance_title from ((acts a inner join clients cl on cl.client_id=a.act_client) inner join contacts co on a.act_contact=co.Contact_ID) left join chances ch on a.act_chance=ch.chance_id where act_owner='" & session("loginuser") & "'"
if ID<>"" then
strsql=strsql & " and act_client=" & ID
end if
strsql=strsql & " and (a.act_owner='" & session("loginuser") & "' or a.IsPublic=1) "
if gdate<>"" then
if instr(gdate,",")>=1 then
gdates=split(gdate,",")
for i=0 to ubound(gdates)
if gdates(i) & "" <>"" then
if i=0 then
strsql=strsql & " and (datediff('d','" & gdates(i) & "',act_begin_date)=0 "
else
strsql=strsql & " or datediff('d','" & gdates(i) & "',act_begin_date)=0 "
end if
end if
next
strsql=strsql & ")"
else
gdates=split(gdate,"-")
if ubound(gdates)=1 then
strsql=strsql & " and datepart('m',act_begin_date)=" & gdates(1) & " and datepart('yyyy',act_begin_date)=" & gdates(0)
else
strsql=strsql & " and datepart('m',act_begin_date)=" & gdates(1) & " and datepart('yyyy',act_begin_date)=" & gdates(0)& " and datepart('d',act_begin_date)=" & gdates(2)
end if
end if
end if
'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.act_ID;
for(i=1;i<actID.length;i++){
if(actID[i].checked==true){
rNum=rNum +1 ;
}
}
return rNum;
}
function checkAll()
{
var actID=document.all.act_ID;
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{
act_id=getValue();
window.open('act_edit.asp?act_id='+ act_id,'修改联系活动','left=150,top=150,width=630,height=360');
//document.form1.action="editact.asp";
//document.form1.submit();
}
}
function getValue(){
var actID=document.all.act_ID;
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="actlist.asp">
<tr class="tablehead">
<td width="4%"><input type="checkbox" name="checkall" value="1" onclick="checkAll();"><input type="checkbox" name="act_ID" value="0" disabled style="display:none;"></td>
<td width="20%" nowrap>
<div align="center">活动主题</div>
</td>
<td width="19%" nowrap>
<div align="center">相关客户</div>
</td>
<td width="19%" nowrap>
<div align="center">相关联系人</div>
</td>
<td width="19%" nowrap>
<div align="center">相关机会</div>
</td>
<td width="19%" nowrap>
<div align="center">开始日期</div>
</td>
<td width="19%" 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="act_ID" value="<%=objrs.fields("act_ID")%>">
</td>
<td width="20%" nowrap> <a href="#" onclick="javascript:window.open('act_edit.asp?act_id=<%=objrs.fields("act_ID")%>','修改联系活动','left=150,top=150,width=630,height=360');"><%=objrs.fields("act_title")%></a></td>
<td width="19%" nowrap> <%=objrs.fields("client_name")%></td>
<td width="19%" nowrap> <%=objrs.fields("Contact_Name")%></td>
<td width="19%" nowrap> <%=objrs.fields("chance_title")%></td>
<td width="19%" nowrap> <%=objrs.fields("act_begin_date")%></td>
<td width="19%" nowrap> <%=objrs.fields("act_end_date")%></td>
</tr>
<%
objrs.movenext
loop
else%>
<tr align="center">
<td colspan="7">
没有联系活动
</td>
</tr>
<%end if%>
<input type="hidden" name="meth" value="del">
<input type="hidden" name="ID" value="<%=ID%>">
<tr align="center">
<td colspan="7">
<input type="button" value=" 添加 " class="button" onclick="window.open('act.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 + -