--- /dev/null
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.pizzaapplication.database.category;
+
+/**
+ * Holder class for database columns for product frontend
+ *
+ * @author Roland Haeder
+ */
+public final class PizzaCategoryDatabaseConstants {
+ /**
+ * Column name for "id"
+ */
+ public static final String COLUMN_ID = "id";
+
+ /**
+ * Column name for "parent"
+ */
+ public static final String COLUMN_PARENT = "parent";
+
+ /**
+ * Column name for "title"
+ */
+ public static final String COLUMN_TITLE = "title";
+
+ /**
+ * No instance from this class
+ */
+ private PizzaCategoryDatabaseConstants () {
+ }
+}
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--<%@page errorPage="errorHandler.jsp" %>--%>
<%@page import="org.mxchange.pizzaapplication.category.Category"%>
+<%@page import="org.mxchange.pizzaapplication.database.category.PizzaCategoryDatabaseConstants"%>
<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<thead class="table_header">
<tr>
<th class="table_header_column">
- Produktname: (Schlüssel)
+ Auswählen:
</th>
<th class="table_header_column">
- Produktbezeichnung:
+ Bezeichnung:
</th>
<th class="table_header_column">
- Einzelpreis:
+ Elternkategorie:
</th>
</tr>
</thead>
<c:forEach var="category" items="<%=app.getCategories()%>">
<tr>
<td>
- ${category.getId()}
+ <input type="checkbox" name="<%=PizzaCategoryDatabaseConstants.COLUMN_ID%>[${category.getId()}]" value="1" />
</td>
<td>
${category.getTitle()}
</td>
<td>
- ${category.getPrice()}
+ ${category.getPrintableParent()}
</td>
</tr>
</c:forEach>
<div class="data_row">
<div class="table_left">
- Produktbezeichnung:
- <div class="tiny">(z.B. <em>Pizza Italia</em>)</div>
+ Bezeichnung:
+ <div class="tiny">(z.B. <em>Pizzen</em>)</div>
</div>
<div class="table_right">
- <input type="text" name="title" size="10" maxlength="255" />
+ <input type="text" name="<%=PizzaCategoryDatabaseConstants.COLUMN_TITLE%>" size="10" maxlength="255" />
</div>
<div class="clear"></div>
<div class="data_row">
<div class="table_left">
- Einzelpreis:
- <div class="tiny">(z.B. <em>50.0</em>)</div>
+ Elternkategorie:
</div>
<div class="table_right">
- <input type="text" name="price" size="10" maxlength="255" />
+ <select name="<%=PizzaCategoryDatabaseConstants.COLUMN_PARENT%>" size="1">
+ <option value="">Ist oberste Kategorie</option>
+ </select>
</div>
<div class="clear"></div>
--- /dev/null
+<%--
+ Document : order
+ Created on : 07.08.2015, 14:58:21
+ Author : Roland Haeder
+--%>
+
+<%--<%@page errorPage="errorHandler.jsp" %>--%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
+<%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %>
+<%@page import="org.mxchange.pizzaapplication.product.Product"%>
+
+<%
+ // Init application instance
+ PizzaApplication app = PizzaServiceApplication.getInstance(application);
+
+ // Is it post?
+ if ("POST".equals(request.getMethod())) { //NOI18N
+ // Is "add/edit/delete" set?
+ if (request.getAttribute("add") != null) { //NOI18N
+ // Add new category
+ app.doAdminAddCategory(request);
+ } else if (request.getAttribute("edit") != null) { //NOI18N
+ // @TODO
+ } else if (request.getAttribute("delete") != null) { //NOI18N
+ // @TODO
+ }
+
+ // Redirect to proper URL
+ // @TODO Commented out for developing:
+ //response.sendRedirect(request.getContextPath() + "/finished.jsp");
+ }
+%>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
+ <title><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</title>
+ </head>
+
+ <body>
+ <div id="title">
+ <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</h1>
+ </div>
+
+ <jsp:include page="/static/admin/menu.jsp" flush="true" />
+
+ <div id="content_outer">
+ <div id="content_title">
+ <h2>Bitte nicht direkt aufrufen:</h2>
+ </div>
+
+ <div id="content">
+ Bitte rufen Sie diese Seite nicht direkt auf.
+ </div>
+ </div>
+ </body>
+</html>
--- /dev/null
+<%--
+ Document : order
+ Created on : 07.08.2015, 14:58:21
+ Author : Roland Haeder
+--%>
+
+<%--<%@page errorPage="errorHandler.jsp" %>--%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
+<%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %>
+<%@page import="org.mxchange.pizzaapplication.product.Product"%>
+
+<%
+ // Init application instance
+ PizzaApplication app = PizzaServiceApplication.getInstance(application);
+
+ // Is it post?
+ if ("POST".equals(request.getMethod())) { //NOI18N
+ // Is "add/edit/delete" set?
+ if (request.getAttribute("add") != null) { //NOI18N
+ // Add new product
+ app.doAdminAddProduct(request);
+ } else if (request.getAttribute("edit") != null) { //NOI18N
+ // @TODO
+ } else if (request.getAttribute("delete") != null) { //NOI18N
+ // @TODO
+ }
+
+ // Redirect to proper URL
+ // @TODO Commented out for developing:
+ //response.sendRedirect(request.getContextPath() + "/finished.jsp");
+ }
+%>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
+ <title><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</title>
+ </head>
+
+ <body>
+ <div id="title">
+ <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</h1>
+ </div>
+
+ <jsp:include page="/static/admin/menu.jsp" flush="true" />
+
+ <div id="content_outer">
+ <div id="content_title">
+ <h2>Bitte nicht direkt aufrufen:</h2>
+ </div>
+
+ <div id="content">
+ Bitte rufen Sie diese Seite nicht direkt auf.
+ </div>
+ </div>
+ </body>
+</html>
// Is it post?
if ("POST".equals(request.getMethod())) { //NOI18N
// @TODO Handle saving customer data and such things
-
+
// Mark all choosen products as ordered
app.markAllChoosenProductsAsOrdered(request, session);