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

📄 launch.jsp

📁 jsp做的购物网站
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.util.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="user" scope="session" class="jspD.User"/>
<jsp:useBean id="DBLink" class="jspD.DBLink" />

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>发起团购</title>
</head>
<%
	
	ResultSet rs;
	Vector buyList=new Vector();
	String sqlStr="select distinct productName from cart";
	rs=DBLink.executeQuery(sqlStr);
	while(rs.next()){
		buyList.addElement(rs.getString(1));
	//	out.print((String)buyList.lastElement()+"<br>");
	}
	
%>
<body>

  <TABLE cellSpacing=0 cellPadding=0 width="82%" align=center>
    <TBODY>
      <TR>
        <TD align=middle><SPAN id=Label1 
style="FONT-WEIGHT: bold; FONT-SIZE: larger; COLOR: crimson">集采信息</SPAN></TD>
      </TR>
      <TR>
        <TD><TABLE width="103%" border=1 cellPadding=4 cellSpacing=0 
borderColor=#cc9966 rules=all id=dgdMyOrders 
style="BORDER-RIGHT: #cc9966 1px; BORDER-TOP: #cc9966 1px; FONT-SIZE: smaller; BORDER-LEFT: #cc9966 1px; WIDTH: 100%; BORDER-BOTTOM: #cc9966 1px; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: white">
            <TBODY>
              <TR style="FONT-WEIGHT: bold; COLOR: #ffffcc; BACKGROUND-COLOR: #990000">
                <TD width="36%">集采商品名称</TD>
                
                <TD width="26%">产品商家</TD>
				<!--<TD>厂家邮箱</TD>-->
                <TD width="23%">集采数量</TD>
                <TD width="15%">状态</TD>
               
              </TR>
<%	
			
		//用于检验用户的合法性,以及加入用户。
	int i=0,size=buyList.size(),quantity=0;
	String producer1=null;
	do{
	quantity=0;
	sqlStr="select quantity,producer from cart WHERE productName='"+buyList.elementAt(i)+"'";
	rs=DBLink.executeQuery(sqlStr);	
	//从rs中得数据首先要调用rs.next()
	while(rs.next()){
		producer1=rs.getString(2);
		quantity+=rs.getInt(1);
	}
	
/*	
		
	if(!rs.next())   
		out.print("<h2>你还没有进行采购!</h2>");
	else{		*/
		
%>	
<form action="tgConform.jsp">
              <TR style="COLOR: #330099; BACKGROUND-COLOR: white">
                <TD><%=buyList.elementAt(i)%></TD>
                
                <TD><%=producer1%></TD>
              
				<TD><%=quantity%></TD>
                <TD><%
					if(quantity>=50)
						out.print("<input type='submit' name='Submit' value='发起产品的团购'>");
					else
						out.print("数量不足");
				%></TD>
              </TR>
			  <input type="hidden" name="pName" value=<%=buyList.elementAt(i)%>>			  
</form>
 <%		
	  i++;
	}while(i<size);
	
%>
			  <TR style="COLOR: #330099; BACKGROUND-COLOR: #ffffcc" align=middle>
                <TD colSpan=6><a href="manager.jsp">返回</a></TD>
              </TR>
           
        </TABLE></TD>
      </TR>
      <TR>
        
      </TR>
    </TBODY>
</TABLE>

</body>
</html>

⌨️ 快捷键说明

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