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

📄 additem.jsp

📁 噶额外噶外骨骼感广泛高热感 就 啊啊
💻 JSP
字号:
<%@ page contentType="text/html; charset=UTF-8" %>
<%--
 * @author  Sujatha
 * @version 1.0
 *
 * Development Environment        :  Oracle9i JDeveloper
 * Name of the Application        :  addItem.jsp
 * Creation/Modification History  :
 *
 *     Sujatha        27-Dec-2001      Created
 *     Sujatha        24-Jan-2003      Incorporated Struts framework
 *
 * Overview of Application  
 * This JSP displays a html form for adding items to the shop by shop owner
 *
--%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ page import="oracle.otnsamples.vsm.services.data.SubCategory"%>
<%@ page import="oracle.otnsamples.vsm.actions.forms.ItemForm"%>
<%@ page language="java" errorPage="../misc/errorHandler.jsp" %>
<HEAD>
<TITLE><bean:message key="title.additem"/></TITLE>
<SCRIPT SRC="includes/utils.js"></SCRIPT>
<!-- To prevent caching -->
<% 
   response.setHeader("Cache-Control","no-cache"); // HTTP 1.1
   response.setHeader("Pragma","no-cache"); // HTTP 1.0
   response.setDateHeader ("Expires", -1); // Prevents caching at the proxy server
%>  

<SCRIPT type="text/javascript"> 
  function submitForm() { 

  var frm = document.forms[1];
  // Check if all the required fields have been entered (with proper values) before
  // submitting the form
  
  if( trim(frm.name.value) == "" ) {
	  alert("<bean:message key="item.javascript.nameerror"/>");
	  frm.name.focus();
	  return ;
	} 

  if( trim(frm.desc.value) == "" ) {
	  alert("<bean:message key="item.javascript.descerror"/>");
	  frm.desc.focus();
	  return ;
	} 

  if( frm.desc.value.length > 4000 ) {
	  alert("<bean:message key="item.javascript.desclimiterror"/>");
	  frm.desc.focus();
	  return ;
	} 

  if( frm.quantity.value == "" || !isInt(frm.quantity.value) ) {
    alert("<bean:message key="item.javascript.qtyformaterror"/>");
    frm.quantity.focus();
    return ;
  }

  if( parseInt(frm.quantity.value) < 0 ) {
    alert("<bean:message key="item.javascript.qtyvalueerror"/>");
    frm.quantity.focus();
    return ;
  }

  if( frm.reorderLevel.value == "" || !isInt(frm.reorderLevel.value) ) {
    alert("<bean:message key="item.javascript.reorderlevelformaterror"/>");
    frm.reorderLevel.focus();
    return ;
  }

  if( parseInt(frm.reorderLevel.value) < 0 ) {
    alert("<bean:message key="item.javascript.reordervalueerror"/>");
    frm.reorderLevel.focus();
    return ;
  }

  if( frm.reorderQty.value == "" || !isInt(frm.reorderQty.value) ) {
    alert("<bean:message key="item.javascript.reorderqtyformaterror"/>");
    frm.reorderQty.focus();
    return ;
  }

  if( parseInt(frm.reorderQty.value) < 0 ) {
    alert("<bean:message key="item.javascript.reorderqtyvalueerror"/>");
    frm.reorderQty.focus();
    return ;
  }

  
  if( frm.unitPrice.value == "" || isNaN(frm.unitPrice.value) ) {
    alert("<bean:message key="item.javascript.priceerror"/>");
    frm.unitPrice.focus();
    return ;
  }

  if( parseFloat(frm.unitPrice.value) <= 0 ) {
    alert("<bean:message key="item.javascript.pricevalueerror"/>");
    frm.unitPrice.focus();
    return ;
  }
  frm.submit();  
}
</SCRIPT>
</HEAD>    
<jsp:include page="../misc/ownerHeader.jsp" flush="true"></jsp:include>  	
<!-- Get all item related information if submitted by the user previously 
     This will be used to populate all the form fields                      -->


    <TABLE width="100%" border="0" cellspacing="0" cellpadding=
      "1" bgcolor="white">
        <TR>
          <TD width="17%" valign="top">
          <jsp:include page="leftNavigation.jsp" flush="true"></jsp:include> 
          </TD>
          <TD width="69%" valign="top">
            <TABLE width="100%">
              <TR>
                <TD width="26%" height="33" class="SubHeading">
                <bean:message key="subheading.additem"/></TD>

                <TD width="76%" height="33">
                  <HR>
                </TD>
              </TR>
  <logic:present name="message" scope="request">
       <TR> 
         <TD width="20%" align="center" class="ErrorText" colspan="2">
            <img src="images/warning.gif">&nbsp;<%=request.getAttribute("message")%>
         </TD>
       </TR>
</logic:present>               
            </TABLE>


<!-- If the owner has not added any subcategories to the shop yet then display
       an appropriate message -->
  <logic:equal name="subcategories" scope="request" value="null">  
     <TABLE width="100%">
       <TR> 
         <TD width="20%" align="center" class="ErrorText"><bean:message key="message.addsubcat"/></TD>
       </TR>
     </TABLE>
</logic:equal>     
  <logic:notEqual name="subcategories" scope="request" value="null">  
<%    SubCategory[]  subCats     = (SubCategory[])request.getAttribute("subcategories"); %>

<html:form action="authowneritem.do?command=addItem" enctype="multipart/form-data" scope="request" name="item" type="oracle.otnsamples.vsm.actions.forms.ItemForm">
        <TABLE width="100%" border="0" cellspacing="0" cellpadding="3">
              <TR>
                <TD width="27%" class="Prompt" align="right"><bean:message key="prompt.itemname"/></TD>

                <TD width="73%">
                  <html:text property="name" size="30" maxlength="50"/>
                </TD>
              </TR>

              <TR>
                <TD width="27%" height="22" class="Prompt" align=
                "right"><bean:message key="prompt.subcatname"/></TD>

                <TD width="73%">
              <html:select property="subCatID">
            <logic:iterate id="subcat" name="subcategories" scope="request" type="oracle.otnsamples.vsm.services.data.SubCategory">
              <html:option value="<%=subcat.getId()%>"><%=subcat.getName()%></html:option>
            </logic:iterate>              
              </html:select>
           </TD>

              </TR>

              <TR>
                <TD width="10%" class="Prompt" align="right">
                <bean:message key="prompt.itemdescription"/></TD>

                <TD width="39%"> 
                  <html:textarea property="desc" rows="3" cols="35"/> 
                </TD>
              </TR>
             
              <TR>
                <TD width="10%" class="Prompt" align="right">
                <bean:message key="prompt.quantity"/></TD>
                <TD width="39%">
                  <html:text property="quantity" size="4" maxlength="4"/> 
                </TD>
              </TR>

              <TR>
                <TD width="27%" class="Prompt" align="right">
                <bean:message key="prompt.price"/></TD>

                <TD width="73%">
                   <html:text property="unitPrice" size="8" maxlength="8"/>                
              </TD>              
              </TR>

              <TR>
                <TD width="27%" class="Prompt" align="right">
                <bean:message key="prompt.reorderLevel"/></TD>

                <TD width="73%">
                   <html:text property="reorderLevel" size="4" maxlength="4"/>                
              </TD>              
              </TR>

              <TR>
                <TD width="27%" class="Prompt" align="right">
                <bean:message key="prompt.reorderQty"/></TD>

                <TD width="73%">
                   <html:text property="reorderQty" size="4" maxlength="4"/>                
              </TD>              
              </TR>
              <TR>
                <TD width="27%" class="Prompt" align="right"><bean:message key="prompt.uploadimage"/></TD>
               <TD width="73%"><html:file property="image" value="" size="30"/></TD>
              </TR>

              <TR>
                <TD>
                </TD>
              </TR>
             </TABLE>
        <BR>     
        <TABLE width="100%" border="0" cellspacing="0" cellpadding="3" align=center>
          <TR> 
            <TD width="20%">&nbsp;</TD>
            <TD width="10%" align="right"> <A HREF="javascript:submitForm()">
              <html:img srcKey="image.continue" border="0"/></A> </TD>
            <TD width="10%" align="center">
              <A HREF="javascript:document.forms[1].reset();">
                <html:img srcKey="image.reset" border="0"/></A> </TD>
            <TD width="10%" align="left"> <A HREF="javascript:history.go(-1);">
              <html:img  srcKey="image.cancel" border="0"/></A> </TD>
            <TD width="39%">&nbsp;</TD>
          </TR>
        </TABLE>      
        </html:form>            
</logic:notEqual>        
          </TD>
        </TR>
      </TABLE>
 <jsp:include page="../misc/commonFooter.jsp" flush="true"></jsp:include>
  </BODY>
</HTML>

⌨️ 快捷键说明

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