主题:  请教数字面包

cxj1106

职务:普通成员
等级:1
金币:0.0
发贴:26
注册:2001/6/23 21:44:53
#12001/9/17 14:35:42
我不知道里面有没有错误,请数字面包检查检查拜托了!!!!!!!!!!!!!!!!
<%@ Language=VBScript %>
<% if Session("Access") <> True then Response.Redirect "http://jbcserver/jbcmis/" %>
<%
select case Request.Form("button")
case "无帐单"
Response.Redirect "Null.asp?Year=" & Request.Form("year") & "&Month=" & Request.Form("month")
case "无长话"
Response.Redirect "Noidd.asp?Year=" & Request.Form("year") & "&Month=" & Request.Form("month")
case "上月未付"
Response.Redirect "Notpay.asp?Year=" & Request.Form("year") & "&Month=" & Request.Form("month")
     case "无市话"
     Response.Redirect "Notcity.asp?Year=" & Request.Form("year") & "&Month=" & Request.Form("month")
end select
%>
<% 'if Request.Form("button")="空帐单" then Response.Redirect "Null.asp?Year=" & Request.Form("year") & "&Month=" & Request.Form("month") %>
<% 'if Request.Form("button")="上月未付" then Response.Redirect "Notpay.asp?Year=" & Request.Form("year") & "&Month=" & Request.Form("month") %>
<% public function check(byval temptelephone)
    dim sqlcheck
    set Record1 = Server.CreateObject("ADODB.Recordset")
    sqlcheck = "select * from telfee where datepart(year,enddate)=" & Recyear &" and datepart(month,enddate) = " &Recmonth &" and telephone= '" &temptelephone & "'"
    record1.open sqlcheck,Connection,1
    if record1.RecordCount > 0 then
     check = 1
    else    
     check = 0
    
    end if
    'if temptelephone = "64867979" then
    ' Response.Write sqlcheck
    ' Response.write check
    'end if
    record1.Close
end function
%>



电话清单管理系统



<%
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open "Immigration","sa","3934"
Set Record = Server.CreateObject("ADODB.Recordset")
RecYear=Cint(Request.Form("Year"))
select case Request.Form("all1")
    case "city"
     sqlselect="select * from telfee where datepart(year,enddate)=" & Recyear    
    case "s"
     sqlselect="select * from telfee where datepart(year,enddate)=" & Recyear & " and sf<>0"
    case "net"
     sqlselect="select * from telfee where datepart(year,enddate)=" & Recyear & " and nf<> 0"
end select
if Request.Form("month") <> "" then
Recmonth=Cint(Request.Form("month"))
sqlselect=sqlselect & " and datepart(month,enddate)=" & Recmonth
end if
if Trim(Request.Form("Telephone"))<>"" then
sqlselect=sqlselect & " and telephone= '" & Trim(Request.Form("Telephone")) & "'"
end if
if Trim(Request.Form("Company"))<>"" then
sqlselect=sqlselect & " and company like '%" & Trim(Request.Form("Company")) & "%'"
end if
if Trim(Request.Form("RoomNo"))<>"" then
sqlselect=sqlselect & " and roomno like '%" & Trim(Request.Form("RoomNo")) & "%'"
end if
sqlselect=sqlselect & " and idd+ddd+other<> 0"
sqlselect1=sqlselect & " and payway='自付'" & " order by roomno"
sqlselect2=sqlselect & " and payway='代付'" & " order by roomno"
response.write sqlselect
Record.Open sqlselect1,Connection,1
if not record.EOF then
iddTotal=0
dddTotal=0
otherTotal=0
AllTotal=0
'Response.Write sqlseleect
%>


<%
Response.Write Recyear & "年" & RecMonth & "月"
if Trim(Request.Form("Company"))<>"" then
Response.Write Record.fields("company") & "的"
end if
if Trim(Request.Form("RoomNo"))<>"" then
Response.Write Record.fields("roomno") & "房间的"
end if
if Trim(Request.Form("Telephone"))<>"" then
Response.Write "电话号码" & Record.fields("telephone") & "的"
end if
Response.Write "自付费用情况(共" & Record.RecordCount & "条记录)"
%>





<% if Trim(Request.Form("Telephone")) = "" then %>

<% end if %>
<% if Trim(Request.Form("Company")) = "" then %>

<% end if %>
<% if Trim(Request.Form("RoomNo")) = "" then %>

<% end if %>


<% select case Request("all1")%>
    <% case "city" %>
    
    
    
    
    
    <% case "s"%>
    
    <% case "net"%>
    
