Package Java

Examples of Java.Shoppingcart


      out.write("        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
      out.write("        <title>Winkelwagen</title>\n");
      out.write("        <script src=\"include/jquery-1.9.1.min.js\"></script>\n");
      out.write("        <link href=\"css/main.css\" rel=\"stylesheet\" />\n");
      out.write("        ");
  Shoppingcart cart = null;
            String username = (String)session.getAttribute("username");
            if(username == null || !DatabaseKoppeling.checkUsername(username)) {
                response.sendRedirect("loguit.jsp");
            }
       
      out.write("\n");
      out.write("            \n");
      out.write("        ");

            String currencyparam = (String) request.getParameter("value");
            String currency = (String)session.getAttribute("cur");
            if(currencyparam != null) {
                currency = currencyparam;
                session.setAttribute("cur", currency);
            }
            String curCurrency;
            if("usd".equals(currency))
            {
                currency = "USD";
                session.setAttribute("currentCurrency", currency);
                curCurrency = "USD";
            }
            else
            {
                currency = "EUR";
                session.setAttribute("currentCurrency", currency);
                curCurrency = "EUR";
            }
       
      out.write("\n");
      out.write("        <style>\n");
      out.write("            table#shoppingcart {\n");
      out.write("                width:100%;\n");
      out.write("            }\n");
      out.write("            \n");
      out.write("            #shoppingcart th {\n");
      out.write("                border-bottom:2px solid gray;\n");
      out.write("            }\n");
      out.write("            \n");
      out.write("            #shoppingcart tr td {\n");
      out.write("                border-bottom: 1px solid gray;\n");
      out.write("            }\n");
      out.write("            \n");
      out.write("            a.menu {\n");
      out.write("                float:right; \n");
      out.write("                border:2px white; \n");
      out.write("                background: none;\n");
      out.write("            }\n");
      out.write("\n");
      out.write("            a.menu img {\n");
      out.write("                padding-left: 10px;\n");
      out.write("            }\n");
      out.write("\n");
      out.write("            a.menu:hover {\n");
      out.write("                margin-top: -10px;\n");
      out.write("                padding: 10px;\n");
      out.write("                background: black;\n");
      out.write("            }\n");
      out.write("            span.menubutton {\n");
      out.write("                display: none;\n");
      out.write("            }\n");
      out.write("        </style>\n");
      out.write("        \n");
      out.write("        <script>\n");
      out.write("            function showusermenu() {\n");
      out.write("                $(\".menubutton\").css(\"display\", \"block\");\n");
      out.write("            }\n");
      out.write("            \n");
      out.write("            function hideusermenu() {\n");
      out.write("                $(\".menubutton\").css(\"display\", \"none\");\n");
      out.write("            }\n");
      out.write("        </script>\n");
      out.write("    </head>\n");
      out.write("    <body>\n");
      out.write("        <div id=\"header\">\n");
      out.write("            <a href=\"index.jsp\">Startpagina</a>\n");
      out.write("            <a href=\"mainpage.jsp\">Home</a> \n");
      out.write("            <a href=\"c_shoppingcart.jsp\" style=\"color:#ffffff;\">Winkelwagen</a>\n");
      out.write("            <a href=\"c_orders.jsp\">Bestellingen</a>\n");
      out.write("            <a style='float:right; margin-right: 22%; text-align: right;' class=\"unselectable menu\" \n");
      out.write("               onmouseover=\"Javascript:showusermenu();\"\n");
      out.write("               onmouseout='Javascript:hideusermenu();'>");
      out.print(username);
      out.write("<br>\n");
      out.write("                <span onclick=\"Javascript:location.href='ServletChangeType?newtype=Photographer';\" class=\"menubutton\">\n");
      out.write("                    Photographer\n");
      out.write("                </span>\n");
      out.write("                <span onclick=\"Javascript:location.href='loguit.jsp';\" class=\"menubutton\">Log uit</span>\n");
      out.write("            </a>\n");
      out.write("            <a id=\"cur_eur\" href=\"c_shoppingcart.jsp?value=eur\" style=\"float:right;\">€</a>\n");
      out.write("            <a id=\"cur_dol\" href=\"c_shoppingcart.jsp?value=usd\" style=\"float:right;\">$</a>\n");
      out.write("        </div>\n");
      out.write("        <div id=\"content\">\n");
      out.write("            <br>\n");
      out.write("            <h1>Winkelwagen</h1>         \n");
      out.write("            \n");
      out.write("                <form action=\"ServletUpdateCookie\" method=\"post\">\n");
      out.write("                <table id =\"shoppingcart\">\n");
      out.write("                    <tr>\n");
      out.write("                        <th>Foto Nummer</th>\n");
      out.write("                        <th>Product</th>\n");
      out.write("                        <th>Kleur</th>\n");
      out.write("                        <th>Stukprijs</th>\n");
      out.write("                        <th>Aantal</th>\n");
      out.write("                        <th>Prijs</th>\n");
      out.write("                        <th>Verwijderen</th>\n");
      out.write("                    </tr>\n");
      out.write("                    ");

                    cart = new Shoppingcart();
                    Cookie[] cookies = request.getCookies();
                    if (cookies != null) {
                        for (Cookie c : cookies) {
                            if (c.getName().equals("SHOPPINGCART")) {
                                    cart = new Shoppingcart(c.getValue());
                                    break;
                            }
                        }
                    }
                    cart.sort();
                    String curSymbol = "€";
                    double totalprice = 0.0;
                    session.setAttribute("carttoupdate", cart);
                    for (int i = 0; i < cart.size(); i++) {
                        ShoppingcartItem item = cart.get(i);
                        int amount = item.getAmount();
                        String photo = item.getPhoto();
                        double price = 0.00;
                        if("USD".equals(curCurrency))
                        {
View Full Code Here


      out.write("        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
      out.write("        <title>Winkelwagen</title>\n");
      out.write("        <script src=\"include/jquery-1.9.1.min.js\"></script>\n");
      out.write("        <link href=\"css/main.css\" rel=\"stylesheet\" />\n");
      out.write("        ");
  Shoppingcart cart = null;
            String username = (String)session.getAttribute("username");
            if(username == null || !DatabaseKoppeling.checkUsername(username)) {
                response.sendRedirect("loguit.jsp");
            }
       
View Full Code Here

TOP

Related Classes of Java.Shoppingcart

Copyright © 2015 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.