增加一个功能条件,急急急!

dalixlq 2018-03-17 07:46:50
增加一个功能条件,显示某个时间段全部人员信息,现在通过查询只能显示出一个员工信息。想实现显示全部员工信息。
对ASP语言不熟悉,请教各位大神!



<li><a href="#" class="selected">明细表</a></li>
</ul>
<div class="clearboth"></div>
<div id="config_one" class="tabs_wrapper"><div class="tabs_main">
<table wIDth="100%" border="0" cellspacing="0" cellpadding="0" align="center">

<form name="form1" method="post" action="?">
<tr>
<td height="30" >

 查询日期:
从<input name="StartDate" class=T1 ID="StartDate"
onClick="popUpCalendar(document.all.StartDate ,document.all.StartDate, 'yyyy-mm-dd')" value="<%=StartDate%>" size="15" maxlength="10"
readonly>
<img onClick="popUpCalendar(document.all.StartDate ,document.all.StartDate, 'yyyy-mm-dd')"
height=21 src="../images/date.gif" wIDth=34
align=absBottom>   

<input name="EndDate" class=T1 ID="EndDate"
onClick="popUpCalendar(document.all.EndDate ,document.all.EndDate, 'yyyy-mm-dd')" value="<%=EndDate%>" size="15" maxlength="10"
readonly>
<img onClick="popUpCalendar(document.all.EndDate ,document.all.EndDate, 'yyyy-mm-dd')"
height=21 src="../images/date.gif" wIDth=34
align=absBottom>   
   员工卡号:
<input name="TJ001" ID="TJ001" type="text" class="T1" size="15" value="<%=TJ001%>">
 <input name="TA025_b1" type="button" class="T1" value="查询员工" onClick="MM_openBrWindow('OpenWin.asp','接受者信息检查','wIDth=430,height=300')">
<input name="Submit" type="submit" class="T1" value="搜索"></td>
</tr>
</form>
<form name="frmE1" action="MsOUTExc.asp" mothed="post" target="_blank">
<input type="hidden" value="<%=SqlStr%>" name="SqlStr">
</form>


<tr>
<td height=100 align="right" valign="top">
<input type=button value=导出Excel name=botn2 onClick="javascript:document.frmE1.submit();" class="INPUT2" style="cursor:hand "> 
<%
SqlStr = " SELECT A.TA001,A.TA005,A.TA017,A.TA016,A.TA034,A.TA004,A.TA014,A.TA023,A.TA042, " &_
" mCOUNTA = (SELECT ISNULL(SUM(TA035),0) AS TA005A " &_
" FROM VIPTA AS C " &_
" WHERE (C.TA017 LIKE A.TA017 + '1%') and (C.TA016 >= A.TA016 + 1) and (C.TA003 >= '"&StartDate&"' and C.TA003 <= '"&EndDate&"') ), " &_
" mCOUNTB = (SELECT ISNULL(SUM(TA035),0) AS TA005B " &_
" FROM VIPTA AS D " &_
" WHERE (D.TA017 LIKE A.TA017 + '2%') and (D.TA016 >= A.TA016 + 1) and (D.TA003 >= '"&StartDate&"' and D.TA003 <= '"&EndDate&"')), " &_
" mCOUNTD = (SELECT ISNULL(SUM(TA035),0) AS TA005D " &_
" FROM VIPTA AS F " &_
" WHERE (F.TA017 LIKE A.TA017 + '%') and (F.TA016 >= A.TA016 + 1) and (F.TA003 >= '"&StartDate&"' and F.TA003 <= '"&EndDate&"') ) " &_
" FROM VIPTA AS A "

mWhere = " where 1=1 "

if TJ001 <> "" then
mWhere = mWhere & " AND A.TA001 = '"&TJ001&"'"
end if
mOrder = " GROUP BY A.TA001,A.TA005,A.TA017,A.TA016,A.TA034,A.TA004,A.TA014,A.TA023,A.TA042 "
SqlStr = SqlStr & mWhere & mOrder
'response.Write SqlStr
call openrs(myrs,sqlstr,1,1)
'myrs.movefirst
if myrs.RecordCount=0 then
' Response.redirect "../admin_news/add_news.asp"
' Response.redirect "../inc/Error.asp?Error_Str=没有找到相关新闻!"
else
If Request.querystring("PageCount")<>"" then
myrs.PageSize=Request.querystring("PageCount")'每页显示的记录数
Else
myrs.PageSize=20'每页显示的记录数
End if
total_page=myrs.PageCount
total_red=myrs.RecordCount
current_page=Request("me_page")

if current_page="" then
current_page=1
elseif not isnumeric(current_page) then
current_page=1
else
current_page=cint(current_page)
end if

if current_page>total_page then
current_page=total_page
elseif current_page<1 then
current_page=1
end if

myrs.AbsolutePage=current_page

'加入的返回代码!
session("back_page")=current_page
session("back_keyword")=keyword
session("back_sort")=news_type
session("back_range")=range
end if

