数组循环问题
<%
Tid=request("Tid")
sid=request("sid")
if sid<>"" or tid<>"" then
%>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/check.asp"-->
<%
set rsd=server.createobject("adodb.recordset")
sqld="select * from sale where id="&sid&""
rsd.open sqld,open_conn(),1,1
if rsd.recordcount>0 then
deshes=rsd("did")
num=rsd("num")
numarry=split(num,",")
aryde=split(deshes,",")
end if
rsd.close
set rsd=nothing
%>
<%
function cck(rid)
for i=0 to UBound(aryde)
if cint(aryde(i))=cint(rid) then
numi=numarry(i)
cck2=true
exit for
else
cck2=false
numi=1
end if
next
cck=cck2
end function
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>菜品种类</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.STYLE1 {font-size: 12px}
.STYLE4 {
font-size: 12px;
color: #1F4A65;
font-weight: bold;
}
a:link {
font-size: 12px;
color: #06482a;
text-decoration: none;
}
a:visited {
font-size: 12px;
color: #06482a;
text-decoration: none;
}
a:hover {
font-size: 12px;
color: #FF0000;
text-decoration: underline;
}
a:active {
font-size: 12px;
color: #FF0000;
text-decoration: none;
}
.STYLE7 {font-size: 12}
-->
</style>
</head>
<body>
<form name="Dishes" method="post" action="update_save.asp" style="margin:0px;">
<table width="100%" border="0" align="center" cellpadding="0">
<tr>
<td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15" height="30"><img src="../images/tab_03.gif" width="15" height="30" /></td>
<td width="475" background="../images/tab_05.gif"><img src="../images/311.gif" width="16" height="16" /> <span class="STYLE4">添加菜品</span> </td>
<td width="495" valign="bottom" background="../images/tab_05.gif"><span class="STYLE4">
<input name="tableid" value="<%=sid%>" type="hidden"/>
<%=Tid%>号菜单</span></td>
<td width="250" background="../images/tab_05.gif"><table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="60"><table width="87%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="STYLE1"><div align="center">
<input type="checkbox" name="chkall" value="checkbox" onClick="CheckAll(this.form)"/>
</div></td>
<td class="STYLE1"><div align="center">全选</div></td>
</tr>
</table></td>
<td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="STYLE1"><div align="center"><img src="../images/001.gif" width="14" height="14" /></div></td>
<td class="STYLE1"><div align="center"><a href="#" onclick="Dishes.submit()">确定</a></div></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="16"><img src="../images/tab_07.gif" width="14" height="30" /></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="9" background="../images/tab_12.gif"> </td>
<td bgcolor="#f3ffe3">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#c0de98" onmouseover="changeto()" onmouseout="changeback()">
<tr>
<td width="3%" height="25" background="../images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">选择</div></td>
<td width="3%" height="25" background="../images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">序号</div></td>
<td width="24%" height="25" background="../images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">菜品名称</div></td>
<td width="15%" height="25" background="../images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">所属类别</div></td>
<td width="13%" height="25" background="../images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">价格</div></td>
<td width="11%" height="25" background="../images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">折扣</div></td>
<td width="16%" height="25" background="../images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">折后价</div></td>
<td width="15%" height="25" background="../images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">分量</div></td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from Dishes order by id asc"
rs.open sql,open_conn(),1,1
recordcount = rs.recordcount
if rs.recordcount>0 then
do while not rs.eof
%>
<tr>
<td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE1">
<input name="Cid" type="checkbox" class="STYLE2" id="Cid" value="<%=rs("id")%>"
<%if cck(rs("id"))=true then
response.Write "checked"
end if
%>
/>
</div></td>
<td height="18" bgcolor="#FFFFFF" class="STYLE2"><div align="center" class="STYLE2 STYLE1"><%=rs("id")%></div></td>
<td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1"><%=rs("d_name")%></div></td>
<td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1">
<%
set rs1=Server.CreateObject("ADODB.RecordSet")
strSQL1="select * from kind where id="&rs("d_kind")&""
rs1.open strSQL1,Open_conn(),1,1
if rs1.recordcount>0 then
do while not rs1.eof
%>
<%=rs1("kind")%>
<%
rs1.movenext
loop
else
response.Write "<option value=''>暂无菜品</option>"
end if
rs1.close
set rs1=nothing
%>
</div></td>
<td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1"><%=rs("Price")%>元</div></td>
<td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1"><%=rs("Discount")*10%>折</div></td>
<td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1"><%=rs("Dprice")%>元</div></td>
<td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1"><input type="textbox" size="10" name="num<%=rs("id")%>" id="num<%=rs("id")%>" value="<%=numi%>"/>份</div></td>
</tr>
<%
rs.MoveNext
loop
end if
rs.close
set rs = nothing
%>
...全文
相关推荐
解决C语言数组元素循环右移的问题
在C语言中,数组元素的循环右移是一个常见的操作,特别是在处理序列数据或者实现某些算法时。本篇文章将深入探讨如何解决这个问题,并提供一个具体的示例代码来演示如何完成这个任务。
C语言数组元素循环右移问题及解决方法
C语言数组元素循环右移问题及解决方法C语言数组元素循环右移问题是指在C语言中将数组元素循环右移的操作,即将数组中的元素向右移位,且循环移位。
JavaScript中关于for循环删除数组元素内容时出现的问题
总结来说,在使用for循环删除数组元素时,必须注意数组长度的变化对循环控制变量的影响。通过适当调整索引,可以解决因删除操作而导致的遍历问题。
PAT (Basic Level) 1008 数组元素循环右移问题
在PAT(Basic Level)1008题中,题目要求解决的是一个数组元素的循环右移问题。给定一个整型数组`a`,长度为`n`,以及一个整数`m`,你需要将数组按照`m`的步长进行循环右移。所谓循环
数组循环移位问题的解法的探究
### 数组循环移位问题的解法探究在计算机科学领域,数组作为一种基本的数据结构,在很多算法和数据处理中扮演着重要角色。


