⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c_marketinfosum.asp

📁 一个很好的在线购物系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
'*********************************页面说明 ************************************************** 
'开发者:金寿吉     
'首次开发时间: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 + -