]> git.mxchange.org Git - pizzaservice-war.git/blob - web/form_handler/admin/do_category.jsp
Continued with project:
[pizzaservice-war.git] / web / form_handler / admin / do_category.jsp
1 <%-- 
2         Document   : order
3         Created on : 07.08.2015, 14:58:21
4         Author     : Roland Haeder
5 --%>
6
7 <%--<%@page errorPage="errorHandler.jsp" %>--%>
8 <%@page contentType="text/html" pageEncoding="UTF-8"%>
9 <%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
10 <%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
11 <%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %>
12 <%@page import="org.mxchange.pizzaapplication.product.Product"%>
13 <%@page import="org.mxchange.pizzaapplication.exceptions.CategoryTitleAlreadyUsedException"%>
14
15 <%
16         // Init application instance
17         PizzaApplication app = PizzaServiceApplication.getInstance(application);
18
19         // Is it post?
20         if ("POST".equals(request.getMethod())) { //NOI18N
21                 // Is "add/edit/delete" set?
22                 if (request.getParameter("add") != null) { //NOI18N
23                         // Add new category
24                         try {
25                                 app.doAdminAddCategory(request);
26                         } catch (final CategoryTitleAlreadyUsedException e) {
27                                 // Already used!
28                                 response.sendRedirect(request.getContextPath() + "/admin/category.jsp?already=1"); //NOI18N
29                         }
30                 } else if (request.getParameter("edit") != null) { //NOI18N
31                         // @TODO
32                 } else if (request.getParameter("delete") != null) { //NOI18N
33                         // @TODO
34                 }
35
36                 // Redirect to proper URL
37                 // @TODO Commented out for developing:
38                 //response.sendRedirect(request.getContextPath() + "/finished.jsp");
39         }
40 %>
41
42 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
43 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
44         <head>
45                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
46                 <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
47                 <title><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</title>
48         </head>
49
50         <body>
51                 <div id="title">
52                         <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</h1>
53                 </div>
54
55                 <jsp:include page="/static/admin/menu.jsp" flush="true" />
56
57                 <div id="content_outer">
58                         <div id="content_title">
59                                 <h2>Bitte nicht direkt aufrufen:</h2>
60                         </div>
61
62                         <div id="content">
63                                 Bitte rufen Sie diese Seite nicht direkt auf.
64                         </div>
65                 </div>
66         </body>
67 </html>