<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%-- jstl1.2--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 

<%@ page isELIgnored="false" %> 
<%@page  import="miinshop.entryDomain.dao.ShopProductCat,miinshop.domain.ArticleAdminDomain" %>
<%--
第一次加载时，显示产品分类列表
点击分类后，加载该分类的产品列表

--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="ShopProductCat 添加实体类列表，path: 请情: www.guuraa.net " />

<title>ShopProductCat列表</title>

                                    <!--
*
 * @author http://www.guuraa.org 鲸浪guuraa
* tel:020-28983330 mobile:15975485229
 * email:wujavei@126.com  QQ:274390981
 * @see /entryJsp/ShopProductCatList.jsp
 -->
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/MyApp/miinshop/admin/style/jquery-easyui-1.3.2/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/MyApp/miinshop/admin/style/jquery-easyui-1.3.2/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/MyApp/miinshop/admin/style/jquery-easyui-1.3.2/demo/demo.css">
	<script type="text/javascript" src="<%=request.getContextPath()%>/MyApp/miinshop/admin/style/jquery-easyui-1.3.2/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/MyApp/miinshop/admin/style/jquery-easyui-1.3.2/jquery.easyui.min.js"></script>

 
 
<script src="/guuraaApp/javascript/guuraa.js" type="text/javascript" language="javascript" charset="UTF-8" ></script>

<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/MyApp/Resource/RIA/miin/base/blue/css.css">

<link rel="stylesheet" type="text/css" href="/MyApp/Resource/RIA/miin/base/blue/css.css">

</head>
<body>
<html:errors/>




<%
ArticleAdminDomain domain=new ArticleAdminDomain(request, response, out);
   java.util.List<miinshop.entryDomain.dao.ShopProductCat> catList=null;   
   Object ol=domain.getController().getAttribute("ShopProductCatList");
 catList=(java.util.List<miinshop.entryDomain.dao.ShopProductCat>)ol;
//out.write("cat list size:"+catList.size());
 %>



    <div id="catList"  style="width:700px;padding:3px; border: solid 1px #6C8EA1;">
          <p>
              选择分类:
         <c:if test="${ShopProductCatList!=null}">
        <c:forEach  items="${ShopProductCatList}" var="cat"  >
          <a href="<%=request.getContextPath()%>/MyApp/miinshop/admin/ArticleAdmin/controller.jsp?act=admin&catid=<c:out value="${cat.catid}"/>"/>
         <c:out value="${cat.catName}"></c:out></a>
        </c:forEach>
        </c:if>
         </p>	
	</div>
 
 
    <p/>
    

<div id="title">
产品列表

</div>
	
<table  border='0' cellpadding='0' cellspacing='1' class="ListTable" width="100%" aligen="center">
<tr class="header"><td>ID</td><td>标题</td> <td>类别</td><td>编辑</td></tr>
    <%
    //test code
    /*
    ArticleAdminDomain domain2=new ArticleAdminDomain(request, response, out);

    java.util.List<miinshop.entryDomain.dao.ShopProduct> articletListTest=null;
   Object ol_alist=domain2.getController().getAttribute("ArticleListAdmin");   
    articletListTest=(java.util.List<miinshop.entryDomain.dao.ShopProduct> )ol_alist;
    if(articletListTest!=null){
      //  out.write("<p/> article data list size:"+articletListTest.size());

    }
   
 
java.util.List<miinshop.entryDomain.dao.ShopProduct> articlelist=new java.util.ArrayList<miinshop.entryDomain.dao.ShopProduct>();
miinshop.entryDomain.dao.ShopProduct a=new miinshop.entryDomain.dao.ShopProduct();
 a.setCatName("bb");
 a.setTitle("article title");
 
articlelist.add(a );
request.setAttribute("alist", articlelist);
 */
 %>
 
 <c:if test="${ShopProductListAdmin!=null}" >
        <c:forEach  items="${ShopProductListAdmin}" var="article"  >

     <tr class="ListEntrydataRow">
        <td class="tdColor1"  >

        <c:out  value="${article.aid}"/>
        </td>
	
        <td class="tdColor2" >
        <c:if test="${article.title==null}" >
    &nbsp;</c:if>
    <c:if test="${article.title!=null}" >
        
        &nbsp;</c:if>

    <c:out value="${article.title}"></c:out>
    
    </td>

        <td class="tdColor2" >
        <c:if test="${article.catName==null}" >
        &nbsp;</c:if>
    <c:if test="${article.catName!=null}" >
        
        &nbsp;</c:if>

    <c:out value="${article.catName}"></c:out>
    
    </td>
	

        <td class="tdColor2" >
        <div class="crudLINK">
          <a href="<%=request.getContextPath()%>/MyApp/miinshop/pages/default/article.jsp?aid=<c:out value="${article.aid}"/>" target="_blank">
       预览
        </a>
            &nbsp;
         <a href="<%=request.getContextPath()%>/MyApp/miinshop/admin/ArticleAdmin/controller.jsp?act=view&id=<c:out value="${article.aid}"/>">
       查看
        </a>
       &nbsp;
           
       <a href="<%=request.getContextPath()%>/MyApp/miinshop/admin/ArticleAdmin/controller.jsp?act=updateInit&id=<c:out value="${article.aid}"/>">
       修改
        </a>
       &nbsp;
        <a href="<%=request.getContextPath()%>/MyApp/miinshop/admin/ArticleAdmin/controller.jsp?act=delete&id=<c:out value="${article.aid}"/>" onclick="return deleteShopProduct()"  >删除</a>
     
        <div></td>
    </tr>

    </c:forEach>
</c:if>
</table>
        </p>	
	


<script language="javascript">
function deleteShopProduct(){
var value=confirm("是否确认删除产品");
	 if(value==true){
	 return true;
}	 else {return false;
}
	}

</script>



<c:if test="${info!=null}">
	<script type="text/javascript">
		alert("<c:out value="${info}"></c:out>");
	</script>
</c:if>

</body>
</html>
