<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="model.ConnectDb"%>
<%@page import="model.SanPham"%>
<%@page import="model.ThongTinSanPham"%>
   
<%

int records = new SanPham().recordsnumber();
List<ThongTinSanPham> sanpham= null;
if (records < 9 && records >= 0){
sanpham = new SanPham().getAll(9,0);} else {
sanpham = new SanPham().getAll(9,records-9); }
%>
<html> 
<head>
<title>TOP 10 Hinh Anh</title>
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
<style type="text/css">
.slideshow { height: 187px; width: 185px; margin: auto }
.slideshow img { padding: 1px; border: 1px dashed pink; background-color: #eee; }
</style>


<!-- include Cycle plugin -->
<script type="text/javascript" src="js/jquery.cycle.all.2.74.js"></script>

<!--  initialize the slideshow when the DOM is ready -->
<script type="text/javascript">
$(document).ready(function() {
    $('.slideshow').cycle({
		fx:     'scrollUp', 
        random:  1  // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
});
</script>
</head>
<body>
<% if (sanpham.size() == 0){ %><div align="Center"><b>Chưa Đủ Sản Phẩm Để Hiển Thị</b></div><%} else { %>
<% if (records==0){ %> Chưa có sản phẩm <% } else { %>
	<div class="slideshow">
<% for(int i  = sanpham.size() - 1; i >= 0; i--) {  %>
<a href="ProductId?id=<%= sanpham.get(i).getId() %>"><img src="<%= sanpham.get(i).getImage() %>" width="180" height="180" /></a>
 <%}}}%>
	</div>

</body>
</html>
