level 1
if zt="mod" then
sql_mod="select bjmc,bzrid,bjid,xmid,xm from bj,js where bjid="&bjid&" and bj.bzrid=js.jsid"
set rs_mod=conn.execute(sql_mod)
bjmc_mod=rs_mod("bjmc")
xmid_mod=rs_mod("xmid")
bzrmc_mod=rs_mod("xm")
bjid_mod=rs_mod("bjid")
bzrid_mod=rs_mod("bzrid")
rs_mod.close
set rs_mod=nothing
end if
求翻译
2015年01月15日 02点01分
3
level 1
<select name="bzrid">
<%
sql_bzrmc="select * from js order by jsid asc"
set rs_bzrmc=conn.execute(sql_bzrmc)
do while not rs_bzrmc.eof
%>
<option value="<%=rs_bzrmc("jsid")%>" <% if rs_bzrmc("jsid")=bzrid_mod then response.Write("selected") end if%>><%=rs_bzrmc("xm")%></option>
<%
rs_bzrmc.movenext
loop
rs_bzrmc.close
set rs_bzrmc=nothing
%>
</select>
继续求大神翻译
2015年01月15日 02点01分
4
level 1
if not session("qx")="admin" then
response.End()
if zt="mod" then
sql_mod="select bjmc,bzrid,bjid,xmid,xm from bj,js where bjid="&bjid&" and bj.bzrid=js.jsid"
set rs_mod=conn.execute(sql_mod)
bjmc_mod=rs_mod("bjmc")
xmid_mod=rs_mod("xmid")
bzrmc_mod=rs_mod("xm")
bjid_mod=rs_mod("bjid")
bzrid_mod=rs_mod("bzrid")
rs_mod.close
set rs_mod=nothing
end if
<select name="bzrid">
<%
sql_bzrmc="select * from js order by jsid asc"
set rs_bzrmc=conn.execute(sql_bzrmc)
do while not rs_bzrmc.eof
%>
<option value="<%=rs_bzrmc("jsid")%>" <% if rs_bzrmc("jsid")=bzrid_mod then response.Write("selected") end if%>><%=rs_bzrmc("xm")%></option>
<%
rs_bzrmc.movenext
loop
rs_bzrmc.close
set rs_bzrmc=nothing
%>
</select>
xmmc=split(xmid,"|")'第04题:解释本语句中split函数的作用
sql_xm="select * from xm order by id asc"
set rs_xm=server.CreateObject("adodb.recordset")
rs_xm.open sql_xm,conn,1,1
if rs_xm.eof and rs_xm.bof then
response.End()
end if
U_xmmc=int(rs_xm.recordcount)'第05题,解释本句的作用
'response.Write(U_xmmc)
redim xmmc_q(1,U_xmmc)
'第06题开始
t=0
do while not rs_xm.eof
xmmc_q(0,t)=rs_xm("id")
xmmc_q(1,t)=rs_xm("xmmc")
t=t+1
rs_xm.movenext
loop
'第06题结束
'第07题开始
sub xm_c(id)
xm_id_mod=split(xmid_mod,"|")
for a=0 to Ubound(xm_id_mod)
if cint(xm_id_mod(a))=cint(id) then
response.Write(" checked='checked'")
end if
next
end sub
'第07题结束
for j=0 to U_xmmc-1
%>
<input name="xm<%=xmmc_q(0,j)%>" type="checkbox" <%call xm_c(xmmc_q(0,j))%> value=<%=xmmc_q(0,j)%>><%=xmmc_q(1,j)%>
<%next%>
</label></td>
</tr>
<tr>
<td height="40" co
lsp
an="2" align="center"><label>
<input type="submit" name="Submit" value="<%if zt="mod" then response.Write("保存修改") else response.Write("增加班级") end if%>" />
</label></td>
</tr>
</table>
<hr />
<%
hh_bjid=request.Form("hh_bjid")
if hh_bjid<>"" then
bjid=hh_bjid
end if
rs_xm.movefirst
'第08题开始
xm_N=0
do while not rs_xm.eof
xm=trim(request.Form("xm"&rs_xm("id")))
if xm<>"" and xm_N=0 then
xmid=xm
xm_N=xm_N+1
elseif xm<>"" then
xmid=xm&"|"&xmid
end if
rs_xm.movenext
loop
rs_xm.close
set rs_xm=nothing
'第08题结束
if bjmc<>"" and hh_bjid="" then
sql="insert into bj(bjmc,bzrid,xmid) values('"&bjmc&"',"&bzrid&",'"&xmid&"')"
conn.execute(sql)
end if
if hh_bjid<>"" then
sql="update bj set bjmc='"&bjmc&"',bzrid='"&bzrid&"',xmid='"&xmid&"' where bjid="&bjid
conn.execute(sql)
end if
if zt="del" then
sql="delete from bj where bjid="&bjid
conn.execute(sql)
end if
'response.Write(sql)
%>
<table width="800" border="1" align="center" cellpadding="0" cellspacing="0">
<caption class="title_table" style="font-size:24px">班级基本资料一览表</caption>
<tr>
<th width="50" height="50" align="center">编号</th>
<th width="156" height="50" align="center">班级名</th>
<th width="92" align="center">班主任</th>
<th width="373" align="center">开设的体育项目</th>
<th width="53" align="center"> </th>
<th width="62" align="center"> </th>
</tr>
<%
sql_show="select bjid,bjmc,xmid,xm from bj,js where bj.bzrid=js.jsid order by bjid asc"
set rs_show=conn.execute(sql_show)
do while not rs_show.eof
%>
<tr>
<td height="30" align="center"><%=rs_show("bjid")%></td>
<td height="30" align="center"><%=rs_show("bjmc")%></td>
<td align="center"><%=rs_show("xm")%></td>
<td align="center">
<%
xmid=split(rs_show("xmid"),"|")
'还原项目名称
for i=0 to ubound(xmid)'取得数组个数函数
for y=0 to U_xmmc
if cint(xmid(i))=cint(xmmc_q(0,y)) then
response.Write(xmmc_q(1,y)&" ")
end if
next
next
%></td>
<td align="center"><a href=bj.asp?bjid=<%=rs_show("bjid")%>&zt=mod>修改</a></td>
<td align="center"><a href=bj.asp?bjid=<%=rs_show("bjid")%>&zt=del>删除</a></td>
</tr>
<%
rs_show.movenext
loop
rs_show.close
set rs_show=nothing
%>
</table>
</form>
</td></tr></table>
</body>
</html>
求解释。。。
2015年01月15日 02点01分
5