protected void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
		String table;
		try {
			List<Category> categories = (List<Category>)CategoryDAO.list();
			req.setAttribute("categories", categories);
			String rows = req.getParameter("rows");
			String cat = req.getParameter("category");
			String states = req.getParameter("state");
			
			if (rows == null || rows.equals("customers"))
				rows = "users.name";
			else if (rows.equals("states"))
				rows = "users.state";
			else {
				res.sendRedirect("products");
				return;
			}
			
			table = SaleDAO.listProducts(rows, cat, states);
			
			req.setAttribute("table", table);
			req.setAttribute("rows", rows);
			req.setAttribute("cat", cat);
			req.getRequestDispatcher("analytics.jsp").forward(req, res);
		} catch (SQLException e) {
			e.printStackTrace();
			res.sendRedirect("products");
		}
	}