<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="admin.model.SupportInfo"%>
<% 
List<SupportInfo> spi = (List<SupportInfo>) request.getAttribute("spi");
if( spi == null){
%>
<% } else { %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel=stylesheet href='images/style.css' type=text/css>
<title>Ho Tro Online</title>
<script src="js/CheckChoice.js" type="text/javascript" charset="utf-8"></script>
<script src="js/DelChoiced.js" type="text/javascript" charset="utf-8"></script>
<Script>
function delall(){
if(confirm('Bạn thực sự muốn xóa Toàn Bộ Hỗ Trợ ?'))
{return true;}
else {return false;}
}
function del(){
	if(confirm('Bạn Thực Sự Muốn Xóa Hỗ Trợ Này ?'))
	{return true;}
	else {return false;}
	}
document.title="Hỗ Trợ"; 
document.getElementById("titleMod").innerHTML = "Hỗ Trợ";
</script>
</head>
<body>
<% if (spi.size() == 0) {%>
<div align="Center" style="border:1px solid #cfcfcf;padding:20px 10px 20px 10px;background-color:#f3f3f3; width:320px "><b>Chưa có hỗ trợ nào</b></div>
<% } else { %>
<p>
<table class="tablext" border="1" cellspacing="0" style="border-collapse: collapse" bordercolor="silver" cellpadding="3">
    <tr>
    	<th style="background: #E3E3E3"><input class="UniXT" id ="checkAll" onclick = "return checkHow();" type="checkbox" /></th>
        <th style="background: #E3E3E3">STT</th>
		<th style="background: #E3E3E3">Yahoo</th>
        <th style="background: #E3E3E3">Tên</th>
		<th style="background: #E3E3E3">Phone</th>
        <th style="background: #E3E3E3">Chỉnh Sửa</th>
        <th style="background: #E3E3E3">Xóa</th>
    </tr>
    
<% for(int i  = spi.size()-1; i >=0 ; i--) { %>
        <tr align="center">
        	<td><input class="UniXT" onclick = "return checkIsAll();" name= "idchoiced<%= spi.size() - i %>" id= "lxt<%= spi.size() - i %>" type="checkbox" value = "<%= spi.get(i).getId() %>"/></td>
            <td><%= spi.size()- i %></td>
            <td><%= spi.get(i).getYahoo() %></td>
			<td><%= spi.get(i).getName() %></td>
            <td><%= spi.get(i).getPhone() %></td>
            <td>    
            <a href="../Support?rep=edit&id=<%=  spi.get(i).getId() %>"><img border="0" src="images/edit.png" width="25" height="25" title="Chỉnh Sửa"></a></td>  
			<td>
			<a onclick = "return del();" href="../Support?rep=delid&id=<%=  spi.get(i).getId() %>"><img border="0" src="images/discard.jpg" width="25" height="25" title="Xóa"></a></td>
        </tr>  
        <% } %>
        
        <tr><td colspan="7" valign="baseline" align="right">
        <Br>
<form method="post" action="../Support" onsubmit="return delall();">
<input type="hidden" name="rep" value="delall">
	<input onclick="return deleteIDChoiced('Support', '1');" class ="UniXT" type="button" value = "Xóa chọn"/>
	<input type="submit" class="UniXT" value="Xóa toàn bộ"/>
	</form></td></tr>		
    </table>  
    <br>
</body>
<% }} %>
</html>