📄 myshop.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="errorpage.jsp" %>
<!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,td,th {
font-size: 12px;
}
.STYLE1 {
color: #FFFFFF;
font-weight: bold;
}
.STYLE2 {color: #0000CC}
-->
</style></head>
<jsp:useBean id="db" class="data.shopdb"/>
<%
String sqlstr;
Connection conn = db.getopenConnection();
PreparedStatement ps=null;
int cid=0;
if (request.getParameter("id")!=null) cid=Integer.parseInt(request.getParameter("id"));
if (cid!=0)
{
sqlstr="delete from thing where id=?";
ps=conn.prepareStatement(sqlstr);
ps.setInt(1,cid);
ps.executeUpdate();
%>
<script language="JavaScript">
alert("下架成功!");
</script>
<%
}
%>
<%
String id=(String)session.getAttribute("id");%>
<script>
function sure()
{
document.body.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
if (confirm('您还没有开店!确认开店?'))
{
document.body.style.filter = "";
return true;
}
else
{
document.body.style.filter = "";
return false;
}
}
</script>
<body><%if(db.checksoldid(id)){%>
<table width="622" height="313" border="1" align="left" cellspacing="0" bordercolor="#993300">
<tr>
<td width="616" height="16" bgcolor="#993300"><span class="STYLE1"><%
ResultSet rd=db.showshop(id);
while (rd.next()){%>我的店铺:<%=rd.getString("shopname")%><%}%></span></td>
</tr>
<tr>
<td><table width="618" height="294" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="../pic/bbgg.jpg"><table width="619" height="297" border="1" cellpadding="0" cellspacing="0">
<tr>
<td height="14">
<table width="607" height="16" border="0" align="center" cellpadding="0">
<tr>
<td width="92" height="12" bgcolor="#993300"><div align="center" class="STYLE1">商品:</div></td>
<td width="97" bgcolor="#993300"><div align="center" class="STYLE1">图片</div></td>
<td width="137" bgcolor="#993300"><div align="center" class="STYLE1">描述</div></td>
<td width="129" bgcolor="#993300"><div align="center" class="STYLE1">上架时间</div></td>
<td width="140" bgcolor="#993300"><div align="center" class="STYLE1">操作</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="259"><table width="610" height="278" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">
<%
ResultSet rs=db.showthing(id);
while (rs.next()){%>
<table width="607" height="54" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="92" height="52"><div align="center" class="STYLE2"><%=rs.getString("thingname")%></div></td>
<td width="96"><div align="center" class="STYLE2"><img src="../shoppic/<%=rs.getString("pic")%>" width="89" height="50" /></div></td>
<td width="136"><div align="center" class="STYLE2"><%=rs.getString("thingmes")%></div></td>
<td width="127"><div align="center" class="STYLE2"><%=rs.getString("starttime")%></div></td>
<td width="144"><div align="center"><a href="myshop.jsp?id=<%=rs.getInt("id") %>">下架</a></div></td>
</tr>
</table>
<%} %>
<table width="80" border="0" align="center" cellpadding="0">
<tr>
<td><a href="addthing.jsp"><img src="../pic/shangjia.png" width="88" height="31" border="0" /></a></td>
</tr>
</table>
<a href="addthing.jsp"></a>
<%}else{%>
<script language="JavaScript" type="text/javascript">
alert("您没有店铺!");
</script>
<table width="80" border="0" align="center" cellpadding="0">
<tr>
<td><a href="soldshop.jsp"onclick="return sure();"><img src="../pic/kqdp.png" width="88" height="31" border="0" /></a></td>
</tr>
</table>
<a href="soldshop.jsp"onclick="return sure();"></a>
<%}%>
</div></td>
</tr>
<tr>
<td height="119"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -