📄 addthings.jsp
字号:
<%@ page contentType="text/html;charset=gbk" import="cn.wy.Pet.Pet,cn.wy.Pet.Things,cn.wy.factory.ThingsBuy"%>
<jsp:useBean id="th" scope="page" class="cn.wy.Pet.Things"/>
<%
//如果有Pet对象,就表明要修改改宠物的信息
String btText = "确定增加";
String title = "增加宠物用品";
String ptPath = "images/selectImg.gif";
String imgPath = "";
String msgg = "不上传图片请保持为空" ;
String petName = "狗粮" ;
String spRematrk = "增长狗的智力好得很";
String sPprice = "2800";
String sellPrice = "3200";
String thId = "";
String pageNo = "";
int isUpdata = 0;//是添加还是修改
//该商品是否公开在网站上
String YisView = " checked='checked' ";
String NisView = " ";
String YisViewPrice = " checked='checked' ";
String NisViewPrice = " ";
//如果是更新宠物就有editPetId参数
if (request.getParameter("thingsEditID") != null)
{
System.out.println("yes");
int thid = Integer.parseInt(request.getParameter("thingsEditID"));
th = new ThingsBuy().queryThing(thid);
isUpdata = 1;
btText = "确定修改";
title = "修改宠物用品信息";
if (imgPath.length()>13)
imgPath = th.getSTTPath().substring(13,th.getSTTPath().length());
ptPath = ".." + th.getSTTPath();
msgg = "不修改图片请保持为空" ;
petName = th.getSTName() ;
spRematrk = th.getSTTRemark();
sPprice = String.valueOf(th.getSTSpPrice());
sellPrice = String.valueOf(th.getSTSalePrice()) ;
thId = String.valueOf(th.getStThingsID());;
//该商品是否公开在网站上
if (!th.getIsView())
{
YisView = "";
NisView = " checked='checked' ";
}
//是否显示价格
if (!th.getIsViewPrice())
{
YisViewPrice = " ";
NisViewPrice = " checked='checked' " ;
}
pageNo = request.getParameter("pageNo");
}
%>
<form action="addThings_do.jsp" method="post" ENCTYPE="multipart/form-data" name="addp">
<table width="661" height="417" border="0">
<tr>
<input type="hidden" name="editThingId" value=<%=thId%> />
<input type="hidden" name="isUpdata" value=<%=isUpdata%> />
<input type="hidden" name="pageNo" value=<%=pageNo%> />
<td height="63"></td>
<td height="63"><h2 align="right"><%=title%></h2></td>
<td height="63" align="center" valign="bottom">宠物用品图片预览</td>
</tr>
<tr>
<td width="144" height="24"><div align="right">商品名称:</div></td>
<td width="240">
<div align="left">
<input name="thName" type="text" onFocus="this.select()" onMouseOver="this.focus()" value=<%=petName%> size="20" maxlength="32" />
<font color="#FF0000" >* 必须输入</font></div></td>
<td width="263" rowspan="8" align="center" valign="top">
<img name="petimg" src=<%=ptPath%> height="208" width="220" id="imggg" /> </td>
</tr>
<tr>
<td height="10"><div align="right">相关图片:</div></td>
<td>
<div align="left">
<input name="spphotopath" type="file" id="spphotopath" size="20" onchange="document.petimg.src = document.addp.spphotopath.value" />
</div></td>
</tr>
<tr>
<td height="12" valign="top"> </td>
<td align="left"><font color="#FF0000" ><%=msgg%></font></td>
</tr>
<tr>
<td><div align="right">
<div align="right">商品备注:</div>
</div></td>
<td>
<div align="left">
<textarea name="thremark" cols="32" rows="5" onfocus="this.select()" onmouseover="this.focus()" id="spremark"><%=spRematrk%></textarea>
</div></td>
</tr>
<tr>
<td height="28"><div align="right">
<div align="right">是否公开该商品:</div>
</div></td>
<td>
<div align="left">
<div align="left">
<input name="isView" type="radio" value="1" <%=YisView%>/>
公开出售
<input type="radio" name="isView" value="0" <%=NisView%> />
锁定只管理员可见</div>
</div></td>
</tr>
<tr>
<td height="32"><div align="right">购入价格:</div> </td>
<td><div align="left">
<input name="spprice" type="text" id="spprice" onfocus="this.select()" onmouseover="this.focus()" value=<%=sPprice%> size="10" maxlength="20" />
¥<font color="#FF0000" > 内部可见</font></div></td>
</tr>
<tr>
<td height="23"><div align="right">出售价格:</div></td>
<td><div align="left">
<input name="spsellprice" type="text" onfocus="this.select()" onmouseover="this.focus()" id="spsellprice" value=<%=sellPrice%> size="10" maxlength="20" />
¥ <font color="#FF0000" >可公开在网站上显示</font>
</div></td>
</tr>
<tr>
<td height="27"><div align="right">显示出售价:</div></td>
<td align="left"><input name="isViewPrice" type="radio" value="1" <%=YisViewPrice%>/>
公开
<input type="radio" name="isViewPrice" value="0" <%=NisViewPrice%> />
不公开</td>
</tr>
<tr>
<td height="29"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="27" colspan="3"><div align="center">
<input type="hidden" name="imgPath" value="<%=imgPath%>">
<input type="submit" name="Submit" value=<%=btText%> />
<input type="reset" name="Submit2" value="重新填写" />
<input type="button" onClick="history.back()" name="SubmitEsc" value="取消出售">
</div></td>
</tr>
</table>
</form>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -