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

📄 itemmodify.jsp

📁 struts hibernate框架 商场买卖
💻 JSP
字号:
<%@ page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page
	import="java.sql.*,com.shopping.dao.*,com.shopping.vo.*,java.util.*"%>
<%@page import="com.shopping.factory.DAOFactory;"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>创意生活</TITLE>
<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<LINK href="image/style.css" type=text/css 
rel=stylesheet>
<script type="text/javascript" src="../fckeditor/fckeditor.js"></script>
<script type="text/javascript">

window.onload = function()
{
	// Automatically calculates the editor base path based on the _samples directory.
	// This is usefull only for these samples. A real application should use something like this:
	// oFCKeditor.BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value.
	// var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ;
	var sBasePath = "<%=request.getScheme() + "://"
				+ request.getServerName() + ":" + request.getServerPort()
				+ request.getContextPath() + "/fckeditor/"%>"
//alert(sBasePath);
	var oFCKeditor = new FCKeditor( 'cont' ) ;
	oFCKeditor.BasePath	= sBasePath ;
	oFCKeditor.ReplaceTextarea() ;
}

</script>
	
	<script type="text/javascript">
		var req;
		
		function init() {
			if(window.XMLHttpRequest) {
				req = new XMLHttpRequest();
			} else if (window.ActiveXObject) {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		
		function changeDrop2() {
			init();
			var url = "../getCat.do?id=" + escape(document.Form1.parent.options[document.Form1.parent.selectedIndex].value);
			req.open("GET", url, true);
			req.onreadystatechange = callback;
			req.send(null);
		}
		
		function callback() {
			if(4 == req.readyState) {
		
				if(200 == req.status) {
					//alert(req.responseText);
					eval(req.responseText);
				}
			}
			
		}
	</script>
</HEAD>
<%
Admin admin = (Admin)session.getAttribute("admin");
if(admin==null){
	response.sendRedirect("adminLogin.jsp");
}

UnifyDao catDao = null;
catDao = (UnifyDao) DAOFactory.getBean("com.shopping.dao.imp.CatDaoImp");
UnifyDao itemDao = null;
itemDao = (UnifyDao) DAOFactory.getBean("com.shopping.dao.imp.ItemDaoImp");
int id = Integer.parseInt(request.getParameter("id"));
Item item = (Item)itemDao.getTableById(id);

if("success".equals(request.getAttribute("info"))){
%>
<script type="text/javascript">
alert("操作成功");
</script>
<%
}else if("wrong".equals(request.getAttribute("info"))){
%>
<script type="text/javascript">
alert("操作失败!请重试");
</script>
<% }%>

<BODY>
<FORM id=Form1 name=Form1 action="itemAdd.do?action=modify" method=post enctype="multipart/form-data">
<input type="hidden" value="<%=item.getId() %>" name="id">
<TABLE class=tableBorder id=Table1 cellSpacing=0 cellPadding=0 width=640 
align=center border=0>
  <TBODY>
  <TR>
    <TH class=tableHeaderText align=left height=25>&nbsp;&nbsp; <SPAN 
      class=tableHeaderText id=lbTitle>商品修改</SPAN></TH>
    <TH class=tableHeaderText align=right><A href="" 
      target=_blank><IMG alt=帮助 src="image/admin_help.gif" 
      border=0></A>&nbsp; </TH>
  <TR></TR></TBODY></TABLE>
<TABLE class=tableBorder cellSpacing=1 cellPadding=1 width=640 align=center border=0 id="t1">
<TBODY>
<TR>
<TD>
<TABLE class=tableBorder cellSpacing=0 cellPadding=0 width="95%" align=center border=0 id="t2">
<TBODY>
<TR>
<TD align=left width=100>商品名称: </TD>
<TD width=240><INPUT id=txtName type="text" name=itemName value="<%=item.getName() %>"><FONT color=red>*</FONT></TD>
<TD align=left width=100><b>选择类别:</b></TD>
<TD vAlign=top width=200 rowSpan=7>

	<select name="parent" onchange="changeDrop2()">
			<option value="-1">请选择</option>
			<%
             int pid3 = 0;
             List catList3 = catDao.getTable(pid3);
             
             for (Iterator<Category> it = catList3.iterator(); it.hasNext();) {
			 Category c = it.next();
            %>
				<option value="<%=c.getId() %>"><%=c.getName() %></option>
				<%
			}
			%>
		</select>
		<select name="child">
			<option value="<%=item.getCategory().getId()%>"><%=item.getCategory().getName()%></option>
		</select>
</TD></TR>


<TR>
<TD align=left width=100>价格: </TD>
<TD colSpan=3><INPUT id=txtMemberPrice type="text" value="<%=item.getPrice()%>" name=price ><FONT color=red>*</FONT></TD></TR>


<TR>
<TD align=left width=100>商品大图:</TD>
<TD colSpan=3><INPUT type=file name=file></TD></TR>
<TR>
<TD width=100></TD>
</TR>
<TR>
<TD align=left colSpan=4></TD></TR>

<TR>
<TD align=left width=100 height=21>库存数量: </TD>
<TD colSpan=3 height=21><INPUT id=txtStorage type="text" value="<%=item.getProStorage() %>" name=storage ><SPAN id=mininum style="DISPLAY: none">警告数量: <INPUT id=txtMininum style="BEHAVIOR: url('#default#saveHistory'); WIDTH: 80px" value=0 name=txtMininum AFevt="1" ACevt="1"></SPAN></TD></TR>


<TR>
<TD align=left width=100>详细描述: </TD>
<TD colSpan=3></TD>
</TR>
<TR>
<TD align=left colSpan=4><textarea name="cont" rows="15" cols="80"><%=item.getDescr()%></textarea></TD></TR>
<TR>
<TD align=middle colSpan=4><BR><INPUT id=btnSave type=submit value=保存 name=btnSave><INPUT class=input onclick=history.go(-1) type=button value=" 返 回 "></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></FORM>
<DIV align=center>
      <DIV id=copyright>Powered by <A class=thisclass href="" 
target=_blank style="color: maroon">qizhenwei</A>&nbsp;&nbsp;Copyright &copy; 
2008-&nbsp;飞越Apache<FONT 
class=thisclass3>.</FONT></DIV></DIV></BODY></HTML>

⌨️ 快捷键说明

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