⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 left.jsp

📁 用JSP写的一个在线购物网站的代码
💻 JSP
📖 第 1 页 / 共 2 页
字号:
                    </tr>
                    <tr> 
                      <td>  
                        <select name="price" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva">
                          <option value="20">20元以下</option>
                          <option value="30">30元以下</option>
                          <option value="50">50元以下</option>
                          <option value="100" selected>100元以下</option>
                          <option value="500">500元以下</option>
                          <option value="1000">1000元以下</option>
                          <option value="10000">10000元以下</option>
                          <option value="100000">100000元以下</option>
                        </select></td>
                    </tr>
                    <tr> 
                      <td>  
                        <select name="selmode" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva">
                          <option value="name">商品名称</option>
                          <option value="produce">生产厂家</option>
                          <option value="simplicity">商品简要介绍</option>
                        </select></td>
                    </tr>
					<tr> 
                        <td>  
                          <input type="text" name="warename" size="15" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva"></td>
					</tr>
					<tr>
					<td height="5"></td>
					</tr>
                    <tr> 
                      <td height="20">  
                      <input type="submit" value="搜 索" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva"> 
                      </td>
                    </tr>
                  </table>
				  </form>
				  </td>
              </tr>
            </table>
          </td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td><IMG height=46 src="images/class.gif" width=165></td>
  </tr>
  <tr> 
    <td background="images/sendname.gif"> <table width="100%" height="15" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td></td>
        </tr>
      </table>
      <%
      sql="select * from class_big where habitus='"+"0"+"' and dustbin='"+"0"+"'";
	  rs=data.executeQuery(sql);
	  int bigid;
	  String bigname="";
	  while(rs.next())
	  {
	  bigid=rs.getInt("id");
	  bigname=rs.getString("name");
	  %>
		<table width="100%" height="20" border="0" align="center" cellpadding="0" cellspacing="0" class="darkbluetext">
        <tr> 
          <td><div align="center"><a href="showclass.jsp?big=<%=bigid%>&small=all"><strong><font color="#FF0000"><%=bigname%></font></strong></a></div></td>
        </tr>
		<tr>
		<td><table width="96%" cellspacing="0" cellpadding="0" border="0" class="darkbluetext" align="center">
		<%
		String small="select * from class_small where bigid='"+bigid+"' and dustbin='"+"0"+"'";
		ResultSet srs=data.executeQuery(small);
		int i=0;
		int smallid=0;
		String smallname="";
		while(srs.next())
		{
		i++;
		smallid=srs.getInt("smallid");
		smallname=srs.getString("name");
		%>
		<%if(i%3==1){%>
		<tr>
		<%}%>
		<td height="20"><div align="center"><a href="showclass.jsp?big=<%=bigid%>&small=<%=smallid%>"><%=smallname%></a></div></td>
		<%if(i%3==0){%>
		</tr>		
		<%}}%>
		</table>
		</td>
		</tr>
		<tr>
		<td height="10"></td>
		</tr>		
      </table>
      <%}%>
	  <table width="100%" border="0" cellspacing="0" cellpadding="0" height="15">
        <tr> 
          <td></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td><IMG border=0 height=26 src="images/classbuttom.gif" width=165></td>
  </tr>
  <tr> 
    <td height="10"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="10"></td>
        </tr>
        <tr> 
          <td><div align="center"><img src="images/vote.gif" width="100" height="42"></div></td>
        </tr>
        <tr> 
          <td height="10">
		  <form action="" method="post">
		  <input type="hidden" name="thisvote" value="">
		  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="darkbluetext">
              <tr>
			  <td height="5"></td>
			  </tr>
			  <tr> 
                <td> 问题:<%
				sql="select * from vote where start='"+"1"+"'";
				rs=data.executeQuery(sql);
				rs.next();
				id=rs.getInt("id");
				String matter=rs.getString("matter").trim();
				rs.close();
				%><%=matter%></td>
              </tr>
			  <tr>
			  <td height="5"></td>
			  </tr>
              <tr>
                <td><%
				sql="select * from addvote where titleid='"+id+"'";
				rs=data.executeQuery(sql);
				int inti=0;
				int voteid=0;
				String vote="";
				while(rs.next())
				{
				inti++;
				voteid=rs.getInt("id");
				vote=rs.getString("vote");
				%>
				 <input type="radio" name="vote" value="<%=voteid%>" checked><%=inti%>、<%=vote%><br>
				<%}	%></td>
              </tr>
			  <tr>
			  <td height="5"></td>
			  </tr>
			  <tr>
			  <td height="20"><div align="center"><input type="submit" value="确定" onClick="document.all.thisvote.value='true';" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva">
			  <input type="button" value="查看" onClick="window.location='javascript:vote()'" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva"></div></td>
			  </tr>
            </table>
			</form>
			</td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td><IMG height=46 src="images/help.gif" width=165></td>
  </tr>
  <%
  sql="select * from other order by id desc";
  rs=data.executeQuery(sql);
  id=0;
  String gtitle="";
  while(rs.next())
  {
  id=rs.getInt("id");
  gtitle=rs.getString("title");
  %>
  <tr> 
    <td valign="top">
     <table width="100%" height="27" border="0" cellpadding="0" cellspacing="0" background="images/helpbg.gif" class="darkbluetext">
        <tr> 
          <td width="40"></td>
          <td height="2"></td>
        </tr>
        <tr>
          <td></td>
          <td><a href="javascript:show(<%=id%>)"><%=gtitle%></a></td>
        </tr>
      </table>      
    </td>
  </tr>
  <%}%>
  <tr> 
    <td><IMG border=0 height=26 src="images/helpbuttom.gif" width=165></td>
  </tr>
  <tr height=15> 
    <td height=15></td>
  </tr>
  <tr> 
    <td>&nbsp; </td>
  </tr>
  <tr height=5> 
    <td height=5></td>
  </tr>
</table>
<%
String thisvote=request.getParameter("thisvote");
if(thisvote!=null && thisvote.equals("true"))
{
String getvote=request.getParameter("vote");
sql="select * from addvote where id='"+getvote+"'";
rs=data.executeQuery(sql);
rs.next();
int intnum=rs.getInt("number");
rs.close();
sql="update addvote set number='"+(intnum+1)+"' where id='"+getvote+"'";
rs=data.executeQuery(sql);
%>
<script language="JavaScript">
alert("投票完毕");
</script>
<%}%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -