<%@ page import="ro.emid.common.constants.AppConstants" %>
<%@ page import="ro.emid.Application" %>
<%@ page import="ro.emid.lib.model.Maifi" %>
<%@ page import="java.util.ArrayList" %>


<%@include file="declaratii.jsp"%>

<%
	Maifi[] list = (Maifi[])request.getAttribute("maifiList");

	
%>

<table border=0 cellpading=0 cellspacing=0 width="100%">
    <tr>
        <td>
            <%@ include file="../header-localizare.jsp"%> <span class="slash">/</span> MAIFI
        </td>
        <td align="RIGHT" style="padding-right: 10px">
            <span style="font-size: 12px;">Mergi la:</span>
            <A title="Lista incidente" href="<%=AppConstants.APP_NAME%>?action=showIncidente" class="link">Incidente</A>&nbsp;
			<A title="Lista echipamente" href="<%=AppConstants.APP_NAME%>?action=showEchipamente" class="link">Echipamente</A>&nbsp;
			<b>MAIFI</b>

            <A onclick="showFiltruEchipamente(); return false;" title="Click pentru a configura filtru Echipamente" href="javascript: void(null)" class="link">Filtru</A>&nbsp;
        </td>
    </tr>
</table>

<table border="0" cellpadding="2" cellspacing="1" width="100%" class="table">
	<thead>
		<tr>
			<td colspan="2">Eveniment accidental:</td>
			<td>Autor:</td>
			<td>Modificat:</td>
			<td>Data producerii:</td>
			<td style="width:12%;">Operatie:</td>
		</tr>
	</thead>
	
	<tbody>
		<% for(int i = 0; i < list.length; i++) {
			Maifi mf = list[i];
		%>
			<tr>
				<td align="center" width="15" title="Numar Fisa Eveniment accidental"><%=mf.getNumar()%></td>
				<td><%=mf.getDenInstalatie()%></td>
				<td><%=mf.getUserInsert()%></td>
				<td id="userUpdate"><%=mf.getUserUpdate()%></td>
				<td><%=mf.getDataProducere()%></td>
				<td>
					<a href="<%=AppConstants.APP_NAME%>?action=editMaifi&id=<%=mf.getId()%>">Modifica</a>&nbsp;&nbsp;
					<a href="javascript:">Printeaza</a>&nbsp;&nbsp;
					<a href="<%=AppConstants.APP_NAME%>?action=deleteMaifi&id=<%=mf.getId()%>">Sterge</a>
				</td>
			</tr>
		<%}%>
	</tbody>
	<tfoot>
		<tr>
			<td colspan="7">
				&nbsp;
				<a class="btn" href="<%=AppConstants.APP_NAME%>?action=editMaifi">Adaugă Maifi</a>
			</td>
		</tr>
	</tfoot>
</table>

<script type="text/javascript">
jQuery(function($) {
	$('td#userUpdate').each(function(i, elm) {
		var text = $(this).html();
		if(text == 'null') {
			$(this).html("");
		}
	});
});
</script>