您好,登錄后才能下訂單哦!
登入頁面
角色列表:
用戶列表
角色添加:
權限列表:
權限添加:
商品列表:
商品添加:
用戶列表視圖:userlist.jsp↓
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!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"> <title>Insert title here</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> </head> <body> <div class="container-fluid"> <div class="row-fluid"> <div class="span12"> <s:form> <div class="btn-group" > <a href="user_upadd" class="btn btn-small">添加</a> <button id="rew" class="btn btn-small">修改</button> <button id="del" class="btn btn-small">刪除</button> </div> <table class="table table-condensed table-hover table-bordered"> <thead> <tr> <th>ID</th> <th>姓名</th> <th>年齡</th> <th>性別</th> <th>職稱</th> <th>mail</th> <th>角色</th> <th>添加時間</th> <th>修改時間</th> <th>狀態</th> </tr> </thead> <!--等待編輯--> <s:iterator value="users"> <tr> <td><s:checkbox label="id" name="upid" fieldValue="%{id}" value="false" theme="simple" /><s:property value="id"/></td> <td><s:property value="name" /></td> <td><s:property value="age" /> </td> <td><s:property value="sex" /></td> <td><s:property value="position" /></td> <td><s:property value="mail" /></td> <td><s:property value="group.getName()" /></td> <td><s:property value="createDate" /></td> <td><s:property value="reworkDate" /></td> <td><s:if test="state == 1">有效</s:if> <s:else>無效</s:else> </td> </tr> </s:iterator> </table> </s:form> <s:set value="page" var="curr" /><!--起始頁 --> <s:set value="totalPage" var="countPage"/><!-- 頁碼總數 --> <div class="pagination pagination-centered"> <ul> <li><a href="user_list?page=1">首頁 </a></li> <li><a href='<s:if test="#curr > 1">user_list?page=<s:property value="#curr - 1" /></s:if><s:else>#</s:else>'>上一頁 </a></li> <s:bean name="org.apache.struts2.util.Counter" id="counter"> <s:param name="first" value="startNum" /> <s:param name="last" value="endNum" /> <s:iterator> <li><a href='user_list?page=<s:property/>'><s:property/></a><li> </s:iterator> </s:bean> <li><a href='<s:if test="#curr < #countPage">user_list?page=<s:property value="#curr + 1" /></s:if><s:else>#</s:else>'>下一頁 </a></li> <li><a href='user_list?page=<s:property value="#countPage" />'>尾頁</a></li> </ul> </div> </div> </div> </div> <script type="text/javascript" src="bootstrap/js/jquery-1.10.1.min.js"></script> <script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#rew").click(function(){ $("form").attr("action","user_addui"); $("form").submit(); }); $("#del").click(function(){ $("form").attr("action","user_del"); $("form").submit(); }); }); </script> </body> </html>
用戶添加視圖:userinfo.jsp↓
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib prefix="s" uri="/struts-tags" %> <s:set value="upuser" var="u" /> <s:debug /> <!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"> <title>user info</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> <style type="text/css"> table td{word-break: keep-all;white-space:nowrap;} </style> </head> <body> <div class="contaniner-fluid"> <div class="row-fluid"> <s:form class="form-horizontal" theme="simple" > <s:hidden name="user.id" value="%{#u.id}"/> <div class="span6"> <!----> <h4 class="brand"><s:if test="#u.id != null">修改用戶</s:if><s:else>添加用戶</s:else></h4> <div class="btn-group" > <a href="user_list" class="btn">返回</a> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >用戶名稱 <s:textfield placeholder="用戶名稱" name="user.name" value='%{#u.name}'> </s:textfield> </label> </div> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >用戶密碼 <s:password placeholder="用戶密碼" name="user.pass" /> </label> </div> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >年齡 <s:textfield placeholder="年齡" name="user.age" value='%{#u.age}' /> </label> </div> </div> <s:radio label="性別" list="#{'男':'男','女':'女'}" name="user.sex" value="%{#u.sex}" /> <div class="control-group"> <div class="controls"> <label class="control-label" >職稱 <s:textfield placeholder="職稱" size="100" name="user.position" value='%{#u.position}'/> </label> </div> </div> <div class="control-group"> <div class="controls"> <label class="control-label">mail <s:textfield placeholder="mail" size="100" name="user.mail" value='%{#u.mail}'/> </label> </div> </div> <div class="control-group"> <div class="controls"> <label class="control-label">角色 <s:select name="user.group.id" list="addGroups" headerKey="0" headerValue="請選擇" value='%{#u.group.id}' listValue="name" listKey="id" /> </label> </div> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >狀態 <s:select name="user.state" list="#{'1':'有效','2':'無效'}" headerKey="0" headerValue="請選擇" value='%{#u.state}'/> </label> </div> </div> <div class="control-group"> <div class="controls"> <button <s:if test="#u.id != null">id="up"</s:if><s:else>id="add"</s:else> class="btn"><s:if test="#u.id != null">修改</s:if><s:else>添加</s:else></button> </div> </div> </div> <div class="span6"> <!----> </div> </s:form> </div> </div> <script src="bootstrap/js/jquery-1.10.1.min.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#add").click(function(){ $("form").attr("action","user_add"); $("form").submit(); }) $("#up").click(function(){ $("form").attr("action","user_up"); $("form").submit(); }) }) </script> </body> </html>
角色列表視圖:grouplist.jsp↓
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib prefix="s" uri="/struts-tags" %> <!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"> <title>group list</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> </head> <body> <div class="container-fluid"> <div class="row-fluid"> <div class="span12"> <s:form theme="simple"> <input type="hidden" id="hiddenmyform"/> <input type="hidden" id="hiddenmethod"/> <div class="btn-group" > <a href="group_upadd" class="btn btn-small">添加</a> <button id="rew" class="btn btn-small">修改</button> <button id="del" class="btn btn-small">刪除</button> </div> <table class="table table-condensed table-hover table-bordered"> <thead> <tr> <th> ID </th> <th> 名稱 </th> <th> 添加時間 </th> <th> 修改時間 </th> <th> 狀態 </th> </tr> </thead> <s:iterator value="groups"> <tr> <td><s:checkbox label="id" name="upid" fieldValue="%{id}" value="false" /><s:property value="id"/></td> <td><s:property value="name" /></td> <td><s:property value="createdate" /></td> <td><s:property value="reworkdate" /></td> <td><s:if test="state == 1">有效</s:if> <s:else>無效</s:else> </td> </tr> </s:iterator> </table> </s:form> <s:set value="page" var="curr" /><!--起始頁 --> <s:set value="totalPage" var="countPage"/><!-- 頁碼總數 --> <div class="pagination pagination-centered"> <ul> <li><a href="group_list?page=1">首頁 </a></li> <li><a href='<s:if test="#curr > 1">group_list?page=<s:property value="#curr - 1" /></s:if><s:else>#</s:else>'>上一頁 </a></li> <s:bean name="org.apache.struts2.util.Counter" id="counter"> <s:param name="first" value="startNum" /> <s:param name="last" value="endNum" /> <s:iterator> <li><a href='group_list?page=<s:property/>'><s:property/></a><li> </s:iterator> </s:bean> <li><a href='<s:if test="#curr < #countPage">group_list?page=<s:property value="#curr + 1" /></s:if><s:else>#</s:else>'>下一頁 </a></li> <li><a href='group_list?page=<s:property value="#countPage" />'>尾頁</a></li> </ul> </div> </div> </div> </div> <script src="bootstrap/js/jquery-1.10.1.min.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#rew").click(function(){ $("form").attr("action","group_addui"); $("form").submit(); }) $("#del").click(function(){ $("form").attr("action","group_del"); $("form").submit(); }) }) </script> </body> </html>
角色添加視圖:groupinfo.jsp↓
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib prefix="s" uri="/struts-tags" %> <s:set value="upgroup" var="g" /> <!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"> <title>group info</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> <style type="text/css"> table td{word-break: keep-all;white-space:nowrap;} </style> </head> <body> <div class="contaniner-fluid"> <div class="row-fluid"> <s:form class="form-horizontal" theme="simple"> <div class="span6"> <!----> <input type="hidden" id="myf"/> <input type="hidden" id="met"/> <s:hidden name="group.id" value="%{#g.id}" /> <h4 class="brand"><s:if test="#g.id != null">修改角色</s:if><s:else>添加角色</s:else></h4> <div class="btn-group" > <a href="group_list" class="btn">返回</a> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >角色名稱 <s:textfield placeholder="角色名稱" name="group.name" value="%{#g.name}" /> </label> </div> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >狀態 <s:select name="group.state" list="#{'1':'有效','2':'無效'}" headerKey="0" headerValue="請選擇" value='%{#g.state}'/> </label> </div> </div> <div class="control-group"> <div class="controls"> <button <s:if test="#g.id != null">id="up"</s:if><s:else>id="add"</s:else> class="btn"> <s:if test="#g.id != null">修改</s:if><s:else>添加</s:else> </button> </div> </div> </div> <div class="span6"> <!----> <h4>權限</h4> <div class="container-fluid" > <table class="table table-bordered table-striped" > <thead> <tr> <th>選擇</th> <th>權限</th> <th>權限描述</th> </tr> </thead> <tbody> <!-- 權限編輯 --> <s:set value="myMap" id="map"/> <s:iterator value="addAuthority" id="adds"> <tr> <td> <s:if test="#map.get(id) != null "><s:checkbox label="id" name="upaid" fieldValue="%{id}" value="true" /><s:property value="id"/></s:if> <s:else><s:checkbox label="id" name="upaid" fieldValue="%{id}" value="false" /><s:property value="id"/></s:else> </td> <td><s:property value="authorityName"/></td> <td><s:property value="description"/></td> </tr> <s:iterator value="#adds.getaLists()" id="aws"> <tr> <td> <s:if test="#map.get(id) != null"><s:checkbox label="id" name="upaid" fieldValue="%{id}" value="true" /><s:property value="id"/></s:if> <s:else><s:checkbox label="id" name="upaid" fieldValue="%{id}" value="false" /><s:property value="id"/></s:else> </td> <td><s:property value="authorityName"/></td> <td><s:property value="description"/></td> </tr> <s:iterator value="#aws.getaLists()"> <tr> <td> <s:if test="#map.get(id) != null "><s:checkbox label="id" name="upaid" fieldValue="%{id}" value="true" /><s:property value="id"/></s:if> <s:else><s:checkbox label="id" name="upaid" fieldValue="%{id}" value="false" /><s:property value="id"/></s:else> </td> <td><s:property value="authorityName"/></td> <td><s:property value="description"/></td> </tr> </s:iterator> </s:iterator> </s:iterator> </tbody> </table> </div> </div> </s:form> </div> </div> <script src="bootstrap/js/jquery-1.10.1.min.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#add").click(function(){ $("form").attr("action","group_add"); $("form").submit(); }) $("#up").click(function(){ $("form").attr("action","group_up"); $("form").submit(); }) }); </script> <s:debug /> </body> </html>
權限列表視圖:authoritylist.jsp↓
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> <!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"> <title>authority list</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> <style type="text/css"> table td,th{word-break: keep-all;white-space:nowrap;} </style> </head> <body> <div class="container-fluid"> <div class="row-fluid"> <div class="span12"> <s:form theme="simple"> <input type="hidden" id="myf" /> <input type="hidden" id="met" /> <div class="btn-group" > <a href="authority_upadd" class="btn btn-small" >添加</a> <button type="button" class="btn btn-small" id="rew" >修改</button> <button type="button" class="btn btn-small" id="del" >刪除</button> </div> <table class="table table-condensed table-hover table-bordered"> <thead> <tr> <th>ID</th> <th>權限名稱</th> <th>權限描述</th> <th>路徑</th> <th>添加時間</th> <th>修改時間</th> <th>狀態 </th> </tr> <s:iterator value="authoritys" id="ao"> <tr> <td><s:checkbox label="id" name="upid" fieldValue="%{id}" value="false" /><s:property value="id"/></td> <td><s:property value="authorityName" /></td> <td><s:property value="description" /></td> <td><s:property value="path" /></td> <td><s:property value="createDate" /></td> <td><s:property value="reworkDate" /></td> <td><s:if test="state == 1"> 有效</s:if><s:else>無效</s:else></td> </tr> <s:iterator value="#ao.getaLists()" id="at"> <tr> <td><s:checkbox label="id" name="upid" fieldValue="%{id}" value="false" /><s:property value="id"/></td> <td><s:property value="authorityName" /></td> <td><s:property value="description" /></td> <td><s:property value="path" /></td> <td><s:property value="createDate" /></td> <td><s:property value="reworkDate" /></td> <td><s:if test="state == 1"> 有效</s:if><s:else>無效</s:else></td> </tr> <s:iterator value="#at.getaLists()" id="ath"> <tr> <td><s:checkbox label="id" name="upid" fieldValue="%{id}" value="false" /><s:property value="id"/></td> <td><s:property value="authorityName" /></td> <td><s:property value="description" /></td> <td><s:property value="path" /></td> <td><s:property value="createDate" /></td> <td><s:property value="reworkDate" /></td> <td><s:if test="state == 1"> 有效</s:if><s:else>無效</s:else></td> </tr> </s:iterator> </s:iterator> </s:iterator> </thead> </table> </s:form> <s:set value="page" var="curr" /><!--起始頁 --> <s:set value="totalPage" var="countPage"/><!-- 頁碼總數 --> <div class="pagination pagination-centered"> <ul> <li><a href="authority_list?page=1">首頁 </a></li> <li><a href='<s:if test="#curr > 1">authority_list?page=<s:property value="#curr - 1" /></s:if><s:else>#</s:else>'>上一頁 </a></li> <s:bean name="org.apache.struts2.util.Counter" id="counter"> <s:param name="first" value="startNum" /> <s:param name="last" value="endNum" /> <s:iterator> <li><a href='authority_list?page=<s:property/>'><s:property/></a><li> </s:iterator> </s:bean> <li><a href='<s:if test="#curr < #countPage">authority_list?page=<s:property value="#curr + 1" /></s:if><s:else>#</s:else>'>下一頁 </a></li> <li><a href='authority_list?page=<s:property value="#countPage" />'>尾頁</a></li> </ul> </div> </div> </div> </div> <script src="bootstrap/js/jquery-1.10.1.min.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#rew").click(function(){ $("form").attr("action","authority_addui"); $("form").submit(); }) $("#del").click(function(){ $("form").attr("action","authority_del"); $("form").submit(); }) }) </script> <s:debug/> </body> </html>
權限添加視圖:authorityinfo.jsp↓
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags"%> <s:set value="upauthority" var="a" /> <!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"> <title>authorityinfo</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> <style type="text/css"> table td{word-break: keep-all;white-space:nowrap;} </style> </head> <body> <div class="contaniner-fluid"> <div class="row-fluid"> <s:form class="form-horizontal" theme="simple"> <div class="span6"> <!----> <s:hidden name="authority.id" value="%{#a.id}" /> <h4 class="brand"><s:if test="#a.id != null">修改權限</s:if><s:else>添加權限</s:else> <div class="btn-group" > <a href="authority_list" class="btn">返回</a> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >權限名稱 <s:textfield placeholder="權限名稱" name="authority.authorityName" value="%{#a.authorityName}" /> </label> </div> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >權限描述 <s:textarea rows="3" name="authority.description" value="%{#a.description}" /> </label> </div> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >路徑 <s:textfield placeholder="路徑" name="authority.path" value="%{#a.path}" /> </label> </div> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >狀態 <s:select name="authority.state" list="#{'1':'有效','2':'無效'}" headerKey="0" headerValue="請選擇" value='%{#a.state}'/> </label> </div> </div> <div class="control-group"> <div class="controls"> <button <s:if test="#a.id != null">id="up"</s:if><s:else>id="add"</s:else> class="btn"> <s:if test="#a.id != null">修改</s:if><s:else>添加</s:else> </button> </div> </div> </div> <div class="span6"> <!----> <h4>權限</h4> <div class="container-fluid" > <table class="table table-bordered table-striped" > <thead> <tr> <th>選擇</th> <th>權限</th> <th>權限描述</th> </tr> </thead> <tbody> <s:iterator value="authoritys" id="ao"> <tr> <td> <s:radio list="%{#{id:id}}" name="authority.pid" value="%{#a.pid}" /> </td> <td><s:property value="authorityName" /></td> <td><s:property value="description" /></td> </tr> <s:iterator value="#ao.getaLists()" id="at"> <tr> <td><s:radio list="%{#{id:id}}" name="authority.pid" value="%{#a.pid}" /></td> <td><s:property value="authorityName" /></td> <td><s:property value="description" /></td> </tr> <s:iterator value="#at.getaLists()" id="ath"> <tr> <td><s:property value="id"/></td> <td><s:property value="authorityName" /></td> <td><s:property value="description" /></td> </tr> </s:iterator> </s:iterator> </s:iterator> </tbody> </table> </div> </div> </s:form> </div> </div> <script src="bootstrap/js/jquery-1.10.1.min.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#add").click(function(){ $("form").attr("action","authority_add"); $("form").submit(); }) $("#up").click(function(){ $("form").attr("action","authority_up"); $("form").submit(); }) }); </script> </body> </html>
商品分類列表視圖:commodityclasslist.jsp↓
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> <!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"> <title>commodity class list</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> <style type="text/css"> table td,th{word-break: keep-all;white-space:nowrap;} </style> </head> <body> <div class="container-fluid"> <div class="row-fluid"> <div class="span12"> <s:form theme="simple"> <div class="btn-group" > <a href="commodityClass_upadd" class="btn btn-small">添加</a> <button type="button" class="btn btn-small" id="rew" >修改</button> <button type="button" class="btn btn-small" id="del" >刪除</button> </div> <table class="table table-condensed table-hover table-bordered"> <thead> <tr> <th> ID </th> <th> 分類名稱 </th> <th> 商品 </th> <th> 添加時間 </th> <th> 修改時間 </th> <th> 狀態 </th> </tr> <s:iterator value="ccs" id="ao"> <tr> <td><s:checkbox label="id" name="upid" fieldValue="%{id}" value="false" /><s:property value="id"/></td> <td><s:property value="name" /></td> <td><ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <img data-src="holder.js/120x80" alt="120x80" src='<s:url value="/upload/%{path}"/>'/> </div> </li> </ul></td> <td><s:property value="createDate" /></td> <td><s:property value="reworkDate" /></td> <td><s:if test="#state == 1"> 有效</s:if><s:else>無效</s:else></td> </tr> <s:iterator value="#ao.getaLists()" id="at"> <tr> <td><s:checkbox label="id" name="upid" fieldValue="%{id}" value="false" /><s:property value="id"/></td> <td><s:property value="name" /></td> <td><ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <img data-src="holder.js/120x80" alt="120x80" src='<s:url value="/upload/%{path}"/>'/> </div> </li> </ul></td> <td><s:property value="createDate" /></td> <td><s:property value="reworkDate" /></td> <td><s:if test="#state == 1"> 有效</s:if><s:else>無效</s:else></td> </tr> <s:iterator value="#at.getaLists()" id="ath"> <tr> <td><s:checkbox label="id" name="upid" fieldValue="%{id}" value="false" /><s:property value="id"/></td> <td><s:property value="name" /></td> <td><ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <img data-src="holder.js/120x80" alt="120x80" src='<s:url value="/upload/%{path}"/>'/> </div> </li> </ul> </td> <td><s:property value="createDate" /></td> <td><s:property value="reworkDate" /></td> <td><s:if test="#state == 1"> 有效</s:if><s:else>無效</s:else></td> </tr> <s:iterator value="#ath.getaLists()" > <tr> <td><s:checkbox label="id" name="upid" fieldValue="%{id}" value="false" /><s:property value="id"/></td> <td><s:property value="name" /></td> <td><ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <img data-src="holder.js/120x80" alt="120x80" src='<s:url value="/upload/%{path}"/>'/> </div> </li> </ul> </td> <td><s:property value="createDate" /></td> <td><s:property value="reworkDate" /></td> <td><s:if test="#state == 1"> 有效</s:if><s:else>無效</s:else></td> </tr> </s:iterator> </s:iterator> </s:iterator> </s:iterator> </thead> </table> </s:form> <s:set value="page" var="curr" /><!--起始頁 --> <s:set value="totalPage" var="countPage"/><!-- 頁碼總數 --> <div class="pagination pagination-centered"> <ul> <li><a href="commodityClass_list?page=1">首頁 </a></li> <li><a href='<s:if test="#curr > 1">commodityClass_list?page=<s:property value="#curr - 1" /></s:if><s:else>#</s:else>'>上一頁 </a></li> <s:bean name="org.apache.struts2.util.Counter" id="counter"> <s:param name="first" value="startNum" /> <s:param name="last" value="endNum" /> <s:iterator> <li><a href='commodityClass_list?page=<s:property/>'><s:property/></a><li> </s:iterator> </s:bean> <li><a href='<s:if test="#curr < #countPage">commodityClass_list?page=<s:property value="#curr + 1" /></s:if><s:else>#</s:else>'>下一頁 </a></li> <li><a href='commodityClass_list?page=<s:property value="#countPage" />'>尾頁</a></li> </ul> </div> </div> </div> </div> <script src="bootstrap/js/jquery-1.10.1.min.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#rew").click(function(){ $("form").attr("action","commodityClass_addui"); $("form").submit(); }) $("#del").click(function(){ $("form").attr("action","commodityClass_del"); $("form").submit(); }) }) </script> </body> </html>
商品分類添加視圖:commodityclassinfo.jsp↓
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> <s:set value="upcommodityclass" var="cc" /> <!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"> <title>commodity class info</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> <style type="text/css"> table td,th{word-break: keep-all;white-space:nowrap;} </style> </head> <body> <div class="contaniner-fluid"> <div class="row-fluid"> <s:form class="form-horizontal" theme="simple" > <div class="span6"> <!----> <s:hidden name="commodityclass.id" value="%{#cc.id}" /> <h4 class="brand"><s:if test="#cc.id != unll ">修改商品</s:if><s:else>添加商品</s:else></h4> <div class="btn-CommodityClass_Entity" > <a href="commodityClass_list" class="btn">返回</a> </div> <div class="control-group"> <div class="controls"> <label class="control-label">商品名稱 <s:textfield placeholder="商品名稱" name="commodityclass.name" value="%{#cc.name}" /> </label> </div> </div> <div class="control-group"> <label class="control-label" for="text03">商品圖片</label> <div class="controls"> <img class="img-polaroid" alt="160x120" width="30%" src='<s:url value="/upload/%{#cc.path}"/>' /> <s:file class="input-file" placeholder="圖片地址" size="100" name="pic" value=""/> </div> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >狀態 <s:select name="commodityclass.state" list="#{'1':'有效','2':'無效'}" headerKey="0" headerValue="請選擇" value='%{#cc.state}'/> </label> </div> </div> <div class="control-group"> <div class="controls"> <button <s:if test="#cc.id != null">id="rew"</s:if><s:else>id="add"</s:else> class="btn"> <s:if test="#cc.id != null">修改</s:if><s:else>添加</s:else> </button> </div> </div> </div> <div class="span6"> <!----> <h4>商品分類</h4> <div class="container-fluid" > <table class="table table-bordered table-striped" > <thead> <tr> <th>選擇</th> <th>商品分類</th> <th>商品</th> </tr> </thead> <tbody> <s:iterator value="ccs" id="cco"> <tr> <td> <s:radio list="%{#{id:id}}" name="commodityclass.pid" value="%{#cc.pid}" /> </td> <td><s:property value="name" /></td> <td> <ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <img data-src="holder.js/160x120" alt="160x120" src='<s:url value="/upload/%{path}"/>'/> </div> </li> </ul> </td> </tr> <s:iterator value="#cco.getaLists()" id="cct"> <tr> <td> <s:radio list="%{#{id:id}}" name="commodityclass.pid" value="%{#cc.pid}" /> </td> <td><s:property value="name" /></td> <td> <ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <img data-src="holder.js/160x120" alt="160x120" src='<s:url value="/upload/%{path}"/>'/> </div> </li> </ul> </td> </tr> <s:iterator value="#cct.getaLists()" id="ccws"> <tr> <td> <s:radio list="%{#{id:id}}" name="commodityclass.pid" value="%{#cc.pid}" /> </td> <td><s:property value="name" /></td> <td> <ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <img data-src="holder.js/160x120" alt="160x120" src='<s:url value="/upload/%{path}"/>'/> </div> </li> </ul> </td> </tr> <s:iterator value="#ccws.getaLists()" > <tr> <td><s:property value="id" /></td> <td><s:property value="name" /></td> <td> <ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <img data-src="holder.js/160x120" alt="160x120" src='<s:url value="/upload/%{path}"/>'/> </div> </li> </ul> </td> </tr> </s:iterator> </s:iterator> </s:iterator> </s:iterator> </tbody> </table> </div> </div> </s:form> </div> </div> <script src="bootstrap/js/jquery-1.10.1.min.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#add").click(function(){ $("form").attr("action","commodityClass_add"); $("form").attr("enctype","multipart/form-data"); $("form").submit(); }) $("#rew").click(function(){ $("form").attr("action","commodityClass_up"); $("form").attr("enctype","multipart/form-data"); $("form").submit(); }) }); </script> </body> </html>
商品列表視圖:commoditylist.jsp↓
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> <!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"> <title>commodity list</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> <style type="text/css"> table td,th{word-break: keep-all;white-space:nowrap;} </style> </head> <body> <div class="container-fluid"> <div class="row-fluid"> <div class="span12"> <s:form theme="simple"> <input type="hidden" id="hiddenmyform"/> <input type="hidden" id="hiddenmethod"/> <div class="btn-group" > <a href="commodity_upadd" class="btn btn-small">添加</a> <button id="rew" class="btn btn-small">修改</button> <button id="del" class="btn btn-small">刪除</button> <s:select name="ccsid" list="sccs" headerKey="0" headerValue="選擇分類" listKey="id" listValue="name" value="0" onchange="getcommoditys(this)" /> </div> <table class="table table-condensed table-hover table-bordered"> <thead> <tr> <th> ID </th> <th> 編號 </th> <th> 名稱 </th> <th> 商品 </th> <th> 價格 </th> <th> 鏈接 </th> <th> 添加時間 </th> <th> 修改時間 </th> <th> 狀態 </th> </tr> </thead> <tbody id="show"> <s:iterator value="commoditys" > <tr> <td><s:checkbox label="id" name="upid" fieldValue="%{id}" value="false" /><s:property value="id"/></td> <td><s:property value="number" /></td> <td><s:property value="name"/></td> <td><img class="img-polaroid" alt="40*40" width="15%" src='<s:url value="/upload/%{path}" />' /></td> <td><s:property value="price" /></td> <td><s:property value="link" /></td> <td><s:date name="createDate" /></td> <td><s:date name="reworkDate" /></td> <td><s:if test="#state == 1"> 有效</s:if><s:else>無效</s:else></td> </tr> </s:iterator> </tbody> </table> </s:form> <s:set value="page" var="curr" /><!--起始頁 --> <s:set value="totalPage" var="countPage"/><!-- 頁碼總數 --> <div class="pagination pagination-centered"> <ul> <li><a href="commodity_list?page=1">首頁 </a></li> <li><a href='<s:if test="#curr > 1">commodity_list?page=<s:property value="#curr - 1" /></s:if><s:else>#</s:else>'>上一頁 </a></li> <s:bean name="org.apache.struts2.util.Counter" id="counter"> <s:param name="first" value="startNum" /> <s:param name="last" value="endNum" /> <s:iterator> <li><a href='commodity_list?page=<s:property/>'><s:property/></a><li> </s:iterator> </s:bean> <li><a href='<s:if test="#curr < #countPage">commodity_list?page=<s:property value="#curr + 1" /></s:if><s:else>#</s:else>'>下一頁 </a></li> <li><a href='commodity_list?page=<s:property value="#countPage" />'>尾頁</a></li> </ul> </div> </div> </div> </div> <script src="bootstrap/js/jquery-1.10.1.min.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#rew").click(function(){ $("form").attr("action","commodity_addui"); $("form").submit(); }); $("#del").click(function(){ $("form").attr("action","commodity_del"); $("form").submit(); }); }); function getcommoditys(ele){ var csss = $(ele).val(); if(csss != 0){ $.ajax({ url:"getcommoditys", data:{'ccsid':csss}, success:function(data) { $("#show").empty(); for(var i=0; i<data.selectcs.length; i++) { $("#show").append("<tr><td>"+ data.selectcs[i].id+"</td><td>"+ data.selectcs[i].number+"</td><td>"+ data.selectcs[i].name+"</td><td>"+ '<img class="img-polaroid" alt="40*40" width="15%" src="upload/'+data.selectcs[i].path+'"'+'</td><td>'+ data.selectcs[i].price+"</td><td>"+ data.selectcs[i].link+"</td><td>"+ data.selectcs[i].createDate+"</td><td>"+ data.selectcs[i].reworkDate+"</td><td>"+ data.selectcs[i].state+"</td></tr>"); } }, error:function(xhr){alert('出錯。。\n'+xhr.responseText);} }); }; }; </script> </body> </html>
商品添加視圖:commodityinfo.jsp↓
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> <s:set value="upcommodity" var="c" /> <!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"> <title>commodity info</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> <style type="text/css"> table td,th{word-break: keep-all;white-space:nowrap;} </style> </head> <body> <div class="contaniner-fluid"> <div class="row-fluid"> <s:form class="form-horizontal" theme="simple"> <div class="span6"> <!----> <input type="hidden" id="myf"/> <input type="hidden" id="met"/> <input type="hidden" name="commodity.id" value="%{#c.id}" /> <h4 class="brand"><s:if test="#c.id != unll ">修改商品</s:if><s:else>添加商品</s:else></h4> <div class="btn-CommodityClass_Entity" > <a href="commodity_list" class="btn">返回</a> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >商品ID <s:textfield placeholder="商品ID" name="commodity.number" value="%{#c.number}"/> </label> </div> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >商品名稱 <s:textfield placeholder="商品名稱" name="commodity.name" value="%{#c.name}" /> </label> </div> </div> <div class="control-group"> <label class="control-label" for="text03">商品圖片</label> <div class="controls"> <img class="img-polaroid" alt="160x120" width="30%" src='<s:url value="/upload/%{#c.path} "/>' /> <s:file class="input-file" placeholder="圖片地址" size="100" name="pic" value=""/> </div> </div> <div class="control-group"> <label class="control-label" for="text04">商品價格</label> <div class="controls"> <s:textfield placeholder="商品價格" name="commodity.price" value="%{#c.price}"/> </div> </div> <div class="control-group"> <label class="control-label" for="text05">商品鏈接</label> <div class="controls"> <s:textfield placeholder="商品鏈接" size="100" name="commodity.link" value="%{#c.link}" /> </div> </div> <div class="control-group"> <div class="controls"> <label class="control-label" >狀態 <s:select name="commodity.state" list="#{'1':'有效','2':'無效'}" headerKey="0" headerValue="請選擇" value='%{#c.state}'/> </label> </div> </div> <div class="control-group"> <div class="controls"> <button <s:if test="#c.id != null">id="rew"</s:if><s:else>id="add"</s:else> class="btn"> <s:if test="#c.id != null">修改</s:if><s:else>添加</s:else> </button> </div> </div> </div> <div class="span6"> <!----> <h4>商品分類</h4> <div class="container-fluid" > <table class="table table-bordered table-striped" > <thead> <tr> <th>選擇</th> <th>商品分類</th> <th>商品</th> </tr> </thead> <tbody> <s:iterator value="addCommodityclasss" id="co"> <tr> <td><s:radio list="%{#{id:id}}" name="commodity.commodityclass.id" value="%{#c.commodityclass.id}" /> </td> <td><s:property value="name" /></td> <td> <ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <img data-src="holder.js/160x120" alt="160x120" src='<s:url value="/upload/%{path} "/>'/> </div> </li> </ul> </td> </tr> <s:iterator value="#co.getaLists()" id="ct"> <tr> <td><s:radio list="%{#{id:id}}" name="commodity.commodityclass.id" value="%{#c.commodityclass.id}" /> </td> <td><s:property value="name" /></td> <td> <ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <img data-src="holder.js/160x120" alt="160x120" src='<s:url value="/upload/%{path} "/>'/> </div> </li> </ul> </td> </tr> <s:iterator value="#ct.getaLists()" id="cf"> <tr> <td><s:radio list="%{#{id:id}}" name="commodity.commodityclass.id" value="%{#c.commodityclass.id}" /> </td> <td><s:property value="name" /></td> <td> <ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <img data-src="holder.js/160x120" alt="160x120" src='<s:url value="/upload/%{path} "/>'/> </div> </li> </ul> </td> </tr> <s:iterator value="#cf.getaLists()" > <tr> <td><s:radio list="%{#{id:id}}" name="commodity.commodityclass.id" value="%{#c.commodityclass.id}" /> </td> <td><s:property value="name" /></td> <td> <ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <img data-src="holder.js/160x120" alt="160x120" src='<s:url value="/upload/%{path} "/>'/> </div> </li> </ul> </td> </tr> </s:iterator> </s:iterator> </s:iterator> </s:iterator> </tbody> </table> </div> </div> </s:form> </div> </div> <script src="bootstrap/js/jquery-1.10.1.min.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#add").click(function(){ $("form").attr("action","commodity_add"); $("form").attr("enctype","multipart/form-data"); $("form").submit(); }) $("#rew").click(function(){ $("form").attr("action","commodity_up"); $("form").attr("enctype","multipart/form-data"); $("form").submit(); }) }); </script> </body> </html>
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。