📄 activitylist.asp
字号:
<%
%>
<!--#include file="../conn.asp"-->
<!--#include file="../IsUser.asp"-->
<%
set rcs = server.createobject("adodb.recordset")
Sqlstr = "select ClientID,ClientName from Client where ClientCreatorID="&User_ID&" order by ClientID"
rcs.open Sqlstr,conn,3
if (rcs.bof or rcs.eof) then
response.write "<script language=javascript>"
response.write"alert('尚未有任何客户记录!无法进行联系人操作!');"
response.write"location.href='../menu.asp';"
response.write "</script>"
response.end
end if
SelectClientID = request("SelectClientID")
if SelectClientID = "" then
SelectClientID = rcs("ClientID")
end if
SelectClientID = Cint(SelectClientID)
'获得传递参数
ListPageSize = request("PageSelect")
if ListPageSize = "" then
ListPageSize = 15
end if
ListPageSize = Cint(ListPageSize)
SelectPage = request("SelPage")
'response.write SelectPage
'response.write "$"
if SelectPage = "" then
SelectPage = 1
end if
SelectPage = Cint(SelectPage)
SearchOption =request("S_SearchOption")
if SearchOption = "" then
SearchOption = 0
end if
SearchOption = Cint(SearchOption)
SearchRelation = request("S_Relation")
if SearchRelation = "" then
SearchRelation = "包含"
end if
SearchText = request("T_SearchText")
SqlSearchText = replace(SearchText,"'","''")
SqlSearchText = replace(SearchText,"[","[[]")
SqlSearchText = replace(SearchText,"]","[]]")
SqlSearchText = replace(SearchText,"%","[%]")
SqlSearchText = replace(SearchText,"_","[_]")
%>
<%
'读取数据库数据
SqlKeyChr = Array("ActivityTopic","ActivitySort","ActivityDate","ActivityOverDate","ActivityDetail")
Dim Sqlstr
Sqlstr = "select * from Activity where ActivityCreatorID=" & User_ID & " and ActivityClientID ="&SelectClientID
if SearchText <> "" then
if SearchRelation = "包含" then
Sqlstr = Sqlstr & " and " & SqlKeyChr(SearchOption) & " Like " & " '%"&SqlSearchText&"%' "
else
Sqlstr = Sqlstr & " and " & SqlKeyChr(SearchOption) & " not Like " & " '%"&SqlSearchText&"%' "
end if
'response.write Sqlstr
'response.end
end if
set rs=server.createobject("adodb.recordset")
' Sqlstr = "select * from client where ClientCreatorID=" & User_ID & " or ClientOpenFlag = 1 order by ClientID"
rs.open Sqlstr,conn,3
%>
<%
'判断显示项目
Dim SqlAttachStr,AttachNum,SqlAttachName,AttachOption
SqlAttachNameTab = Array("类型","开始日期","结束日期","活动细节")
SqlAttachStr = Array("","","","")
SqlAttachName = Array("","","","")
AttachNum = 0
AttachOption = ""
For Each item in request.form
if Left(item, 10) = "T_checkbox" then
SqlAttachStr(AttachNum) = request(item)
SqlAttachName(AttachNum) = SqlAttachNameTab(Cint(Mid(item,11,2))-1)
AttachOption = AttachOption + item
AttachNum = AttachNum+1
end if
Next
if (SqlAttachStr(0)+SqlAttachStr(1)+SqlAttachStr(2)) = "" then
SqlAttachStr(0) = "ActivitySort"
SqlAttachName(0) = "类型"
SqlAttachStr(1) = "ActivityDate"
SqlAttachName(1) = "开始日期"
SqlAttachStr(2) = "ActivityOverDate"
SqlAttachName(2) = "结束日期"
SqlAttachStr(3) = "ActivityDetail"
SqlAttachName(3) = "活动细节"
AttachOption = "checkbox01checkbox02checkbox03checkbox04"
AttachNum = 4
end if
'response.Write SqlAttachStr(0)
'response.Write SqlAttachName(0)
'response.Write SqlAttachStr(1)
'response.Write SqlAttachName(1)
'response.Write SqlAttachStr(2)
'response.Write SqlAttachName(2)
'response.Write SqlAttachStr(3)
'response.Write SqlAttachName(3)
'response.Write AttachNum
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>活动信息察看</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META http-equiv=Pragma content=no-cache>
<META content="MSHTML 6.00.2715.400" name=GENERATOR>
<style type="text/css">
<!--
.style1 {color: #FF6600}
-->
</style>
</HEAD>
<!--限制选项只能选4项-->
<script language="javascript" type="text/JavaScript">
function CheckCheckBox(selObj)
{
if(selObj.checked == true)
{
window.document.ReNew.CheckNum.value++;
}
else
{
window.document.ReNew.CheckNum.value--;
}
if(window.document.ReNew.CheckNum.value == 5)
{
selObj.checked = false;
window.document.ReNew.CheckNum.value--;
}
}
</script>
<LINK href="../css.css" rel=stylesheet>
<BODY><BR>
<TABLE width="751" border=0 align=center cellPadding=0 cellSpacing=0>
<!--DWLayoutTable-->
<TBODY>
<form action="Activitylist.asp" method="post" name="ReNew">
<TR>
<TD width="12" height="24" valign="top" ><Span align=center><img src="../images/DispStation_H.gif" width="11" height="24"></span></TD>
<TD colspan="2" align="center" valign="middle" bgcolor="#566CDB" >活动信息察看</TD>
<TD colspan="4" align="right" valign="middle" bgcolor="#DDDDDD" >快速查询:
<select name="S_SearchOption" class="text100" id="S_SearchOption">
<option value="0" <%if SearchOption = 0 then%>selected<% end if %>>活动主题</option>
<%
'生成下拉列表
for i=1 to 4
%>
<option value="<%=i%>" <%if SearchOption = i then%>selected<% end if %>><%=SqlAttachNameTab(i-1)%></option>
<%
next
%>
</select>
<select name="S_Relation" class="text100" id="S_Relation">
<option value="包含" <%if SearchRelation = "包含" then%>selected<% end if %>>包含</option>
<option value="不包含" <%if SearchRelation = "不包含" then%>selected<% end if %>>不包含</option>
</select>
<input name="T_SearchText" type="text" size="20" maxlength="50" value="<%=SearchText%>">
<input name="SearchButton" type="submit" class="button_all" id="Search" value="查询"></TD>
</TR>
<TR align="center" valign="middle">
<TD height="25" colspan="7" style="border: #99ccff 1px solid ">所属客户:
<select name="SelectClientID">
<%
while not(rcs.bof or rcs.eof)
%>
<option value="<%=rcs("ClientID")%>" <%if SelectClientID = rcs("ClientID") then%>selected<% end if %>><%=rcs("ClientName")%></option>
<%
rcs.movenext
wend
rcs.close
set rcs = nothing
%>
</select></TD>
</TR>
<TR>
<TD height="25" colspan="2" valign="top" style="border: #99ccff 1px solid " bgcolor="#6699FF"><!--DWLayoutEmptyCell--> </TD>
<TD width="124" align="center" valign="middle" style="border: #99ccff 1px solid " bgcolor="#6699FF">活动主题</TD>
<TD width="150" align="center" valign="middle" style="border: #99ccff 1px solid " bgcolor="#6699FF"><%=SqlAttachName(0)%></TD>
<TD width="150" align="center" valign="middle" style="border: #99ccff 1px solid " bgcolor="#6699FF"><%=SqlAttachName(1)%></TD>
<TD width="150" align="center" valign="middle" style="border: #99ccff 1px solid " bgcolor="#6699FF"><%=SqlAttachName(2)%></TD>
<TD width="152" align="center" valign="middle" style="border: #99ccff 1px solid " bgcolor="#6699FF"><%=SqlAttachName(3)%></TD>
</TR>
<%
'显示处理
TotalPages = 1
TotalRecords = 0
TotalFlag = 0
if not(rs.bof or rs.eof) then
TotalRecords = rs.recordcount
if ListPageSize = 0 then
ListPageSize = TotalRecords
TotalFlag = 1
end if
rs.pagesize = ListPageSize
TotalPages = rs.pagecount
if SelectPage > TotalPages then
SelectPage = 1
end if
rs.absolutepage = SelectPage
for i = 1 to ListPageSize
if not(rs.bof or rs.eof) then
%>
<TR>
<TD height="25" colspan="2" align="center" valign="middle" style="border: #99ccff 1px solid " ><input type="checkbox" name="ckdelete<%=i%>" value="<%=rs("ActivityID")%>"></TD>
<TD align="center" valign="middle" style="border: #99ccff 1px solid " ><a href="Activity.asp?ActivityID=<%=rs("ActivityID")%>"><%=rs("ActivityTopic")%></a></TD>
<TD align="center" valign="middle" style="border: #99ccff 1px solid " ><%if SqlAttachStr(0) <> "" then%><%=rs(SqlAttachStr(0))%> <%else%> <%end if%></TD>
<TD align="center" valign="middle" style="border: #99ccff 1px solid " ><%if SqlAttachStr(1) <> "" then%><%=rs(SqlAttachStr(1))%> <%else%> <%end if%></TD>
<TD align="center" valign="middle" style="border: #99ccff 1px solid " ><%if SqlAttachStr(2) <> "" then%><%=rs(SqlAttachStr(2))%> <%else%> <%end if%></TD>
<TD align="center" valign="middle" style="border: #99ccff 1px solid " ><%if SqlAttachStr(3) <> "" then%><%=rs(SqlAttachStr(3))%> <%else%> <%end if%></TD>
</TR>
<%
rs.movenext
end if
next
end if
%>
<TR valign="middle">
<TD height="30" colspan="7" > <select name="PageSelect">
<%
'生成下拉列表
for i= 1 to 20
%>
<option <%if ListPageSize = i*5 then%>selected<%end if%> value="<%=i*5%>">每页显示<%=i*5%>条</option>
<%
next
%>
<option <%if TotalFlag = 1 then%>selected<%end if%> value="0">..全部显示..</option>
</select>
<input name="NewActivity" onClick="javascript:location.href='NewActivity.asp?ActivityClientID=<%=SelectClientID%>'" type="button" class="button_all" value="新建">
<input name="DeleteButton" type="button" class="button_all" id="DeleteActivity" value="删除">
<input name="BackButton" onClick="javascript:location.href='../menu.asp'" type="button" class="button_all" id="BackButton" value="返回"> <%if SelectPage<>1 then%><a href="#" name="FirstPage">首页</a> <a href="#" name="PrePage">上一页</a><%else%>首页 上一页<%end if%> <%if SelectPage<>TotalPages then%><a href="#" name="NextPage"> 下一页</a> <a href="#" name="LastPage">末页</a><%else%> 下一页 末页<%end if%> 当前页数:<%=SelectPage%> 总共页数:<%=TotalPages%> 记录总数:<%=TotalRecords%></TD>
<input name="SelPage" type="hidden" value="<%=SelectPage%>">
<input name="TotalPage" type="hidden" value="<%=TotalPages%>">
</TR>
<!--下拉列表响应函数-->
<SCRIPT FOR="PageSelect" EVENT="onChange" LANGUAGE="VBScript">
Dim TheForm
Set TheForm = Document.forms("ReNew")
TheForm.SelPage.value = 1
TheForm.submit()
</SCRIPT>
<!--下拉列表响应函数-->
<!--首页响应函数-->
<SCRIPT FOR="FirstPage" EVENT="onClick" LANGUAGE="VBScript">
Dim TheForm
Set TheForm = Document.forms("ReNew")
TheForm.SelPage.value = 1
TheForm.submit()
</SCRIPT>
<!--首页响应函数-->
<!--首页响应函数-->
<SCRIPT FOR="NextPage" EVENT="onClick" LANGUAGE="VBScript">
Dim TheForm
Set TheForm = Document.forms("ReNew")
TheForm.SelPage.value = TheForm.SelPage.value + 1
TheForm.submit()
</SCRIPT>
<!--首页响应函数-->
<!--首页响应函数-->
<SCRIPT FOR="PrePage" EVENT="onClick" LANGUAGE="VBScript">
Dim TheForm
Set TheForm = Document.forms("ReNew")
TheForm.SelPage.value = TheForm.SelPage.value - 1
TheForm.submit()
</SCRIPT>
<!--首页响应函数-->
<!--首页响应函数-->
<SCRIPT FOR="LastPage" EVENT="onClick" LANGUAGE="VBScript">
Dim TheForm
Set TheForm = Document.forms("ReNew")
TheForm.SelPage.value = TheForm.TotalPage.value
TheForm.submit()
</SCRIPT>
<!--首页响应函数-->
<!--删除响应函数-->
<SCRIPT FOR="DeleteButton" EVENT="onClick" LANGUAGE="VBScript">
Dim TheForm
Set TheForm = Document.forms("ReNew")
MyVar = MsgBox ("你确认要删除选中的活动信息么?",52, "确认删除")
if MyVar = 6 then
TheForm.Action = "DeleteActivityList.asp"
TheForm.submit()
end if
</SCRIPT>
<!--删除响应函数-->
<!--查询响应函数-->
<SCRIPT FOR="SearchButton" EVENT="onClick" LANGUAGE="VBScript">
Dim TheForm
Set TheForm = Document.forms("ReNew")
TheForm.SelPage.value = 1
TheForm.submit()
</SCRIPT>
<SCRIPT FOR="NewView" EVENT="onClick" LANGUAGE="VBScript">
Dim TheForm
Set TheForm = Document.forms("ReNew")
TheForm.SelPage.value = 1
TheForm.submit()
</SCRIPT>
<!--查询响应函数-->
<SCRIPT FOR="SelectClientID" EVENT="onChange" LANGUAGE="VBScript">
Dim TheForm
Set TheForm = Document.forms("ReNew")
TheForm.SelPage.value = 1
TheForm.submit()
</SCRIPT>
<TR align="center" valign="middle">
<TD height="25" colspan="7" valign="middle" style="border: #99ccff 1px solid;"> 显 示 项 目 (4 项) </TD>
</TR>
<TR align="center" valign="middle">
<TD height="25" colspan="7" style="border-left: #99ccff 1px solid;border-right: #99ccff 1px solid;"> <%=SqlAttachNameTab(0)%>
<input type="checkbox" onClick="CheckCheckBox(this)" name="T_checkbox01" value="<%=SqlKeyChr(1)%>" <%if InStr(1,AttachOption,"checkbox01",1)<>0 then%>checked<%end if%>>
<%=SqlAttachNameTab(1)%>
<input type="checkbox" onClick="CheckCheckBox(this)" name="T_checkbox02" value="<%=SqlKeyChr(2)%>" <%if InStr(1,AttachOption,"checkbox02",1)<>0 then%>checked<%end if%>>
<%=SqlAttachNameTab(2)%>
<input type="checkbox" onClick="CheckCheckBox(this)" name="T_checkbox03" value="<%=SqlKeyChr(3)%>" <%if InStr(1,AttachOption,"checkbox03",1)<>0 then%>checked<%end if%>>
<%=SqlAttachNameTab(3)%>
<input type="checkbox" onClick="CheckCheckBox(this)" name="T_checkbox04" value="<%=SqlKeyChr(4)%>" <%if InStr(1,AttachOption,"checkbox04",1)<>0 then%>checked<%end if%>>
</TD>
</TR>
<TR align="left">
<TD height="25" colspan="7" style="border-left: #99ccff 1px solid;border-right: #99ccff 1px solid;" > </TD>
</TR>
<TR align="left">
<TD height="25" colspan="7" style="border-left: #99ccff 1px solid;border-right: #99ccff 1px solid;"> <input type="hidden" name="CheckNum" value=<%=AttachNum%> ></TD>
</TR>
<TR align="center" valign="middle">
<TD height="26" colspan="7" bgColor=#99ccff ><input name="NewView" type="button" class="button_all" id="NewViffew" value="更新"></TD>
</TR>
</form>
<tr>
<td height="1"></td>
<td width="13"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr></TBODY>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</TABLE>
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -