<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="java.util.List"%>
<%@page import="model.ConnectDb"%>
<%@page import="model.SanPham"%>
<%@page import="model.ThongTinSanPham"%>
<%@page import="java.text.Normalizer"%>
<%@page import="java.text.Normalizer.Form"%>
<% 
List<ThongTinSanPham> sanpham = new SanPham().category();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel=stylesheet href='highslide/highslide.css' type=text/css>
<script type="text/javascript" src="highslide/highslide.js"></script>
<title>The Loai</title>
</head>
<body>
<% if (sanpham.size()==0){ %><p><Br><Br><img border="0" src="images/download.gif" width="15" height="9"> <b>Chưa Có Danh Mục Nào</b> <% } else { %>
<br>
<img  src="images/download.gif" width="15" height="9"><a href="index.jsp?main=newproduct"> Sản Phẩm Mới Nhất</a><br>
<img  src="images/download.gif" width="15" height="9"><a href="getAllProduct?rep=show"> Toàn Bộ Sản Phẩm</a><br>
<img  src="images/download.gif" width="15" height="9"><a href="getAllProduct?rep=byprice"> Giá Thấp Nhất</a><br>
<% for(int i  = 0; i < sanpham.size(); i++) { 

String cateshow = sanpham.get(i).getCategory().replaceAll("Đ", "D");
	cateshow = cateshow.replaceAll("đ", "d");
	cateshow =	Normalizer.normalize(cateshow, Form.NFD).replaceAll("[^\\p{ASCII}]", "");
	%>
<img  src="images/download.gif" width="15" height="9"><a href="ProductByCategory?category=<%= cateshow %>"> <%= sanpham.get(i).getCategory() %></a><br>  
  <%}} %>  
       <br>
</body>
</html>