%>
<table wIDth="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="listtable">
<tr class="list_title">
<td align="center" nowrap background="../images/titlebg.gif" class="copyright">序号</td>
<!--<td wIDth="151" align="center" nowrap="nowrap" background="../images/titlebg.gif" class="copyright">查询日期</td>-->
<td align="center" background="../images/titlebg.gif" class="copyright">员工信息</td>
<td align="center" background="../images/titlebg.gif" class="copyright">级别</td>
<td align="center" background="../images/titlebg.gif" class="copyright">奖金累计</td>
<td align="center" background="../images/titlebg.gif" class="copyright">帐户余额</td>
<td align="center" background="../images/titlebg.gif" class="copyright">上月奖金余额</td>
<td align="center" background="../images/titlebg.gif" class="copyright">本月奖金余额</td>
<!--<td align="center" background="../images/titlebg.gif" class="copyright">余额</td>-->
<td align="center" background="../images/titlebg.gif" class="copyright">积分数量</td>
<!--<td align="center" background="../images/titlebg.gif" class="copyright">数量</td>-->
<td align="center" background="../images/titlebg.gif" class="copyright">考勤积分</td>
<td align="center" background="../images/titlebg.gif" class="copyright">推广积分</td>
<td align="center" background="../images/titlebg.gif" class="copyright">本月积分</td>
<td align="center" background="../images/titlebg.gif" class="copyright">总积分</td>
</tr>
<%
For j = 1 to myrs.PageSize
if myrs.eof then exit for end if

'找出剩余货币
mSQL = " SELECT TOP 1 TG007 FROM COPTG WHERE TG001 = '" &myrs("TA001")& "' ORDER BY TG008 DESC "
Call openrs(rs,mSQL,1,1)
If rs.recordcount = 0 Then
TG007 = 0
else
TG007 = rs("TG007")
end if

'找出剩余奖金C
mSQL = " SELECT TOP 1 TG007 FROM CUTTG WHERE TG001 = '" &myrs("TA001")& "' ORDER BY TG008 DESC "
Call openrs(rs,mSQL,1,1)
If rs.recordcount = 0 Then
MoneyTG007 = 0
else
MoneyTG007 = rs("TG007")
end if

'找出剩余奖金B
mSQL = " SELECT TOP 1 TH005 FROM STOTH WHERE TH001 = '" &myrs("TA001")& "' ORDER BY TH006 DESC "
Call openrs(rs,mSQL,1,1)
If rs.recordcount = 0 Then
STOTH005 = 0
else
STOTH005 = rs("TH005")
end if

mSQL = " SELECT TOP 1 TH005 FROM STBTH WHERE TH001 = '" &myrs("TA001")& "' ORDER BY TH006 DESC "
Call openrs(rs,mSQL,1,1)
If rs.recordcount = 0 Then
STBTH005 = 0
else
STBTH005 = rs("TH005")
end if

mSQL = " SELECT TOP 1 TH005 FROM CUTTH WHERE TH001 = '" &myrs("TA001")& "' ORDER BY TH006 DESC "
Call openrs(rs,mSQL,1,1)
If rs.recordcount = 0 Then
TH005 = 0
else
TH005 = rs("TH005")
end if

'找出剩余奖金A
mSQL = " SELECT TOP 1 TG007 FROM CERTG WHERE TG001 = '" &myrs("TA001")& "' ORDER BY TG008 DESC "
Call openrs(rs,mSQL,1,1)
If rs.recordcount = 0 Then
CERTG007 = 0
else
CERTG007 = rs("TG007")
end if

'找出累计总奖金
mSQL = " SELECT TOP 1 TD010,TD012 FROM CUTTD WHERE TD001 = '" &myrs("TA001")& "' ORDER BY TD002 DESC "
Call openrs(rs,mSQL,1,1)
If rs.recordcount = 0 Then
TD010 = 0
TD012 = 0
else
TD010 = rs("TD010")
TD012 = rs("TD012")
end if

%>
<tr class="list_out" onmouseover="this.setAttribute('BKC',this.style.backgroundColor);this.style.backgroundColor='#E8F3FF';" onMouseOut="this.style.backgroundColor=this.getAttribute('BKC');">
<td align="left" >
<%=CStr((myrs.PageSize*(current_page-1))+j)%>
</td>
<!--<td align="left" nowrap><%=StartDate%>~<%=EndDate%></td>-->
<td align="left"><%=myrs("TA001")%> <%=myrs("TA002")%></td>
<td align="left"><%=GetTA005(myrs("TA005"))%></td>
<td align="center"><%=TD010%>
</td>
<td align="center"><%=MoneyTG007%></td>
<td align="center"><%=TG007%></td>
<td align="center"><%=STOTH005%></td>
<!--<td align="center"><%=STBTH005%></td> -->
<td align="center"><%=CERTG007%></td>
<!-- <td align="center"><%=myrs("TA042")%></td> -->
<td align="center"><%=myrs("mCOUNTA")%></td>
<td align="center"><%=myrs("mCOUNTB")%></td>
<td align="center"><%=myrs("mCOUNTD")%></td>
<td align="center"><%=CDbl(myrs("mCOUNTA"))+CDbl(myrs("mCOUNTB"))%></td>
</tr>
<%myrs.MoveNext
If myrs.EOF Then Exit For
next
%>
<tr height="32" class="list_action">
<td height="20" colspan="17" > <div align="center">
...全文
450 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Zerolone 2018-03-19
  • 打赏
  • 举报
回复
你加我qq 666 1823 发代码我看看吧。

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