小弟写了个小程序,算课时的,有点功能实现不了,求老师出手相助

qq_39729657 2017-08-15 12:23:16
貌似rar格式无法上传?
相关要求在下面的图片里,请老师帮忙看看


<!--#include file="conn.asp"-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>课时计算</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="style.css" media="screen"/>
</head>
<body>
<div id="content">
<a class="back" href=""></a>
<span class="scroll"></span>
<p class="head">初一年级课时计算系统
<a href="#">测试版</a>
</p>





<%
set mrs=server.CreateObject("adodb.recordset")
exec="select * from [班级] order by 编号 asc"
mrs.open exec,conn,1,1
%>
<%
do while not mrs.eof
%>
<h2>初一(<% =mrs ("班级") %>)班</h2>
<table class="table1">
<thead>
<tr>
<th>初一(<% =mrs ("班级") %>)班</th>
<th scope="col" abbr="Starter">语文</th>
<th scope="col" abbr="Medium">数学</th>
<th scope="col" abbr="Business">英语</th>
<th scope="col" abbr="Deluxe">物理</th>
</tr>
</thead>
<%
set rs=server.CreateObject("adodb.recordset")
exec="select * from [课程表] where 班级='"&mrs ("班级")&"' order by id asc"
rs.open exec,conn,1,1
%>
<%
i = 0
do while not rs.eof
i=i+1

if rs ("星期")=1 then
xq="星期一"
end if
if rs ("星期")=2 then
xq="星期二"
end if
if rs ("星期")=3 then
xq="星期三"
end if
if rs ("星期")=4 then
xq="星期四"
end if
if rs ("星期")=5 then
xq="星期五"
end if
if rs ("星期")=6 then
xq="星期六"
end if
if rs ("星期")=7 then
xq="星期日"
end if
if rs ("星期")=8 then
xq="小周一"
end if
if rs ("星期")=9 then
xq="小周二"
end if
if rs ("星期")=10 then
xq="小周三"
end if
if rs ("星期")=11 then
xq="小周四"
end if
%>
<tbody>
<tr>
<th scope="row"><% =xq %></th>
<td><% =rs ("语文") %></td>
<td><% =rs ("数学") %></td>
<td><% =rs ("英语") %></td>
<td><%=i%></td>
</tr>

</tbody>

<%
rs.movenext
loop
%>


<tfoot>
<tr>
<th scope="row">合计</th>
<td>小计</td>
<td>小计</td>
<td>小计</td>
<td>小计</td>
</tr>
</tfoot>
</table>


<%
rs.close
set rs=nothing
%>

<%
mrs.movenext
loop
mrs.close
set rs=nothing
%>
</div>


<table class="table1">
<tr>
<td>这里求语文一+语文二</td>
</tr>
<tr>
<td>这里求英语一+英语二+英语三</td>
</tr>
</table>


</body>
</html>


第二个问题:这个程序目前是固定的计算 大周一到小周四课时
能不能帮忙写一个可以选择随机计算哪几天课时的?比如:
在这个页面显示大周三到小周一的课时,再加上一个小周四的课时

第三个,能生成excel吗?
...全文
404 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_39729657 2017-08-16
  • 打赏
  • 举报
回复
怎么变啊这个例子看看?
hongmei85 2017-08-16
  • 打赏
  • 举报
回复
你就语数外一二三各存一个变量,然后你想加哪个都可以
qq_39729657 2017-08-15
  • 打赏
  • 举报
回复


请问数学一+数学三+数学5怎么写?


请问英语一+英语5怎么写?


我的意思就是随便几个加起来怎么写
qq_39729657 2017-08-15
  • 打赏
  • 举报
回复
引用 2 楼 hongmei85 的回复:
ASP Excel http://www.jb51.net/article/52600.htm
请问数学一+数学三怎么写?
hongmei85 2017-08-15
  • 打赏
  • 举报
回复
ASP Excel http://www.jb51.net/article/52600.htm
hongmei85 2017-08-15
  • 打赏
  • 举报
回复

            <!--#include file="conn.asp"-->
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>课时计算</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="style.css" media="screen"/>
    </head>
    <body>
        <div id="content">
            <a class="back" href=""></a >
            <span class="scroll"></span>
            <p class="head">初一年级课时计算系统
                <a href=" ">测试版</a >
            </p >
 
 
       
 
 
<%
set mrs=server.CreateObject("adodb.recordset")
exec="select * from [班级] order by 编号 asc"  
mrs.open exec,conn,1,1
j = 0
sum_yuwen_2 = 0
sum_sum_yinyu_3 = 0
%>
<%
    do while not mrs.eof
%>
           <h2>初一(<% =mrs ("班级") %>)班</h2>
            <table class="table1">
                <thead>
                    <tr>
                        <th>初一(<% =mrs ("班级") %>)班</th>
                        <th scope="col" abbr="Starter">语文</th>
                        <th scope="col" abbr="Medium">数学</th>
                        <th scope="col" abbr="Business">英语</th>
                        <th scope="col" abbr="Deluxe">物理</th>
                    </tr>
                </thead>
<%
sum_yuwen=0:sum_shuxue=0:sum_yinyu=0
set rs=server.CreateObject("adodb.recordset")
exec="select * from [课程表] where 班级='"&mrs ("班级")&"' order by id asc"  
rs.open exec,conn,1,1
%>
<%
i = 0
    do while not rs.eof
sum_yuwen = sum_yuwen + rs ("语文")
sum_shuxue = sum_shuxue + rs ("数学")
sum_yinyu = sum_yinyu + rs ("英语")
i=i+1
 
if rs ("星期")=1 then
xq="星期一"
end if
if rs ("星期")=2 then
xq="星期二"
end if
if rs ("星期")=3 then
xq="星期三"
end if
if rs ("星期")=4 then
xq="星期四"
end if
if rs ("星期")=5 then
xq="星期五"
end if
if rs ("星期")=6 then
xq="星期六"
end if
if rs ("星期")=7 then
xq="星期日"
end if
if rs ("星期")=8 then
xq="小周一"
end if
if rs ("星期")=9 then
xq="小周二"
end if
if rs ("星期")=10 then
xq="小周三"
end if
if rs ("星期")=11 then
xq="小周四"
end if
%>
                <tbody>
                    <tr>
                        <th scope="row"><% =xq %></th>
                        <td><% =rs ("语文") %></td>
                        <td><% =rs ("数学") %></td>
                        <td><% =rs ("英语") %></td>
                        <td><%=i%></td>
                    </tr>
 
                </tbody>
 
<%
rs.movenext
loop
%>
 
 
                <tfoot>
                    <tr>
                        <th scope="row">合计</th>
                        <td><%= sum_yuwen %></td>
                        <td><%= sum_shuxue %></td>
                        <td><%= sum_yinyu %></td>
                        <td>小计</td>
                    </tr>
                </tfoot>
            </table>
 
 
<%
rs.close
set rs=nothing
%>
  
<%
If(j<2) Then
	sum_yuwen_2 = sum_yuwen_2 + sum_yuwen
End if

If(j<3) Then
	sum_yinyu_3 = sum_yinyu_3 + sum_yinyu
End if

j = j + 1
mrs.movenext
loop
mrs.close
set rs=nothing
%>
 </div>
 
 
            <table class="table1">
                    <tr>
                        <td>这里求语文一+语文二<%= sum_yuwen_2 %></td>
                    </tr>
                    <tr>
                        <td>这里求英语一+英语二+英语三<%= sum_yinyu_3 %></td>
                    </tr>
                </table>
 
 
    </body>
</html>
            

28,390

社区成员

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

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