<% end select%>




<% do while not Record.eof %>
<%
     select case Request.Form("all1")    
        case "city"
            iddTotal=iddTotal+Record.fields("idd")
            dddTotal=dddTotal+Record.fields("ddd")
            otherTotal=otherTotal+Record.fields("other")
            'sf = sf + Record.Fields("sf")
            'nf = nf + record.Fields("nf")
            AllTotal=iddTotal+dddTotal+otherTotal'+sf+nf
        case "s"
            iddTotal=iddTotal+Record.fields("sf")
            AllTotal=iddTotal
        case "net"
            iddTotal=iddTotal+Record.fields("nf")
            AllTotal=iddTotal
     end select
%>


<% if Trim(Request.Form("Telephone")) = "" then %>

<% end if %>
<% if Trim(Request.Form("Company")) = "" then %>

<% end if %>
<% if Trim(Request.Form("RoomNo")) = "" then %>

<% end if %>


<%select case Request.Form("all1")%>
    <% case "city" %>
    
    
    
    
    
    <%case "s" %>
    
    <%case "net"%>
    
<%end select %>




<%
Record.movenext
Loop
Record.Close

%>


<%
if Trim(Request.Form("Telephone")) = "" then
Response.Write ""
end if
if Trim(Request.Form("Company")) = "" then
Response.Write ""
end if
if Trim(Request.Form("RoomNo")) = "" then
Response.Write ""
end if
%>
    
<%select case Request.Form("all1")%>
    <%case "city"%>
        
        
        
        
    <%case "s"%>
        
    <%case "net"%>
        
<%end select%>




电话号码公司名房号开始日结束日IDD市话费其它共计OK声讯费网络用户签收方式付款日期签收人
<%=Record.fields("telephone")%>
<%
if Trim(Record.fields("company"))="" then
Response.Write " "
else
Response.Write Record.fields("company")
end if
%>

<%
if trim(Record.fields("roomno")) = "" then
Response.Write " "
else
Response.Write Record.fields("roomno")
end if
%>
<%=Record.fields("begindate")%><%=Record.fields("enddate")%><%=Record.fields("idd")%><%=Record.fields("ddd")%><%=Record.fields("other")%><%=Record.fields("idd")+Record.fields("ddd")+Record.fields("other")%><%=Record.fields("lastmonth")%><%=Record.fields("sf")%><%=Record.fields("nf")%><%=Record.fields("payway")%><%=Record.fields("paydate")%> 
合计     <%=iddTotal%><%=dddTotal%><%=otherTotal%><%=AllTotal%><%=iddTotal%><%=iddTotal%>   

<% end if %>





<%
if record.eof then Record.Close
Record.Open sqlselect2,Connection,1
if not record.EOF then
Response.Write Recyear & "年" & RecMonth & "月"
if Trim(Request.Form("Company"))<>"" then
Response.Write Record.fields("company") & "的"
end if
if Trim(Request.Form("RoomNo"))<>"" then
Response.Write Record.fields("roomno") & "房间的"
end if
if Trim(Request.Form("Telephone"))<>"" then
Response.Write "电话号码" & Record.fields("telephone") & "的"
end if
Response.Write "代付费用情况(共" & Record.RecordCount & "条记录)"
iddTotal=0
dddTotal=0
otherTotal=0
AllTotal=0
%>





<% if Trim(Request.Form("Telephone")) = "" then %>

<% end if %>
<% if Trim(Request.Form("Company")) = "" then %>

<% end if %>
<% if Trim(Request.Form("RoomNo")) = "" then %>

<% end if %>



<%select case Request.Form("all1")%>
    <%case "city"%>
        
        
        
        
        
    <%case "s"%>
        
    <%case "net"%>    
        
<%end select%>




<% do while not Record.eof %>
<%
select case Request.Form("all1")    
        case "city"
            iddTotal=iddTotal+Record.fields("idd")
            dddTotal=dddTotal+Record.fields("ddd")
            otherTotal=otherTotal+Record.fields("other")
            AllTotal=iddTotal+dddTotal+otherTotal
        case "s"
            iddTotal=iddTotal+Record.fields("sf")
            AllTotal=iddTotal
        case "net"
            iddTotal=iddTotal+Record.fields("nf")
            AllTotal=iddTotal
end select
%>




<% if Trim(Request.Form("Telephone")) = "" then %>

<% end if %>
<% if Trim(Request.Form("Company")) = "" then %>

<% end if %>
<% if Trim(Request.Form("RoomNo")) = "" then %>

