jsp的技术教程

源代码在线查看: order.jsp

软件大小: 698 K
上传用户: srbrabbit
关键词: jsp 技术教程
下载地址: 免注册下载 普通下载 VIP

相关代码

				
				
				
								if(session.getAttribute("username")==null||session.getAttribute("username")=="")
				{
					response.sendRedirect("../member/login.jsp?url="+request.getRequestURI());
				}
				
				
				%>
								public String getStr(String str)
				{
					try
					{
						String temp_p=str;
						byte[] temp_t=temp_p.getBytes("GBK");
						String temp=new String(temp_t,"ISO8859_1");
						return temp;
					}
					catch(Exception e)
					{
					 
					}
					return "null";
				}
				%>        
				
				       
				
				
				[详细资料]
				
				
				
				
				
				订单信息确认
				
				   
				     
				      订单信息
				    
				  
				   
				    姓名:
				    
				  
				  				  String address,tel;
				  String sql="select * from orders where user_name='"+session.getAttribute("username")+"'";
				 // out.println(sql);
				  ResultSet rs=workM.executeQuery(sql);
				  if(rs.next())
				  {
				  	address=getStr(rs.getString("user_address"));
					tel=getStr(rs.getString("user_tel"));
				 
				  %>
				   
				    住址:
				     
				      
				    
				  
				   
				    电话:
				     
				
				
				    
				  
				 
				
				      
				
				  您的购物车中包含以下货物:
				  
				     
				       
				        购买数量
				      
				       
				        书名
				      
				       
				        单价
				      
				       
				        总价格
				      
				    
										//价格
					double g_price,total_price;
					g_price=0;
					total_price=0;
					//********
					String sqlList="select * from orders where user_name='"+session.getAttribute("username")+"' and status=0";
					ResultSet RSList=workM.executeQuery(sqlList);
					try
					{
						while(RSList.next())
						{
							int b_num;
							b_num=RSList.getInt("book_number");
					%>
				     
				       
				          
				          
				          
				      
					  					  	String sqlBook="select book.* from book where id="+RSList.getInt("book_id");
						ResultSet RSBook=workM.executeQuery(sqlBook);
						while(RSBook.next())
						{
							
					  %>
				       
				        
				      
				       
					  					  	double price;
						price=RSBook.getDouble("price");
					  %>
				        ¥
				      
					 
				       
				        ¥
				      
					   					   g_price=g_price+(double)price*b_num;
					   }%>
				    
				   
											}
					}
					catch(Exception e)
					{
					}
					%>
					  
				       
				        货物价格
				      
				       
				        ¥
				      
				    
				     
				        
				         
				        运输费用
				      
				       
				        ¥5.00
				      
				    
				     
				       
				        总费用
				      
				       
				        ¥
				      
				    
					  
				       
					
				    关闭窗口|打印该页
				
				  
				    
				  
				 
				   
				
				
				
				
							

相关资源