<%
/******************************************************************************
 * Copyright (c) 2000-2005 e-Deal
 *
 * e-Deal S.A.
 * 55 rue Brillat Savarin
 * 75013 Paris
 * France
 *
 * T: +33 (0)1 53 80 80 30
 * F: +33 (0)1 73 01 69 77
 * http://www.e-deal.com
 * 
 * La diffusion de ce code source sous quelque forme que ce soit sans
 * l'autorisation de E-DEAL est interdite.
 *
 * Vous êtes autorisés à modifier ce code source uniquement pour votre usage
 * propre et sous réserve que les mentions de copyright demeurent intactes.
 *
 * Ce code est fourni en l'état. Aucune garantie d'aucune sorte, explicite ou
 * implicite n'est donnée. En aucun cas E-DEAL ne pourra être tenu pour
 * responsable des dommages pouvant résulter de l'utilisation de ce code
 * source.
 ******************************************************************************/
%><%@page session="true" contentType="text/plain;charset=UTF-8" import="com.edeal.frontline.*"%>
<%@ page import="com.edeal.frontline.navigation.FlRequest" %>
<%@ page import="java.util.*" %>
<%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %>

<head>

</head>

<%
	final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass());
	FlRequest flRequest = new FlRequest(request);
	
	
	//Two vector used to list actor
	Vector objs = (Vector) request.getAttribute("objs");
		if (objs == null) objs = new Vector();
	Vector vectCol = (Vector) request.getAttribute("vectCol");
		if (vectCol ==null) vectCol = new Vector();
	StringBuffer buf = new StringBuffer();
	
	DataDictionary dico = flRequest.getContext().getDataDictionary();
	java.text.DecimalFormat df = FlLocale.getInstance(session).getDecimalFormat("#,##0");
	
%>
<table class="container">												
	<tr>
		<td style="width: 1%;" class="headerDataGrid"><a href="javascript:viewCalendars();"><img src="<fl:webapp/>/icons/ico/zoom.gif"></a></td>
		<td style="width: 20%;" class="headerDataGrid">&nbsp;&nbsp;&nbsp;<fl:getMessage code="F2025" alt="Nom"/>
		</td>
		<td style="width: 10%;" class="headerDataGrid"><fl:getMessage code="F206F" alt="Etat"/>
		</td>
		<td style="width: 10%;" class="headerDataGrid"><fl:getMessage code="F1058" alt="Total"/>
		</td>
<%
for(int i = 0; i < vectCol.size(); i++) {
	Hashtable obj = (Hashtable)vectCol.elementAt(i);
%>
		<td style="width: 10%;" class="headerDataGrid"><%= Utils.formatToWeb(obj.get("ColLbl"), false) %></td><%
} %>
	</tr><%
boolean isBlue = true;
int actIDIdx = 0;
for(int i = 0; i < objs.size(); i++) {
	Hashtable obj = (Hashtable)objs.elementAt(i);
	String name = "";
	if(obj.get("ActCivID") != null) name = (String)dico.getRefDisp(session, "ActCivID", (String)obj.get("ActCivID"));
	if(obj.get("ActFstName") != null) name += " " + (String)obj.get("ActFstName");
	if(obj.get("ActName") != null) name += " " + (String)obj.get("ActName");
	if(name.trim().length() == 0) {
		name = (String)obj.get("ActMail");
	}
			
%>
	<tr class="<%= isBlue ? "tabSimpleFdBleu":"tabSimpleFdBlanc" %>">
		<td style="width: 1%; text-align: center;"><input type="checkbox" name="pActID<%= actIDIdx++ %>" value="<%=(String)obj.get("ActID")%>"></input></td>
		<td style="width: 20%;">
			<a href="javascript:doSelect('<%= (String)obj.get("ActID") %>')"><%= Utils.formatToWeb(name, false) %></a>
		</td>
		<td style="width: 10%;"><%= obj.get("ActStaID") == null ? "indisponible" : (String)dico.getRefDisp(session, "ActStaID", (String)obj.get("ActStaID")) %></td>
		<td style="width: 10%; text-align: right;"><%= df.format(obj.get("NcoTotal")) %></td>
		<td style="width: 10%; text-align: right;"><%= df.format(obj.get("NcoVal")) %></td><%
for(int j = 1;j < vectCol.size(); j++) {
	obj = (Hashtable)objs.elementAt(++i); %>
		<td style="width: 10%; text-align: right;"><%= df.format(obj.get("NcoVal")) %></td><%
} %>
	</tr><%
	isBlue = !isBlue ;
} %>
</table>