<% end if %>


<%select case Request.Form("all1")%>
    <%case "city"%>
        
        
        
        
        
    <%case "s"%>
        
    <%case "net"%>
        
<%end select%>     




<%
Record.movenext
Loop
Record.Close
%>


<%
if Trim(Request.Form("Telephone")) = "" then
Response.Write ""
end if
if Trim(Request.Form("Company")) = "" then
Response.Write ""
end if
if Trim(Request.Form("RoomNo")) = "" then
Response.Write ""
end if
%>

<%select case Request.Form("all1")%>
    <%case "city"%>
        
        
        
        
    <%case "s"%>
        
    <%case "net"%>
        
<%end select%>




电话号码公司名房号开始日结束日IDD市话费其它共计OK声讯费网络用户签收方式付款日期签收人
<%=Record.fields("telephone")%>
<%
if Trim(Record.fields("company"))="" then
Response.Write " "
else
Response.Write Record.fields("company")
end if
%>

<%
if trim(Record.fields("roomno")) = "" then
Response.Write " "
else
Response.Write Record.fields("roomno")
end if
%>
<%=Record.fields("begindate")%><%=Record.fields("enddate")%><%=Record.fields("idd")%><%=Record.fields("ddd")%><%=Record.fields("other")%><%=Record.fields("idd")+Record.fields("ddd")+Record.fields("other")%><%=trim(Record.fields("lastmonth"))%><%=Record.fields("sf")%><%=Record.fields("nf")%><%=Record.fields("payway")%><%=Record.fields("paydate")%> 
合计     <%=iddTotal%><%=dddTotal%><%=otherTotal%><%=iddTotal+dddtotal+othertotal%><%=iddTotal%><%=iddTotal%>   

<% end if
if Record.State =1 then Record.Close
if Trim(Request.Form("Telephone")) = "" and Trim(Request.Form("Company")) = "" and Trim(Request.Form("RoomNo")) = "" then
sqlselect="select telephone.电话号码,telephone.使用单位,telephone.房号,telfee.begindate,telfee.idd,telfee.ddd,telfee.other,telfee.enddate,telfee.payway,telfee.paydate,telfee.lastmonth from telfee,telephone where datepart(year,telfee.enddate)=" & RecYear & " and (telephone.电话号码 *= telfee.telephone)"
if Request.Form("month") <> "" then
Recmonth=Cint(Request.Form("month"))
sqlselect=sqlselect & " and datepart(month,telfee.enddate)=" & Recmonth
end if
sqlselect=sqlselect & " order by telephone.房号"
Response.Write sqlselect
Record.Open sqlselect,Connection,1
%>









<%mm =0 %>
<% do while not Record.eof %>


<%if check(Record.fields("电话号码")) = 0 then %>
    
    
    
    
    
    <%
     mm = mm +1
     end if        
     Record.movenext
     Loop
     Record.Close
    %>

没有电话费的公司(共<%=mm%>条记录)

    
电话号码公司名房号
<%=Record.fields("电话号码")%>
    <%
     if Trim(Record.fields("使用单位"))="" then
     Response.Write " "
     else
     Response.Write Record.fields("使用单位")
     end if
    %>
    

    <%
     if Trim(Record.fields("房号"))="" then
     Response.Write " "
     else
     Response.Write Record.fields("房号")
     end if
    %>
    
 



<%
end if
Set Record=Nothing
Connection.Close
Set Connection=Nothing
set record1 = Nothing
%>






编辑历史:[这消息被数字面包编辑过(编辑时间2001-09-17 22:45:54)]


tonton_5d

职务:普通成员
等级:2
金币:1.0
发贴:176
注册:2001/8/7 23:57:56
#22001/9/17 20:33:34
这个光荣的任务还是留给面包兄好了!!
我闪!!!!!!!!!!1


免费提供XML计数器服务 www.tonton.cn

5D荣誉斑竹

职务:普通成员
等级:2
金币:2.0
发贴:654
注册:2000/12/19 10:59:22
#32001/9/17 22:52:03
我是最实际的了,你看我几时分析过别人的源码了?为了明天还可以活着去上班我也打算闪了……



tonton_5d

职务:普通成员
等级:2
金币:1.0
发贴:176
注册:2001/8/7 23:57:56
#42001/9/17 23:41:38
今天有个朋友叫我帮他分析代码,我说,我帮你手写一个好了(费事看)。给果只用了UD代码的六分之一就OK。问他有什么感觉,他说:“我不想用UD了“。。


免费提供XML计数器服务 www.tonton.cn