?? c_marketinfosum.asp
字號:
<%
'*********************************頁面說明 **************************************************
'開發者:金壽吉
'首次開發時間:2001-09-05
'最后一次修改時間:
'主要功能:促銷活動的統計分析
'主要的傳遞參數描述
'1--vYear,vMonth 起始年月
'2--eYear,eMonth 終止年月
'3--DepartID 查詢部門
'4--Sales 查詢員工
'5--condition 查 詢條件
%>
<!--#include file="../include/Pubconn.asp"-->
<!--#include file="../include/PubFun.asp"-->
<%
dim username '當前用戶名
dim userclass '表示用戶的權限級別
dim userCheck '表示用戶是否有審核權限
dim AdoRs '數據記錄集
dim lcSql 'SQL語句
dim key1(),key2(),key3() '分別用來保存客戶意見,數量和所占的百分比
dim DataRow '分別用來表示查詢數據的數量
dim vYear,vMonth '起始年月
dim eYear,eMonth '終止年月
dim Condition '查詢條件
'*********************************得到用戶名并進行表訪問權限判斷 ***********************************
username=GetUser() '得到當前的用戶名
userclass=TableVisitor("C_SalePromotion",username) '得到用戶對表的最高訪問權限
'usercheck=TableCheck("C_SalePromotion",username) '得到文檔的審核權
'***********************************設置傳遞參數的值 *********************************************
vYear=Request("vYear")
eYear=Request("eYear")
vMonth=Request("vMonth")
eMonth=Request("eMonth")
Condition=Request("Condition")
'**********************************設置ADO數據 ****************************************************
set AdoRs=Server.CreateObject("AdoDB.RecordSet")
lcsql="select Suggest,Count(*) as DataRow from C_MarketInfo where delflag<>'1'"
'******************************根據查詢條件和排序條件修改lcSQL語句 ********************************
if Condition<>"" then
lcSql=lcSql+" Where "+Condition
End if
lcSql=lcSql+" Group by Suggest"
AdoRS.Open lcSql,PubConn,1,1
if not Adors.eof then
DataRow=Adors.RecordCount
Redim Key1(DataRow),Key2(DataRow),Key3(DataRow)
i=1
TotalRow=0
yj=""
sl=""
do while not adors.eof
Key1(i)=adors("suggest")
key2(i)=adors("DataRow")
TotalRow=TotalRow+key2(i)
yj=yj+Key1(i)+","
sl=sl+cstr(Key2(i))+","
i=i+1
adors.movenext
loop
For i=1 To DataRow
key3(i)=Round(Key2(i)/TotalRow,4)
Next
end if
Set Adors=Nothing '關閉數據集和連接
Set PubConn=Nothing
%>
<Script Language="VBScript">
'****************************************表單初始化查詢********************************************
Sub formini()
document.forms(0).vYear.value="<%=vYear%>"
document.forms(0).eYear.value="<%=eYear%>"
document.forms(0).eMonth.value="<%=eMonth%>"
document.forms(0).vMonth.value="<%=vMonth%>"
'調整設置的時間值
if document.forms(0).vYear.value="" then document.forms(0).vYear.value=year(now())
if document.forms(0).eYear.value="" then document.forms(0).eYear.value=year(now())
if document.forms(0).eMonth.value="" then
lceMonth=month(now())
if lceMonth<10 then
document.forms(0).eMonth.value="0"+cstr(lceMonth)
else
document.forms(0).eMonth.value=cstr(lceMonth)
end if
end if
End Sub
'****************************************形成查詢條件***********************************************
Sub SearchClick()
dim lcvYear,lcvMonth,lceYear,lceEnd '開始和結束的查詢條件
dim lcDepart,lcStuff '部門編碼和員工編碼
dim lcCondition '形成的查詢條件
lcvYear=document.forms(0).vYear.value
lcvMonth=document.forms(0).vMonth.value
lceYear=document.forms(0).eYear.value
lceMonth=document.forms(0).eMonth.value
lnerror=1
if lceYear<lcvYear then
msgbox "輸入的時間段有錯誤:終止時間大于起始時間",48,"錯誤信息"
else
if lcvMonth<>"" and lceMonth<>"" and lceMonth<lcvMonth then
msgbox "輸入的時間段有錯誤:終止時間大于起始時間",48,"錯誤信息"
else
if lcvMonth="" then lcvMonth="01"
if lceMonth="" then lceMonth="12"
lcBegintime=lcvYear+"-"+lcvMonth+"-"+"01"
lcEndtime=lcEYear+"-"+lceMonth+"-"+"31"
lcCondition="ReportDate>='"+lcBeginTime+"' And ReportDate<='"+lcEndTime+"'"
document.forms(0).Condition.value=lcCondition
fn.submit()
end if
end if
End Sub
Sub picture '進入圖形分析數據處理
dim Rows,Cols
<% for i=1 to DataRow %>
if Rows<>"" then
Rows=Rows+","+"<%=Key1(i)%>"
else
Rows=Rows+"<%=Key1(i)%>"
end if
if Cols<>"" then
Cols=Cols+","+"<%=Key2(i)%>"
else
Cols=Cols+"<%=Key2(i)%>"
end if
<% Next %>
document.forms(1).Rows.value=Rows
document.forms(1).Cols.value=Cols
document.forms(1).submit()
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -