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

📄 productsadmin.jsp

📁 国外的一套开源CRM
💻 JSP
📖 第 1 页 / 共 2 页
字号:
  <thead class=freeFormSectionTitleTable>
    <tr>
      <td align="left" >Description</td>
      <td align="left" >Category Parent</td>
    </tr>
  </thead>
  <tbody class=freeFormSectionDisplayTable>
<%
    productCategoryProps.put("NAME", "primaryParentCategoryId");
    productCategoryProps.remove("SELECTED");

    for(int i=0;i<productCategories.length;i++){
    productCategory = productCategories[i];
  %>
  <form action="<ofbiz:url>/productsAdmin</ofbiz:url>" method="post" target="content" name="ProductCategory">
  <tr>
    <td><input type="text" name="description" value="<%=productCategory.get("description")%>" size="30" ></td>
    <%if(productCategory.get("primaryParentCategoryId") == null){%>
    <td>&nbsp;<%=buildDropDown(productCategoryList, productCategoryProps ) %></td>
    <%} else {%>
    <td><%=productCategory.get("primaryParentCategoryId")%></td>
    <%}%>
    <td><input type="submit" name="action" value="delete" onclick="return confirm('Confirm delete?');">&nbsp;<input type="submit" name="action" value="update"></td>
    <input type="hidden" name="productCategoryId" value="<%=productCategory.get("productCategoryId")%>">
    <input type="hidden" name="entityType" value="ProductCategory">
  </tr>
  </form>
  <%
    }
  %>
  <form action="<ofbiz:url>/productsAdmin</ofbiz:url>" method="post" target="content" name="ProductCategory">
  <tr>
    <td><input type="text" name="description" size="30" ></td>
    <td>&nbsp;<%=buildDropDown(productCategoryList, productCategoryProps ) %></td>
    <td><input type="submit" name="action" value="add"></td>
    <input type="hidden" name="entityType" value="ProductCategory">
  </tr>
  </form>
  </tbody>
  </table>

 <div class="head1" >Product Features</div>
  <table width="100%" class="freeFormSectionDisplayTable" cellspacing="1" cellpadding="2" border="0" >
  <thead freeFormSectionTitleTable>
  <form action="<ofbiz:url>/productsAdmin</ofbiz:url>" method="post" target="content" name="ProductFeatureChooseProduct">
    <input type="hidden" name="action" value="chooseProduct">
    <tr>
      <%
        HashMap productProps = new HashMap();
        productProps.put("NAME", "productId");
        productProps.put("VALUE_FIELD", "productId" );
        productProps.put("DISPLAY_FIELD", "productName" );
        productProps.put("EMPTY_FIRST", "-- none --");
        productProps.put("SELECT_JAVASCRIPT", "onchange='ProductFeatureChooseProduct.submit();'");
        productProps.put("SELECTED", request.getParameter("productId"));
        %>
      <td align="left" colspan="3">Choose Product&nbsp;<%=buildDropDown(productList, productProps ) %></td>
    </tr>
 </form>
  </thead>
  <tbody class=freeFormSectionTitleTable>
   <tr>
     <td>Product Feature Type</td>
     <td>Description</td>
   </tr>
   <%if(request.getParameter("action") != null && request.getParameter("action").equals("chooseProduct")){

      HashMap productPk = new HashMap();
      productPk.put("productId", request.getParameter("productId"));
      GenericValue productValue = delegator.findByPrimaryKey("Product", productPk);

      List productFeatureTypeList = delegator.findAll("ProductFeatureType", null);
      HashMap productFeatureTypeProps = new HashMap();
      productFeatureTypeProps.put("NAME", "productFeatureTypeId");
      productFeatureTypeProps.put("VALUE_FIELD", "productFeatureTypeId" );
      productFeatureTypeProps.put("DISPLAY_FIELD", "description" );
      productFeatureTypeProps.put("EMPTY_FIRST", "-- none --");

      EntityCondition prodFACondition = new EntityConditionList( UtilMisc.toList( 
        		new EntityExpr("productId", EntityOperator.EQUALS, request.getParameter("productId"))), EntityOperator.AND );
        		
      List productFeatureApplList = delegator.findByCondition("ProductFeatureAppl", prodFACondition , null, null);
      GenericValue productFeatureAppls[] = (GenericValue[])productFeatureApplList.toArray(new GenericValue[0]);
      GenericValue productFeatureAppl = null;

      List list = new ArrayList();
      for(int i=0;i<productFeatureAppls.length;i++){
        productFeatureAppl = productFeatureAppls[i];
        list.add(new EntityExpr("productFeatureId", EntityOperator.EQUALS, productFeatureAppl.getString("productFeatureId")));
      }
      List productFeatureList = delegator.findByCondition("ProductFeature", new EntityConditionList( list, EntityOperator.OR), null, null);
      GenericValue productFeatures[] = (GenericValue[])productFeatureList.toArray(new GenericValue[0]);
      GenericValue productFeature = null;
      for(int i=0;i<productFeatures.length;i++){
        productFeature = productFeatures[i];
        productFeatureTypeProps.put("SELECTED", productFeature.get("productFeatureTypeId"));
     %>
  <form action="<ofbiz:url>/productsAdmin</ofbiz:url>" method="post" target="content" name="ProductFeature">
    <tr>
      <td><%=buildDropDown(productFeatureTypeList, productFeatureTypeProps)%></td>
      <td><input type="text" name="description" value="<%=productFeature.get("description")%>" size="50" ></td>
      <td><input type="submit" name="action" value="delete" onclick="return confirm('Confirm delete?');">&nbsp;<input type="submit" name="action" value="update"></td>
      <input type="hidden" name="productId" value="<%=request.getParameter("productId")%>">
      <input type="hidden" name="productFeatureId" value="<%=productFeature.get("productFeatureId")%>">
      <input type="hidden" name="entityType" value="ProductFeature">
    </tr>
  </form>
<%   } %>
  <form action="<ofbiz:url>/productsAdmin</ofbiz:url>" method="post" target="content" name="ProductFeature">
    <tr>
     <%if(productFeatureTypeProps.containsKey("SELECTED")) productFeatureTypeProps.remove("SELECTED");%>
      <td><%=buildDropDown(productFeatureTypeList, productFeatureTypeProps)%></td>
      <td><input type="text" name="description" size="50" ></td>
      <td><input type="submit" name="action" value="add"></td>
      <input type="hidden" name="productId" value="<%=request.getParameter("productId")%>">
      <input type="hidden" name="entityType" value="ProductFeature">
    </tr>
  </form>

<%}%>
</tbody>
 </table>

 <div class="head1" >Product Features Types</div>
 <%
   List productFeatureTypesList = delegator.findAll("ProductFeatureType", null);
   GenericValue productFeatureTypes[] = (GenericValue[])productFeatureTypesList.toArray(new GenericValue[0]);
   GenericValue productFeatureType = null;
 %>

  <table width="100%" class="freeFormSectionDisplayTable" cellspacing="1" cellpadding="2" border="0" >
    <thead class=freeFormSectionTitleTable>
      <tr>
        <td align="left" >Product Feature Type Id</td>
      </tr>
    </thead>
    <tbody class=freeFormSectionDisplayTable>
      <% for(int i=0;i<productFeatureTypes.length;i++){
           productFeatureType = productFeatureTypes[i];
        %>
      <form action="<ofbiz:url>/productsAdmin</ofbiz:url>" method="post" target="content" name="ProductFeatureType">
      <tr>
        <td><%=productFeatureType.getString("productFeatureTypeId")%></td>
        <td><input type="text" name="description" value="<%=productFeatureType.getString("description")%>" size="50" ></td>
        <td><input type="submit" name="action" value="delete" onclick="return confirm('Confirm delete?');">&nbsp;<input type="submit" name="action" value="update"></td>
        <input type="hidden" name="productFeatureTypeId" value="<%=productFeatureType.getString("productFeatureTypeId")%>">
        <input type="hidden" name="productId" value="<%=request.getParameter("productId")%>">
        <input type="hidden" name="entityType" value="ProductFeatureType">
      </tr>
      </form>
      <% } %>
      <form action="<ofbiz:url>/productsAdmin</ofbiz:url>" method="post" target="content" name="ProductFeatureType">
      <tr>
        <td><input type="text" name="description" size="50" ></td>
        <td><input type="submit" name="action" value="add"></td>
        <input type="hidden" name="productId" value="<%=request.getParameter("productId")%>">
        <input type="hidden" name="entityType" value="ProductFeatureType">
      </tr>
      </form>
    </tbody>
  </table>



 <div class="head1" >Product Associations</div>
 <%

  pList = new ArrayList();

  DynamicViewEntity dve = EntityHelper.createDynamicViewEntity( delegator, "ProductAssoc");
  dve.addMemberEntity("ProductAttribute", "ProductAttribute");
  dve.addViewLink("ProductAssoc", "ProductAttribute", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("productId", "productId")));
  dve.addAlias("ProductAttribute", "attrName", null, null, null, null, null);
  dve.addAlias("ProductAttribute", "attrValue", null, null, null, null, null);
     
  condition = new EntityConditionList(UtilMisc.toList(
				new EntityExpr("attrName", EntityOperator.EQUALS, "OWNER"),
				new EntityExpr("attrValue", EntityOperator.EQUALS, userInfo.getAccountId())),
				EntityOperator.AND);
  
  List productAssocList = EntityHelper.findByCondition(delegator, dve, condition, null);

   GenericValue productAssocTypes[] = (GenericValue[])productAssocList.toArray(new GenericValue[0]);
   GenericValue productAssocType = null;

   List productAssocTypeList = delegator.findAll("ProductAssocType", null);
   HashMap productAssocProps = new HashMap();
   productAssocProps.put("NAME", "productAssocTypeId");
   productAssocProps.put("VALUE_FIELD", "productAssocTypeId" );
   productAssocProps.put("DISPLAY_FIELD", "productAssocTypeId" );
   productAssocProps.put("EMPTY_FIRST", "-- none --");
 %>

  <table width="100%" class="freeFormSectionDisplayTable" cellspacing="1" cellpadding="2" border="0" >
    <thead class=freeFormSectionTitleTable>
      <tr>
        <td align="left" >Product</td>
        <td align="left" >Product Association</td>
        <td align="left" >Product Association Type</td>
        <td align="left" >From Date</td>
        <td align="left" >Through Date</td>
        <td align="left" >Reason</td>
        <td align="left" >Quantity</td>
        <td align="left" >Instruction</td>
      </tr>
    </thead>
    <tbody class=freeFormSectionDisplayTable>
      <% for(int i=0;i<productAssocTypes.length;i++){
           productAssocType = productAssocTypes[i];
        %>
      <form action="<ofbiz:url>/productsAdmin</ofbiz:url>" method="post" target="content" name="ProductAssociations">
      <tr>
       <%
          productProps.remove("SELECT_JAVASCRIPT");
          productProps.put("NAME", "productId");
          productProps.put("VALUE_FIELD", "productId" );
          productProps.put("DISPLAY_FIELD", "productId" );
          productProps.put("EMPTY_FIRST", "-- none --");
          productProps.put("SELECTED", productAssocType.getString("productId"));
        %>
        <td align="left"><%=buildDropDown(productList, productProps)%></td>
       <%
          productProps.put("NAME", "productIdTo");
          productProps.put("VALUE_FIELD", "productId" );
          productProps.put("DISPLAY_FIELD", "productId" );
          productProps.put("EMPTY_FIRST", "-- none --");
          productProps.put("SELECTED", productAssocType.getString("productIdTo"));
        %>
        <td align="left"><%=buildDropDown(productList, productProps)%></td>
        <%productAssocProps.put("SELECTED", productAssocType.getString("productAssocTypeId"));%>
        <td align="left"><%=buildDropDown(productAssocTypeList, productAssocProps)%></td>
        <td><input type="text" name="fromDate" value="" size="20" ></td>
        <td><input type="text" name="thruDate" value="" size="20" ></td>
        <td><input type="text" name="reason" value="<%=productAssocType.getString("reason")%>" size="20" ></td>
        <td><input type="text" name="quantity" value="<%=productAssocType.getString("quantity")%>" size="20" ></td>
        <td><input type="text" name="instruction" value="<%=productAssocType.getString("instruction")%>" size="20" ></td>
        <td><input type="submit" name="action" value="delete" onclick="return confirm('Confirm delete?');">&nbsp;<input type="submit" name="action" value="update"></td>
        <input type="hidden" name="productFeatureTypeId" value="<%=productFeatureType.getString("productFeatureTypeId")%>">
        <input type="hidden" name="productId" value="<%=request.getParameter("productId")%>">
        <input type="hidden" name="entityType" value="ProductAssoc">
      </tr>
      </form>
      <% } %>
      <form action="<ofbiz:url>/productsAdmin</ofbiz:url>" method="post" target="content" name="ProductAssociations">
      <tr>
       <%
          productProps.remove("SELECTED");
          productProps.put("NAME", "productId");
          productProps.put("VALUE_FIELD", "productId" );
          productProps.put("DISPLAY_FIELD", "productId" );
          productProps.put("EMPTY_FIRST", "-- none --");
        %>
        <td align="left"><%=buildDropDown(productList, productProps)%></td>
       <%
          productProps.put("NAME", "productIdTo");
          productProps.put("VALUE_FIELD", "productId" );
          productProps.put("DISPLAY_FIELD", "productId" );
          productProps.put("EMPTY_FIRST", "-- none --");
        %>
        <td align="left"><%=buildDropDown(productList, productProps)%></td>
        <%productAssocProps.remove("SELECTED");%>
        <td align="left"><%=buildDropDown(productAssocTypeList, productAssocProps)%></td>
        <td><input type="text" name="fromDate" value="" size="20" ></td>
        <td><input type="text" name="thruDate" value="" size="20" ></td>
        <td><input type="text" name="reason" value="" size="20" ></td>
        <td><input type="text" name="quantity" value="" size="20" ></td>
        <td><input type="text" name="instruction" value="" size="20" ></td>
        <td><input type="submit" name="action" value="add"></td>
        <input type="hidden" name="productId" value="<%=request.getParameter("productId")%>">
        <input type="hidden" name="entityType" value="ProductAssoc">
      </tr>
      </form>
    </tbody>
  </table>





<%} catch(Exception e){ e.printStackTrace(); }%>

⌨️ 快捷键说明

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