?? goods_add.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="com.wgh.DB.connDB"%>
<%@ page import="com.wgh.DB.chStr"%>
<%
connDB conn=new connDB();
chStr chStr=new chStr();
ResultSet rs_super=conn.executeQuery("select ID,superType from V_type group by ID,superType");
int superID=-1;
String superName="";
if(rs_super.next()){
superID=rs_super.getInt(1);
}else{
out.println("<script language='javascript'>alert('請先錄入類別信息!');window.location.href='index.jsp';</script>");
return;
}
int P_superID=-1;
ResultSet rs_sub=null;
//查詢所屬小類的默認選項
if(request.getParameter("superID")=="" || request.getParameter("superID")==null){
P_superID=superID;
}else{
P_superID=Integer.parseInt(request.getParameter("superID"));
}
rs_sub=conn.executeQuery("select * from tb_subType where superType="+P_superID);
int subID=-1;
String subName="";
%>
<html>
<head>
<title>Go購電子商城后臺管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../CSS/style.css" rel="stylesheet">
</head>
<script language="javascript">
function mycheck(){
if (form1.goodsName.value==""){
alert("請輸入商品名稱!");form1.goodsName.focus();return;
}
if (form1.picture.value==""){
alert("請輸入圖片文件的路徑!");form1.picture.focus();return;
}
if (form1.price.value==""){
alert("請輸入商品的定價!");form1.price.focus();return;
}
if (isNaN(form1.price.value)){
alert("您輸入的定價錯誤,請重新輸入!");form1.price.value="";form1.price.focus();return;
}
if (form1.introduce.value==""){
alert("請輸入商品簡介!");form1.introduce.focus();return;
}
form1.submit();
}
</script>
<body>
<table width="777" height="192" border="0" align="center" cellpadding="0" cellspacing="0" class="tableBorder">
<tr>
<td>
<jsp:include page="banner.jsp"/>
<table width="777" height="288" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="182" valign="top"><table width="100%" height="431" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" background="../images/manage_02.gif"><jsp:include page="navigation.jsp"/></td>
</tr>
</table></td>
<td align="center" valign="top"><table width="100%" height="120" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" background="../images/manage_center_goodsadd.gif"><table width="100%" height="36" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="98%" align="right"><a href="superType.jsp">[ <img src="../images/list.gif" width="11" height="13"> 大分類信息管理]</a> <a href="subType.jsp">[ <img src="../images/list.gif" width="11" height="13"> 小分類信息管理]</a> <a href="goods_add.jsp">[ <img src="../images/list.gif" width="11" height="13"> 添加商品信息]</a></td>
<td width="2%"> </td>
</tr>
</table></td>
</tr>
</table>
<table width="92%" height="192" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<form action="goods_add_deal.jsp" method="post" name="form1">
<table width="100%" border="0" align="center" cellpadding="-2" cellspacing="-2" bordercolordark="#FFFFFF">
<tr>
<td height="27"> 所屬大類:</td>
<td width="31%" height="27">
<script language="javascript">
function F_super(val){
window.location.href="goods_add.jsp?superID="+val; //實現級聯菜單
}
</script>
<select name="supertype" class="textarea" id="supertype" onChange="F_super(this.value)">
<%rs_super.first();
do{
superID=rs_super.getInt(1);
superName=rs_super.getString(2);
%>
<option value="<%=superID%>"<%if(superID==P_superID){out.println(" selected");/*注意此處的分號*/}%>><%=superName%></option>
<%}while(rs_super.next());%>
</select></td>
<td width="13%" height="27"> 所屬小類:</td>
<td width="42%" height="27">
<select name="typeID" class="textarea" id="typeID">
<%while(rs_sub.next()){
subID=rs_sub.getInt(1);
subName=rs_sub.getString(3);
%>
<option value="<%=subID%>"><%=subName%></option>
<%}%>
</select>
</td>
</tr>
<tr>
<td width="14%" height="27"> 商品名稱:</td>
<td height="27" colspan="3">
<input name="goodsName" type="text" class="Sytle_text" id="bookID2" size="50"> </td>
</tr>
<tr>
<td height="41"> 圖片文件:</td>
<td height="41">
<input name="picture" type="text" class="Style_upload" id="picture">
</td>
<td height="41"> 定 價:</td>
<td height="41">
<input name="price" type="text" class="Sytle_text" id="price">
(元)</td>
</tr>
<tr>
<td height="45"> 是否新品:</td>
<td> <input name="newGoods" type="radio" class="noborder" value="1" checked>
是
<input name="newGoods" type="radio" class="noborder" value="0">
否</td>
<td> 是否特價:</td>
<td><input name="sale" type="radio" class="noborder" value="1" checked>
是
<input name="sale" type="radio" class="noborder" value="0">
否</td>
</tr>
<tr>
<td height="103"> 商品簡介:</td>
<td colspan="3"><span class="style5"> </span>
<textarea name="introduce" cols="60" rows="5" class="textarea" id="introduce"></textarea></td>
</tr>
<tr>
<td height="38" colspan="4" align="center">
<input name="Button" type="button" class="btn_grey" value="保存" onClick="mycheck()">
<input name="Submit2" type="reset" class="btn_grey" value="重置">
<input name="Submit3" type="button" class="btn_grey" value="返回" onClick="JScript:history.back(-1)">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<table width="100%" height="46" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="../images/manage_06.gif"> </td>
</tr>
</table></td>
</tr>
</table>
<table width="777" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="54" align="center"><jsp:include page="copyright.jsp"/></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -