/* Automatically generated.
 * Copyright (c) 2000-2006 by SAP AG, Walldorf.,
 * http://www.sap.com
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of SAP AG, Walldorf. You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms
 * of the license agreement you entered into with SAP.
 * Do not edit.
 */

import java.util.Date;
import ro.emid.common.utils.ObjectUtils;
import ro.emid.common.db.framework.ReportStatement;
import java.util.List;
import ro.emid.common.utils.pagination.PaginationController;
import ro.emid.common.db.AccessDB;
import ro.emid.common.utils.pagination.PaginationConstants;
import ro.emid.common.utils.sort.SortController;
import ro.emid.common.utils.sort.SortData;
import ro.emid.common.db.NomAccessDB;
import ro.emid.common.utils.StringUtils;
import java.io.File;
import java.util.Set;
import java.util.HashSet;
import ro.emid.common.db.CategoryAccessDB;
import ro.emid.incidente.util.RaportTop10InstalatiiFeExcelExporter;
import ro.emid.incidente.IncidenteSessionUtils;
import ro.emid.common.types.*;
import ro.emid.common.utils.pagination.PaginationData;
import ro.emid.common.constants.*;
import ro.emid.common.types.Category;
import ro.emid.incidente.IncidenteSessionUtils;
import ro.emid.common.utils.SessionUtils;
import ro.emid.common.types.User;
import ro.emid.common.constants.AppConstants;
import ro.emid.common.constants.RoleConstants;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public class JEE_jsp_WEB_2d_INF_pagelet_rapoarte_raport_2d_top10_2d_fe_1495030460161 extends com.sap.engine.services.servlets_jsp.lib.jspruntime.JspBase{
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(24,0);to=(27,2)]

    private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger("raportTop10Instalatii_jsp");
    private static final java.text.SimpleDateFormat _df = new java.text.SimpleDateFormat("yyyyMMdd");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(29,0);to=(42,2)]

    public static final int COD_ANS_LEA = 50;
    public static final int COD_ANS_LES = 51;

    private boolean exists(final String []arr, final String value){
        if( arr == null) return false;

        for (int i = 0; i < arr.length; i++) {
            if( arr[i] == null && value == null) return true;
            if( arr[i] != null && value != null && arr[i].equals( value)) return true;
        }
        return false;
    }
// end

	public void _jspService(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
	{
		//isXml=false
		JspFactory  _jspFactory     = JspFactory.getDefaultFactory();
		PageContext pageContext = _jspFactory.getPageContext(this,request,response,null,true,32768,true);
		ServletConfig config = pageContext.getServletConfig();
		ServletContext application = pageContext.getServletContext();
		com.sap.engine.services.servlets_jsp.lib.jspruntime.PageContextImpl _jspx_pageContext = (com.sap.engine.services.servlets_jsp.lib.jspruntime.PageContextImpl) pageContext;
		com.sap.engine.services.servlets_jsp.server.application.InjectionWrapper _jspx_resourceInjector = ((com.sap.engine.services.servlets_jsp.server.application.ServletContextImpl)_jspx_pageContext.getServletContext()).getApplicationContext().getInjectionWrapper();
		HttpSession session = pageContext.getSession();
		if (!response.isCommitted()) {
		response.setContentType("text/html;charset=UTF-8");
		}
		JspWriter   out     = pageContext.getOut();
		java.lang.Object page = this;
		try {
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(1,35);to=(2,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(2,53);to=(3,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(3,64);to=(4,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(4,35);to=(5,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(5,73);to=(6,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(6,47);to=(7,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(7,72);to=(8,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(8,61);to=(9,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(9,55);to=(10,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(10,50);to=(11,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(11,53);to=(12,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(12,33);to=(13,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(13,34);to=(14,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(14,38);to=(15,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(15,55);to=(16,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(16,80);to=(17,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(17,60);to=(18,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(18,43);to=(19,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(19,67);to=(20,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(20,47);to=(22,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/declaratii.jsp";from=(1,50);to=(2,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/declaratii.jsp";from=(2,60);to=(3,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/declaratii.jsp";from=(3,54);to=(4,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/declaratii.jsp";from=(4,46);to=(5,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/declaratii.jsp";from=(5,58);to=(6,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/declaratii.jsp";from=(6,50);to=(8,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/declaratii.jsp";from=(8,0);to=(34,2)]
			
    final boolean printVersion = request.getParameter("printVersion") != null && "true".equals( request.getParameter("printVersion")) || request.getAttribute("printVersion") != null && "true".equals( request.getAttribute("printVersion")) ;

    final User user = SessionUtils.getUserLogat(session);

    Category filiala = IncidenteSessionUtils.getFiliala(session);
    if(filiala == null){
        filiala = new Category();
    }

    Category sucursala = IncidenteSessionUtils.getSucursala(session);
    if(sucursala == null){
        sucursala = new Category();
    }

    Category centruExploatare = IncidenteSessionUtils.getCentru(session);
    if(centruExploatare == null){
        centruExploatare = new Category();
    }

    Category formatiaDeLucru = IncidenteSessionUtils.getFormatia(session);
    if(formatiaDeLucru == null){
        formatiaDeLucru = new Category();
    }

    boolean isCuSectiiSiCentre = ((sucursala != null && sucursala.isCuSectiiSiCentre()) || (centruExploatare != null && centruExploatare.isCuSectiiSiCentre()));

// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(22,48);to=(24,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(27,2);to=(29,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(42,2);to=(48,12)]
			out.print("\r\n\r\n\r\n<TABLE border=0 cellPading=0 cellSpacing=0 width=\"100%\">\r\n    <TR>\r\n        <TD>\r\n            ");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(1,59);to=(2,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(2,0);to=(13,2)]
			
    if (user.getIeLevel() == RoleConstants.NIVEL_SUCURSALA) {
        filiala.setShowAsLink(false);
    } else if (user.getIeLevel() == RoleConstants.NIVEL_CENTRU) {
        filiala.setShowAsLink(false);
        sucursala.setShowAsLink(false);
    } else if (user.getIeLevel() == RoleConstants.NIVEL_FORMATIE) {
        filiala.setShowAsLink(false);
        sucursala.setShowAsLink(false);
        centruExploatare.setShowAsLink(false);
    }

// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(13,2);to=(16,0)]
			out.print("\n<span class=\"localizare\">\n<span class=\"bold\">E\u015fti aici:</span>\n");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(16,0);to=(17,34)]
			if (filiala != null && filiala.getId() != -1) {
    if( filiala.isShowAsLink()){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(17,34);to=(18,34)]
			out.print("\n        <a title=\"Lista sucursale ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(18,34);to=(18,56)]
			out.print(filiala.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(18,56);to=(18,77)]
			out.print("\" class=\"link\" href=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(18,77);to=(18,103)]
			out.print(AppConstants.APP_NAME);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(18,103);to=(18,126)]
			out.print("?action=showSucursale\">");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(18,126);to=(18,148)]
			out.print(filiala.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(18,148);to=(19,4)]
			out.print("</a>\n    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(19,4);to=(19,14)]
			}else{
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(19,14);to=(20,8)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(20,8);to=(20,30)]
			out.print(filiala.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(20,30);to=(21,4)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(21,4);to=(21,9)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(21,9);to=(23,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(23,0);to=(23,5)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(23,5);to=(24,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(24,0);to=(24,55)]
			if( sucursala != null && sucursala.getId() != -1){ 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(24,55);to=(26,4)]
			out.print("\n    <span class=\"slash\">/</span>\n    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(26,4);to=(26,38)]
			if( sucursala.isShowAsLink()){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(26,38);to=(27,29)]
			out.print("\n        <a title=\"Lista C.E. ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(27,29);to=(27,53)]
			out.print(sucursala.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(27,53);to=(27,74)]
			out.print("\" class=\"link\" href=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(27,74);to=(27,100)]
			out.print(AppConstants.APP_NAME);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(27,100);to=(27,120)]
			out.print("?action=showCentre\">");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(27,120);to=(27,144)]
			out.print(sucursala.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(27,144);to=(28,4)]
			out.print("</a>\n    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(28,4);to=(28,14)]
			}else{
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(28,14);to=(29,8)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(29,8);to=(29,32)]
			out.print(sucursala.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(29,32);to=(30,4)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(30,4);to=(30,9)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(30,9);to=(31,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(31,0);to=(31,5)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(31,5);to=(33,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(33,0);to=(33,68)]
			if( centruExploatare != null && centruExploatare.getId() != -1){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(33,68);to=(35,4)]
			out.print("\n    <span class=\"slash\">/</span>\n    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(35,4);to=(35,45)]
			if( centruExploatare.isShowAsLink()){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(35,45);to=(36,35)]
			out.print("\n        <a title=\"Lista evenimente ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(36,35);to=(36,66)]
			out.print(centruExploatare.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(36,66);to=(36,87)]
			out.print("\" class=\"link\" href=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(36,87);to=(36,113)]
			out.print(AppConstants.APP_NAME);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(36,113);to=(36,137)]
			out.print("?action=showEvenimente\">");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(36,137);to=(36,168)]
			out.print(centruExploatare.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(36,168);to=(37,4)]
			out.print("</a>\n    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(37,4);to=(37,14)]
			}else{
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(37,14);to=(38,8)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(38,8);to=(38,39)]
			out.print(centruExploatare.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(38,39);to=(39,4)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(39,4);to=(39,9)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(39,9);to=(40,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(40,0);to=(40,5)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(40,5);to=(42,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(42,0);to=(42,66)]
			if( formatiaDeLucru != null && formatiaDeLucru.getId() != -1){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(42,66);to=(44,4)]
			out.print("\n    <span class=\"slash\">/</span>\n    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(44,4);to=(44,44)]
			if( formatiaDeLucru.isShowAsLink()){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(44,44);to=(45,35)]
			out.print("\n        <a title=\"Lista evenimente ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(45,35);to=(45,65)]
			out.print(formatiaDeLucru.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(45,65);to=(45,86)]
			out.print("\" class=\"link\" href=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(45,86);to=(45,112)]
			out.print(AppConstants.APP_NAME);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(45,112);to=(45,136)]
			out.print("?action=showEvenimente\">");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(45,136);to=(45,166)]
			out.print(formatiaDeLucru.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(45,166);to=(46,4)]
			out.print("</a>\n    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(46,4);to=(46,14)]
			}else{
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(46,14);to=(47,8)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(47,8);to=(47,38)]
			out.print(formatiaDeLucru.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(47,38);to=(48,4)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(48,4);to=(48,9)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(48,9);to=(49,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(49,0);to=(49,5)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/header-localizare.jsp";from=(49,5);to=(50,7)]
			out.print("\n</span>");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(48,57);to=(49,63)]
			out.print("\r\n            <span class=\"slash\">/</span> <A class=\"link\" href=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(49,63);to=(49,89)]
			out.print(AppConstants.APP_NAME);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(49,89);to=(56,0)]
			out.print("?action=rapoarte\">Rapoarte</A>\r\n            <span class=\"slash\">/</span> Raport top 10 instalatii (FE)\r\n        </TD>\r\n    </TR>\r\n</TABLE>\r\n\r\n\r\n");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(56,0);to=(391,2)]
			
    final boolean toate = true;
//    boolean toate = ObjectUtils.getIntValue( request.getParameter("toate"), -1) == 1;
    final boolean statii = ObjectUtils.getIntValue( request.getParameter("statii"), -1) == 1;
    final boolean linii = ObjectUtils.getIntValue( request.getParameter("linii"), -1) == 1;
    final boolean posturi = ObjectUtils.getIntValue( request.getParameter("posturi"), -1) == 1;
    final boolean derivatii = ObjectUtils.getIntValue( request.getParameter("derivatii"), -1) == 1;
    final boolean bobine = ObjectUtils.getIntValue( request.getParameter("bobine"), -1) == 1;
    final boolean celule = ObjectUtils.getIntValue(request.getParameter("celule"), -1) == 1;
    final boolean bare = ObjectUtils.getIntValue( request.getParameter("bare"), -1) == 1;
    final boolean trafo = ObjectUtils.getIntValue( request.getParameter("trafo"), -1) == 1;

    final String lea = ObjectUtils.getStringValue( request.getParameter("lea"));
    final String les = ObjectUtils.getStringValue( request.getParameter("les"));

    final String[] ansambluri = request.getParameterValues("ansamblu");

    final Date dataStart = ObjectUtils.getDateValue( request.getParameter("data_start"), GlobalAppConstants.FORMAT_DATA);
    Date dataStop  = ObjectUtils.getDateValue( request.getParameter("data_stop"), ro.emid.common.constants.GlobalAppConstants.FORMAT_DATA);
    if( dataStop == null) dataStop = new Date();

    if( dataStart != null) session.setAttribute( "raportTop10DinFE.dataStart", dataStart); else session.removeAttribute( "raportTop10DinFE.dataStart");
    if( dataStop  != null) session.setAttribute( "raportTop10DinFE.dataStop", dataStop); else session.removeAttribute("raportTop10DinFE.dataStop");

    final int advancedFilters = ObjectUtils.getIntValue( request.getParameter( "advancedFilters"), 0);

    final int tipInstalatieReq = ObjectUtils.getIntValue( request.getParameter("tipInstalatie"), -1);
    final long idInstalatieReq = ObjectUtils.getLongValue(request.getParameter("idInstalatie"), -1);
    final String denInstalatieReq = StringUtils.getNullSafe( request.getParameter("denInstalatie"), "");

    int nivelTensiune = -1;
    if ( advancedFilters == 1 ){
        nivelTensiune = ObjectUtils.getIntValue( request.getParameter( "nivelTensiune"), -1);
    }


    List result = null;
    class Totaluri{
        long countIncidente;
        long durataIncidente;
        double energieNelivrata;
        double costMent;
        double costDaune;
        double costExpl;
        double costTotal;
    }

    Totaluri totaluri = null;


    final PaginationData pd = PaginationController.getPaginationData(request, 20);

    final SortData sd = SortController.getSortData( request, "CNT", "DESC" );

    final ro.emid.common.types.CategoryCheckData checkData = IncidenteSessionUtils.getCategoriiSelectate(session);

    StringBuffer sql = null;
    if( toate || statii || linii || posturi || derivatii || bobine || celule || bare || trafo){

        final StringBuffer filter = new StringBuffer();
        final StringBuffer filter2 = new StringBuffer();

        final Category filialaRaport = filiala;
        final Category sucursalaRaport = sucursala;
        final Category centruRaport = centruExploatare;

        if( filialaRaport != null ) session.setAttribute( "raportTop10DinFE.filiala", filialaRaport);
        if( sucursalaRaport != null ) session.setAttribute( "raportTop10DinFE.sucursala", sucursalaRaport);
        if( centruRaport != null ) session.setAttribute( "raportTop10DinFE.centru", centruRaport);


        if( idInstalatieReq > 0){
            filter2.append(" AND inst.ID = ").append( idInstalatieReq );
        }

        if( filialaRaport != null && filialaRaport.getId() > 0){
            filter.append(" AND FILIALA_ID = ").append( filialaRaport.getId());
        }

        if( sucursalaRaport != null && sucursalaRaport.getId() > 0){
            filter.append(" AND SUCURSALA_ID = ").append( sucursalaRaport.getId());
        }

        if( centruRaport != null && centruRaport.getId() > 0){
            filter.append(" AND SECTIE_ID = ").append( centruRaport.getId());
        }

        if ( dataStart != null){
            filter.append( " AND DATA_DETERIORARE >= TO_DATE('").append( AppConstants.format(dataStart)).append("', 'DD.MM.YYYY') " );
        }

        if ( dataStop != null){
            filter.append( " AND DATA_DETERIORARE <= TO_DATE('").append( AppConstants.format(dataStop)).append("', 'DD.MM.YYYY') " );
        }

        final StringBuffer liniiFilter = new StringBuffer();

        if ( !StringUtils.isZeroLength( lea) && !StringUtils.isZeroLength( les) ){
            liniiFilter.append(" AND upper( remove_multiple_spaces( inst.TIP_OB)) IN ('").append(lea).append("','").append(les).append("') ");
        } else if( !StringUtils.isZeroLength( lea)) {
            liniiFilter.append(" AND upper( remove_multiple_spaces( inst.TIP_OB)) = '").append(lea).append("' ");
        } else if( !StringUtils.isZeroLength( les)){
            liniiFilter.append(" AND upper( remove_multiple_spaces( inst.TIP_OB)) = '").append(les).append("' ");
        }

        if( nivelTensiune == 1){ //IT
            filter.append(" AND TENSIUNE >= 110");
            session.setAttribute( "raportTop10DinFE.nivelTensiune", new Integer( 1));
        } else if( nivelTensiune == 2){ //MT
            filter.append(" AND TENSIUNE < 110");
            session.setAttribute( "raportTop10DinFE.nivelTensiune", new Integer( 2));
        } else {
            session.removeAttribute( "raportTop10DinFE.nivelTensiune");
        }

        if( ansambluri != null && ansambluri.length > 0 ){
            final StringBuffer inCond = new StringBuffer();
            for (int i = 0; i < ansambluri.length; i++) {
                final String idAnsamblu = ansambluri[i];

                if( inCond.length() > 0) inCond.append(',');

                inCond.append( idAnsamblu);
            }

            filter.append( " AND ANSAMBLU_ID IN (").append( inCond).append(") ");
        }


        //{Checked Categories
        //Filiale


        long ids[] = checkData.getIdFiliale();
        String condition = " AND (";
        if( ids.length > 0){
            filter.append( condition);
            filter.append(" FILIALA_ID IN (");
            for (int i = 0; i < ids.length; i++) {
                final long id = ids[i];
                filter.append( id).append( i < ids.length - 1 ? ", " : "") ;
            }
            filter.append(") ");

            condition = " OR ";
        }

        ids = checkData.getIdSucursale();
        if( ids.length > 0){
            filter.append( condition);
            filter.append(" SUCURSALA_ID IN (");
            for (int i = 0; i < ids.length; i++) {
                final long id = ids[i];
                filter.append( id).append( i < ids.length - 1 ? ", " : "") ;
            }
            filter.append(") ");

            condition = " OR ";
        }

        ids = checkData.getIdCentre();
        if( ids.length > 0){
            filter.append( condition);
            filter.append(" SECTIE_ID IN (");
            for (int i = 0; i < ids.length; i++) {
                final long id = ids[i];
                filter.append( id).append( i < ids.length - 1 ? ", " : "") ;
            }
            filter.append(") ");
            condition = " OR ";
        }

        if( condition.equals(" OR ")){
            filter.append(')');  //for AND ( FILIALA_ID IN(...) OR SUCURSLA_ID IN (...) OR SECTIE_ID IN (...))
        }
        //}

        boolean addUnion = false;
        sql = new StringBuffer();

        if ( toate || statii){
            sql.append(" SELECT 1 AS TIP, inst.CE, inst.COD_LF AS LF_ID, inst.DESC_LF, sum( NR_ECHIP_DET_IDENTICE) CNT, SUM( DIAF_ORE * 60 + DIAF_MIN) DURATA_ECHIP, SUM( 0) EN, SUM( CHELT_MENT) CM, SUM( CHELT_DAUNE) CD, SUM( CHELT_EXPLOATARE) CEXP, SUM( CHELT_MENT + CHELT_DAUNE + CHELT_EXPLOATARE) CT " + " FROM echipamente e INNER JOIN LF inst on (" + " STATIE_COD = inst.COD_LF " + " AND isSelected( LINIE_ID) = 0" + " AND isSelected( DERIVATIE_ID) = 0" + " AND isSelected( BARA_ID) = 0" + " AND isSelected( BOBINA_ID) = 0" + " AND isSelected( CELULA_ID) = 0" + " AND isSelected( TRAFO_ID) = 0" + " AND isSelected( PAPT_ID) = 0 " + " )" + "   WHERE 0=0 ").append(filter).append(filter2).append(" GROUP BY 1, inst.CE, inst.COD_LF, inst.DESC_LF ");
            addUnion = true;
        }

        if( toate || linii){
            if( addUnion) sql.append(" UNION ");
            sql.append(" SELECT 2 AS TIP, inst.CE, inst.COD_LF AS LF_ID, inst.DESC_LF,  sum( NR_ECHIP_DET_IDENTICE) CNT, sum( DIAF_ORE * 60 + DIAF_MIN) DURATA_ECHIP, SUM( 0) EN, SUM( CHELT_MENT) CM, SUM( CHELT_DAUNE) CD, SUM( CHELT_EXPLOATARE) CEXP, SUM( CHELT_MENT + CHELT_DAUNE + CHELT_EXPLOATARE) CT \n" + " FROM echipamente e INNER JOIN LF  inst on ( \n" + " LINIE_COD = inst.COD_LF \n" + " AND isSelected( STATIE_ID) = 0 \n" + " AND isSelected( DERIVATIE_ID) = 0 \n" + " AND isSelected( PAPT_ID) = 0 \n" + " AND isSelected( TRAFO_ID) = 0 \n" + " ) \n" + "   WHERE 0=0 ").append(filter).append(filter2).append(liniiFilter).append(" \n ").append(" GROUP BY 2, inst.CE, inst.COD_LF, inst.DESC_LF \n");
            addUnion = true;
        }

        if( toate || posturi){
            if( addUnion) sql.append(" UNION ");
            sql.append(" SELECT 3 AS TIP, inst.CE, inst.COD_LF AS LF_ID, inst.DESC_LF,  sum(NR_ECHIP_DET_IDENTICE) CNT, sum( DIAF_ORE * 60 + DIAF_MIN) DURATA_ECHIP, SUM( 0) EN, SUM( CHELT_MENT) CM, SUM( CHELT_DAUNE) CD, SUM( CHELT_EXPLOATARE) CEXP, SUM( CHELT_MENT + CHELT_DAUNE + CHELT_EXPLOATARE) CT \n" + " FROM echipamente e INNER JOIN LF inst on (PAPT_COD = inst.COD_LF) \n" + "   WHERE 0=0 ").append(filter).append(filter2).append(" \n").append(" GROUP BY 3, inst.CE, inst.COD_LF, inst.DESC_LF \n");
            addUnion = true;
        }

        if( toate || bobine){
            if( addUnion) sql.append(" UNION ");
            sql.append(" SELECT 4 AS TIP, inst.CE, inst.NR_EQ AS LF_ID, inst.DESC_EQ AS DESC_LF,  sum(NR_ECHIP_DET_IDENTICE) CNT, sum( DIAF_ORE * 60 + DIAF_MIN) DURATA_ECHIP, SUM( 0) EN, SUM( CHELT_MENT) CM, SUM( CHELT_DAUNE) CD, SUM( CHELT_EXPLOATARE) CEXP, SUM( CHELT_MENT + CHELT_DAUNE + CHELT_EXPLOATARE) CT " + " FROM echipamente e INNER JOIN EQ inst on (BOBINA_COD = inst.NR_EQ) " + "   WHERE 0=0 ").append(filter).append(filter2).append(" GROUP BY 4, inst.CE, inst.NR_EQ, inst.DESC_EQ ");
            addUnion = true;
        }

        if( toate || celule){
            if( addUnion) sql.append(" UNION ");
            sql.append(" SELECT 5 AS TIP, inst.CE, inst.NR_EQ AS LF_ID, inst.DESC_EQ AS DESC_LF,  sum(NR_ECHIP_DET_IDENTICE) CNT, sum( DIAF_ORE * 60 + DIAF_MIN) DURATA_ECHIP, SUM( 0) EN, SUM( CHELT_MENT) CM, SUM( CHELT_DAUNE) CD, SUM( CHELT_EXPLOATARE) CEXP, SUM( CHELT_MENT + CHELT_DAUNE + CHELT_EXPLOATARE) CT " + " FROM echipamente e INNER JOIN EQ inst on (CELULA_COD = inst.NR_EQ) " + "   WHERE 0=0 ").append(filter).append(filter2).append(" GROUP BY 5, inst.CE, inst.NR_EQ, inst.DESC_EQ ");
            addUnion = true;
        }

        if( toate || bare){
            if( addUnion) sql.append(" UNION ");
            sql.append(" SELECT 6 AS TIP, inst.CE, inst.NR_EQ AS LF_ID, inst.DESC_EQ AS DESC_LF,  sum(NR_ECHIP_DET_IDENTICE) CNT, sum( DIAF_ORE * 60 + DIAF_MIN) DURATA_ECHIP, SUM( 0) EN, SUM( CHELT_MENT) CM, SUM( CHELT_DAUNE) CD, SUM( CHELT_EXPLOATARE) CEXP, SUM( CHELT_MENT + CHELT_DAUNE + CHELT_EXPLOATARE) CT" + " FROM echipamente e INNER JOIN EQ inst on (BARA_COD = inst.NR_EQ) " + "   WHERE 0=0 ").append(filter).append(filter2).append(" GROUP BY 6, inst.CE, inst.NR_EQ, inst.DESC_EQ ");
            addUnion = true;
        }

        if( toate || derivatii){
            if( addUnion) sql.append(" UNION ");
            sql.append(" SELECT 7 AS TIP, inst.CE, inst.NR_EQ AS LF_ID, inst.DESC_EQ AS DESC_LF,  sum(NR_ECHIP_DET_IDENTICE) CNT, sum( DIAF_ORE * 60 + DIAF_MIN) DURATA_ECHIP, SUM( 0) EN, SUM( CHELT_MENT) CM, SUM( CHELT_DAUNE) CD, SUM( CHELT_EXPLOATARE) CEXP, SUM( CHELT_MENT + CHELT_DAUNE + CHELT_EXPLOATARE) CT \n" + " FROM echipamente e INNER JOIN EQ inst on (DERIVATIE_COD = inst.NR_EQ) \n" + "   WHERE 0=0 ").append(filter).append(filter2).append(liniiFilter).append(" \n").append(" GROUP BY 7, inst.CE, inst.NR_EQ, inst.DESC_EQ \n");
            addUnion = true;
        }

        if( toate || trafo){
            if( addUnion) sql.append(" UNION ");
            sql.append(" SELECT 8 AS TIP, inst.CE, inst.NR_EQ AS LF_ID, inst.DESC_EQ AS DESC_LF,  sum(NR_ECHIP_DET_IDENTICE) CNT, sum( DIAF_ORE * 60 + DIAF_MIN) DURATA_ECHIP, SUM( 0) EN, SUM( CHELT_MENT) CM, SUM( CHELT_DAUNE) CD, SUM( CHELT_EXPLOATARE) CEXP, SUM( CHELT_MENT + CHELT_DAUNE + CHELT_EXPLOATARE) CT " + " FROM echipamente e INNER JOIN EQ inst on (TRAFO_COD = inst.NR_EQ) " + "   WHERE 0=0 ").append(filter).append(filter2).append(" GROUP BY 8, inst.CE, inst.NR_EQ, inst.DESC_EQ ");
            addUnion = true;
        }



        sql.append(  "   ) t ");
        sql.append(  "    INNER JOIN CATEGORIES c ON (t.CE=c.COD_SAP) ");
        sql.append(  "    INNER JOIN CATEGORIES s ON (c.ID_PARENT=s.ID) ");
        sql.append(  "    INNER JOIN CATEGORIES f ON (s.ID_PARENT=f.ID) ");

        final StringBuffer listSql = new StringBuffer()
                .append( "SELECT * FROM (SELECT a.*, ROWNUM AS rn FROM ( SELECT f.NAME AS FILIALA, s.NAME AS SUCURSALA, c.NAME AS CENTRU, t.TIP, t.LF_ID, t.DESC_LF, t.CNT, t.DURATA_ECHIP, t.EN, t.CM, t.CD, t.CEXP, t.CT FROM (")
                .append( sql)
                .append( "   ORDER BY ").append(sd.getColumnName()).append(' ').append( sd.getDirection())
                .append( " )a WHERE ROWNUM <= ").append( pd.getQueryEndIndex())
                .append( ") WHERE ").append( pd.getStartIndex()).append(" <= rn ");

        final ReportStatement report = new ReportStatement( listSql.toString());

        result = report.getListOfArrays("run raport");

        final StringBuffer countSql = new StringBuffer("SELECT COUNT(*) FROM (").append( sql);

        pd.setTotalRowsCount( AccessDB.getLong(countSql.toString(), "Count Linii raport top 10 instalatii").intValue());
        pd.setResultRowCount( result != null ? result.size() : 0);

        //calculare totaluri
        final StringBuffer totalsSql = new StringBuffer("SELECT sum(t.CNT), sum( t.DURATA_ECHIP), sum( t.EN), sum(t.CM), sum(t.CD), sum(t.CEXP), sum(t.CT) FROM (").append( sql);

        final List totalsResult = new ReportStatement( totalsSql.toString()).getListOfArrays("get totaluri");

        if(totalsResult != null) for (int i = 0; i < totalsResult.size(); i++) {
            final Object[] objects = (Object[]) totalsResult.get(i);

            int k = 0;
            totaluri = new Totaluri();
            totaluri.countIncidente = ObjectUtils.getIntValue( objects[ k++], 0);
            totaluri.durataIncidente = ObjectUtils.getIntValue( objects[ k++], 0);
            totaluri.energieNelivrata = ObjectUtils.getDoubleValue( objects[ k++], 0);
            totaluri.costMent = ObjectUtils.getDoubleValue( objects[ k++],0);
            totaluri.costDaune = ObjectUtils.getDoubleValue( objects[ k++],0);
            totaluri.costExpl = ObjectUtils.getDoubleValue( objects[ k++],0);
            totaluri.costTotal = ObjectUtils.getDoubleValue( objects[ k++], 0);
            break;
        }

        session.setAttribute("raportTop10InstalatiiFilterDinFE", filter);
    }


    String publicPath = null;
    if( sql != null && ObjectUtils.getIntValue( request.getParameter("toExport"), 0) == 1){

        final String root = AppConstants.PUBLIC_RESOURCE_PATH + File.separator + "raport";


        final String folder = _df.format( new java.util.Date());
        //cleanup...
        final File[]folders = new File( root).listFiles();
        if( folders != null) for (int i = 0; i < folders.length; i++) {
            final File file = folders[i];
            if( !file.getName().equals( folder)){
                final File[]d=file.listFiles();
                if( d!=null) for (int j = 0; j < d.length; j++) {
                    final File file1 = d[j];
                    file1.delete();
                }
                file.delete( );  //cleanup
            }
        }

        File f = new File( root, folder);
        if( !f.exists()) f.mkdir();

        final String strDataStart = AppConstants.format(dataStart);
        final String strDataStop  = AppConstants.format(dataStop);

        final String fileName = "Raport top 10 instalatii FE " + strDataStart + " - " + strDataStop + '_' + System.currentTimeMillis() + ".xls";
        final String privatePath = root + File.separator + folder + File.separator + fileName;

        publicPath = AppConstants.WEB_RESOURCE_PATH + "/raport/" + folder + '/' + fileName;

        f = new File( privatePath);
        if( f.exists()){
            f.delete();
        }

        final String templatePath = GlobalAppConstants.PRIVATE_PATH + File.separator+"template"+File.separator+"Raport top 10 Instalatii FE.xls";

        final RaportTop10InstalatiiFeExcelExporter exporter = new RaportTop10InstalatiiFeExcelExporter();
        exporter.begin( templatePath, privatePath);

        final StringBuffer sqlExport = new StringBuffer()
                .append( " SELECT f.NAME AS FILIALA, s.NAME AS SUCURSALA, c.NAME AS CENTRU, t.TIP, t.LF_ID, t.DESC_LF, t.CNT, t.DURATA_ECHIP, t.EN, t.CM, t.CD, t.CEXP, t.CT FROM (")
                .append( sql)
                .append( "  ORDER BY ").append( sd.getColumnName()).append(' ').append( sd.getDirection());


        final ReportStatement report = new ReportStatement( sqlExport.toString());

        List resultExport = report.getListOfArrays("run export top 10 din FE");

        exporter.export( resultExport);

        resultExport = null;

        exporter.end();
    }

    final Nomenclator[] noms = NomAccessDB.getAllNom( NomConstants.NOM_ANSAMBLURI);


// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(391,2);to=(396,18)]
			out.print("\r\n\r\n<table width=\"100%\">\r\n    <tr><td>\r\n    <form name=\"zaforma\"\r\n          action=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(396,18);to=(396,44)]
			out.print(AppConstants.APP_NAME);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(396,44);to=(398,25)]
			out.print("?action=raport-top10-fe\"\r\n          method=\"post\"\r\n          onsubmit=\"this.");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(398,25);to=(398,59)]
			out.print(PaginationConstants.JSP_RESET);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(398,59);to=(400,35)]
			out.print(".value=\'true\';\">\r\n        <input type=\"hidden\" name=\"toExport\" value=\"0\">\r\n        <input type=\"hidden\" name=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(400,35);to=(400,69)]
			out.print(PaginationConstants.JSP_RESET);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(400,69);to=(401,8)]
			out.print("\" value=\"\">\r\n        ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(401,8);to=(401,41)]
			out.print(SortController.initSort( sd));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(401,41);to=(405,20)]
			out.print("\r\n        <table class=\"gsaptd\" width=\"100%\" id=\"tableCuCheckboxuri\">\r\n            <tr>\r\n                <td align=\"left\">\r\n                    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(405,20);to=(405,45)]
			 final int cols = 3; 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(405,45);to=(406,20)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(406,20);to=(406,52)]
			 final int n = noms.length; 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(406,52);to=(410,28)]
			out.print("\r\n                    <table border=\"0\" width=\"100%\">\r\n                        <tr valign=\"top\">\r\n                            <td>\r\n                            ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(410,28);to=(411,68)]
			 for ( int k = 0; k < n; k++ ) {
                                final Nomenclator nom = noms[ k]; 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(411,68);to=(412,32)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(412,32);to=(412,66)]
			 if ( k % (  n/cols) == 0 ) { 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(412,66);to=(414,32)]
			out.print("\r\n                                    <td>\r\n                                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(414,32);to=(414,39)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(414,39);to=(417,32)]
			out.print("\r\n\r\n                            <nobr>\r\n                                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(417,32);to=(417,112)]
			 final boolean checked = exists( ansambluri, String.valueOf( nom.getId())); 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(417,112);to=(418,78)]
			out.print("\r\n                                <input type=\"checkbox\" name=\"ansamblu\" value=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(418,78);to=(418,94)]
			out.print(nom.getId());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(418,94);to=(418,108)]
			out.print("\" id=\"ansamblu");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(418,108);to=(418,114)]
			out.print(k);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(418,114);to=(418,116)]
			out.print("\" ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(418,116);to=(418,147)]
			out.print((checked ? "checked" : ""));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(418,147);to=(419,40)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(419,40);to=(419,80)]
			 if( nom.getCod() == COD_ANS_LEA) { 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(419,80);to=(421,40)]
			out.print("\r\n                                        onclick=\"toggleLeaFilters( this)\"\r\n                                        ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(421,40);to=(421,86)]
			 }else if( nom.getCod() == COD_ANS_LES) { 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(421,86);to=(423,40)]
			out.print("\r\n                                        onclick=\"toggleLesFilters( this)\"\r\n                                        ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(423,40);to=(423,47)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(423,47);to=(424,61)]
			out.print("\r\n                                        ><label for=\"ansamblu");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(424,61);to=(424,67)]
			out.print(k);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(424,67);to=(424,75)]
			out.print("\"><nobr>");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(424,75);to=(424,98)]
			out.print(nom.getDescriere());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(424,98);to=(426,32)]
			out.print("</nobr></label>\r\n\r\n                                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(426,32);to=(426,72)]
			 if( nom.getCod() == COD_ANS_LEA) { 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(426,72);to=(428,88)]
			out.print("\r\n\r\n                                    <select id=\"lea\"  name=\"lea\" style=\"font-size:10px; ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(428,88);to=(428,124)]
			out.print(!checked ? "display:none;" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(428,124);to=(430,48)]
			out.print("\">\r\n                                        <option></option>\r\n                                        <option ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(430,48);to=(430,93)]
			out.print("LEA 6 KV".equals(lea) ? "selected" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(430,93);to=(431,48)]
			out.print(" >LEA 6 KV</option>\r\n                                        <option ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(431,48);to=(431,94)]
			out.print("LEA 10 KV".equals(lea) ? "selected" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(431,94);to=(432,48)]
			out.print(" >LEA 10 KV</option>\r\n                                        <option ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(432,48);to=(432,94)]
			out.print("LEA 20 KV".equals(lea) ? "selected" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(432,94);to=(433,48)]
			out.print(" >LEA 20 KV</option>\r\n                                        <option ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(433,48);to=(433,94)]
			out.print("LEA 35 KV".equals(lea) ? "selected" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(433,94);to=(434,48)]
			out.print(" >LEA 35 KV</option>\r\n                                        <option ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(434,48);to=(434,95)]
			out.print("LEA 110 KV".equals(lea) ? "selected" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(434,95);to=(436,32)]
			out.print(" >LEA 110 KV</option>\r\n                                    </select>\r\n                                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(436,32);to=(436,78)]
			 } else if( nom.getCod() == COD_ANS_LES){ 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(436,78);to=(438,88)]
			out.print("\r\n\r\n                                    <select id=\"les\"  name=\"les\" style=\"font-size:10px; ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(438,88);to=(438,124)]
			out.print(!checked ? "display:none;" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(438,124);to=(440,48)]
			out.print("\">\r\n                                        <option></option>\r\n                                        <option ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(440,48);to=(440,93)]
			out.print("LES 6 KV".equals(les) ? "selected" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(440,93);to=(441,48)]
			out.print(" >LES 6 KV</option>\r\n                                        <option ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(441,48);to=(441,94)]
			out.print("LES 10 KV".equals(les) ? "selected" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(441,94);to=(442,48)]
			out.print(" >LES 10 KV</option>\r\n                                        <option ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(442,48);to=(442,94)]
			out.print("LES 20 KV".equals(les) ? "selected" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(442,94);to=(443,48)]
			out.print(" >LES 20 KV</option>\r\n                                        <option ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(443,48);to=(443,95)]
			out.print("LES 110 KV".equals(les) ? "selected" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(443,95);to=(445,32)]
			out.print(" >LES 110 KV</option>\r\n                                    </select>\r\n                                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(445,32);to=(445,39)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(445,39);to=(447,28)]
			out.print("\r\n                            </nobr><br>\r\n                            ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(447,28);to=(447,35)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(447,35);to=(453,87)]
			out.print("\r\n                        </tr>\r\n                    </table>\r\n                    <hr/>\r\n\r\n                    &nbsp;&nbsp;<span style=\"font-weight:bold;\" title=\"Instalatie\">Instalatie:</span>\r\n                    <input type=\"hidden\" id=\"idInstalatie\" name=\"idInstalatie\"  value=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(453,87);to=(453,107)]
			out.print(idInstalatieReq);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(453,107);to=(454,88)]
			out.print("\" />\r\n                    <input type=\"hidden\" id=\"tipInstalatie\" name=\"tipInstalatie\" value=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(454,88);to=(454,109)]
			out.print(tipInstalatieReq);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(454,109);to=(456,96)]
			out.print("\" />\r\n                    <input type=\"hidden\" id=\"isLF\" name=\"isLF\" value=\"\" />\r\n                    <input type=\"text\" id=\"denInstalatie\" name=\"denInstalatie\" size=\"50\" value=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(456,96);to=(456,143)]
			out.print(StringUtils.getNullSafe( denInstalatieReq));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(456,143);to=(459,81)]
			out.print("\" />\r\n\r\n                    &nbsp;&nbsp;<span style=\"font-weight:bold;\" title=\"Nivel tensiune\">Nivel:</span>\r\n                    <input type=\"radio\" name=\"nivelTensiune\" value=\"1\" id=\"ntIT\" ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(459,81);to=(459,121)]
			out.print(nivelTensiune == 1 ? "checked" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(459,121);to=(460,81)]
			out.print(" /><label for=\"ntIT\">IT</label>\r\n                    <input type=\"radio\" name=\"nivelTensiune\" value=\"2\" id=\"ntMT\" ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(460,81);to=(460,121)]
			out.print(nivelTensiune == 2 ? "checked" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(460,121);to=(461,84)]
			out.print("/><label for=\"ntMT\">MT</label>\r\n                    <input type=\"radio\" name=\"nivelTensiune\" value=\"3\" id=\"ntTOATE\" ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(461,84);to=(461,124)]
			out.print(nivelTensiune == 3 ? "checked" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(461,124);to=(465,89)]
			out.print("/><label for=\"ntTOATE\">Toate</label>\r\n\r\n                    &nbsp;&nbsp;\r\n                    <span title=\"Perioada producerii deranjamentelor\" style=\"font-weight:bold;\">Perioada:</span>\r\n                    <input type=\"text\" id=\"data_start\" name=\"data_start\" size=\"8\" value=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(465,89);to=(465,125)]
			out.print(AppConstants.format( dataStart));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(465,125);to=(465,177)]
			out.print("\" /> <a href=\"#\" id=\"trigger_data_start\" ><img src=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(465,177);to=(465,232)]
			out.print(AppConstants.WEB_RESOURCE_PATH + "/images/cal.gif");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(465,232);to=(466,87)]
			out.print("\" width=\"16\" height=\"16\" border=\"0\" alt=\"Apasa pt. a selecta data.\"></a>&nbsp;&nbsp;-&nbsp;&nbsp;\r\n                    <input type=\"text\" id=\"data_stop\" name=\"data_stop\" size=\"8\" value=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(466,87);to=(466,122)]
			out.print(AppConstants.format( dataStop));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(466,122);to=(466,173)]
			out.print("\" /> <a href=\"#\" id=\"trigger_data_stop\" ><img src=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(466,173);to=(466,228)]
			out.print(AppConstants.WEB_RESOURCE_PATH + "/images/cal.gif");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(466,228);to=(468,20)]
			out.print("\" width=\"16\" height=\"16\" border=\"0\" alt=\"Apasa pt. a selecta data.\"></a>\r\n\r\n                    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(468,20);to=(468,77)]
			if( user.getIeLevel() < RoleConstants.NIVEL_CENTRU){ 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(468,77);to=(469,195)]
			out.print("\r\n                        <A href=\"#\" onClick=\"openCheckCategorii(); return false\" class=\"link\"><IMG alt=\"Click pentru a selecta mai multe sucursale/C.E.\" border=0 width=12 height=13 hspace=3 src=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(469,195);to=(469,265)]
			out.print(AppConstants.WEB_RESOURCE_PATH + "/images/icon_mini_search.gif");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(469,265);to=(474,68)]
			out.print("\"></A>\r\n                        <script type=\"text/javascript\">\r\n                            var checkCategoriiWindow = null;\r\n                            function openCheckCategorii(){\r\n                                if( checkCategoriiWindow) checkCategoriiWindow.close();\r\n                                checkCategoriiWindow = window.open(\'");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(474,68);to=(474,94)]
			out.print(AppConstants.APP_NAME);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(474,94);to=(477,20)]
			out.print("?action=checkCategorie\',\'checkCategorie\', \'width=800 height=620, scrollbars=yes,status=yes,resizable=yes,top=10,left=50,dependent=yes,alwaysRaised=yes\');\r\n                            }\r\n                        </script>\r\n                    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(477,20);to=(477,27)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(477,27);to=(482,20)]
			out.print("\r\n\r\n                    &nbsp;&nbsp;<input type=\"submit\" value=\"Aplica\">\r\n                    &nbsp;<input type=\"button\" value=\"Export\" onclick=\"document.zaforma.toExport.value = \'1\'; document.zaforma.submit();\" />\r\n\r\n                    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(482,20);to=(532,22)]
			 if( checkData.someDataChecked()){

                        final StringBuffer strCategorii = new StringBuffer("");
                        final long[] idCentre = checkData.getIdCentre();
                        final Set sucursaleSelectate = new HashSet();
                        final Set filialeSelectate = new HashSet();
                        for (int i = 0; i < idCentre.length; i++) {
                            final long id = idCentre[i];
                            final Category c = CategoryAccessDB.getById(id);
                            if (c != null) {
                                final Category s = CategoryAccessDB.getById(c.getId_parent());
                                if (s != null) {
                                    final Category f = CategoryAccessDB.getById(s.getId_parent());
                                    if (f != null) {
                                        if (strCategorii.length() > 0) strCategorii.append("<br>");
                                        strCategorii.append(f.getName()).append(", ").append(s.getName()).append(", ").append(c.getName());

                                        sucursaleSelectate.add(new Long(s.getId()));
                                        filialeSelectate.add(new Long(f.getId()));
                                    }
                                }
                            }
                        }

                        final long[] idSucursale = checkData.getIdSucursale();
                        for (int i = 0; i < idSucursale.length; i++) {
                            final long id = idSucursale[i];
                            if( !sucursaleSelectate.contains( new Long( id))){
                                final Category s = CategoryAccessDB.getById( id );
                                if( s != null){
                                    final Category f = CategoryAccessDB.getById( s.getId_parent());
                                    if( f != null){
                                        if( strCategorii.length() > 0) strCategorii.append("<br>");
                                        strCategorii.append(f.getName()).append(", ").append(s.getName());
                                    }
                                }
                            }
                        }

                        final long[] idFiliale = checkData.getIdFiliale();
                        for (int i = 0; i < idFiliale.length; i++) {
                            final long id = idFiliale[i];
                            if( !filialeSelectate.contains( new Long( id))){
                                final Category f = CategoryAccessDB.getById( id);
                                if( f != null){
                                    if( strCategorii.length() > 0) strCategorii.append("<br>");
                                    strCategorii.append(f.getName());
                                }
                            }
                        }
                    
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(532,22);to=(535,20)]
			out.print("\r\n\r\n                    <br/>\r\n                    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(535,20);to=(535,37)]
			out.print(strCategorii);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(535,37);to=(536,20)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(536,20);to=(536,27)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(536,27);to=(570,12)]
			out.print("\r\n                </td>\r\n            </tr>\r\n            <tr id=\"rowAdvancedFilters\" style=\"display:none\">\r\n                <td colspan=\"2\">\r\n\r\n                </td>\r\n            </tr>\r\n        </table>\r\n\r\n        <script type=\"text/javascript\">\r\n\r\n            function toggleLeaFilters(oCheck){\r\n                var selectu = $(\"lea\");\r\n                if( oCheck.checked){\r\n                    Element.show( selectu);\r\n                }else{\r\n                    Element.hide( selectu);\r\n                }\r\n            }\r\n\r\n            function toggleLesFilters(oCheck){\r\n                var selectu = $(\"les\");\r\n                if( oCheck.checked){\r\n                    Element.show( selectu);\r\n                }else{\r\n                    Element.hide( selectu);\r\n                }\r\n            }\r\n\r\n            var plusuAdvanced = new Plus( \"plusAdvancedFilters\", \"rowAdvancedFilters\", function(){\r\n                $(\"advancedFilters\").value= ( plusuAdvanced.getStatus() == PlusConstants.STATUS_MINUS ? \"1\" : \"0\");\r\n            });\r\n\r\n            ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(570,12);to=(570,44)]
			 if( advancedFilters == 1){ 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(570,44);to=(572,12)]
			out.print("\r\n                plusuAdvanced.setMinus();\r\n            ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(572,12);to=(572,19)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(572,19);to=(581,166)]
			out.print("\r\n        </script>\r\n\r\n        <TABLE id=\"table\" border=1 cellPadding=2 cellSpacing=1 width=\"100%\" class=\"gSAPTHEAD\" style=\"BACKGROUND-COLOR: white; margin-top:5px\">\r\n            <TR noSelect=\"true\">\r\n                <TH rowspan=\"2\" class=\"gsapthead\" noWrap width=\"10px\">#</TH>\r\n                <TH rowspan=\"2\" class=\"gsapthead\" noWrap >Instalatie</TH>\r\n                <TH rowspan=\"2\" class=\"gsapthead\" noWrap width=\"1%\">Sucursala</TH>\r\n                <TH rowspan=\"2\" class=\"gsapthead\" noWrap width=\"2%\">CE</TH>\r\n                <TH rowspan=\"2\" title=\"Numarul de echipamente identice deteriorate\"  class=\"gsapthead\" noWrap width=\"100px\" style=\"text-decoration:underline\"> <nobr> ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(581,166);to=(581,236)]
			out.print(SortController.printSortableColumn( "Nr. echipamente", "CNT", sd));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(581,236);to=(582,113)]
			out.print("</nobr></TH>\r\n                <TH rowspan=\"2\" class=\"gsapthead\" noWrap width=\"100px\" style=\"text-decoration:underline\"> <nobr> ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(582,113);to=(582,191)]
			out.print(SortController.printSortableColumn( "Durata Indisp.", "DURATA_ECHIP", sd));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(582,191);to=(587,95)]
			out.print("</nobr></TH>\r\n                <TH colspan=\"4\" class=\"gsapthead\" noWrap >Cheltuieli (ron)</TH>\r\n                <TH rowspan=\"2\" class=\"gsapthead\" noWrap width=\"50px\"> Cauze </TH>\r\n            </TR>\r\n            <tr noSelect=\"true\">\r\n                <TH class=\"gsapthead\" noWrap align=\"center\" style=\"text-decoration:underline\"> ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(587,95);to=(587,154)]
			out.print(SortController.printSortableColumn( "Ment.", "CM", sd));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(587,154);to=(588,95)]
			out.print("</TH>\r\n                <TH class=\"gsapthead\" noWrap align=\"center\" style=\"text-decoration:underline\"> ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(588,95);to=(588,154)]
			out.print(SortController.printSortableColumn( "Daune", "CD", sd));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(588,154);to=(589,95)]
			out.print("</TH>\r\n                <TH class=\"gsapthead\" noWrap align=\"center\" style=\"text-decoration:underline\"> ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(589,95);to=(589,156)]
			out.print(SortController.printSortableColumn( "Expl.", "CEXP", sd));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(589,156);to=(590,95)]
			out.print("</TH>\r\n                <TH class=\"gsapthead\" noWrap align=\"center\" style=\"text-decoration:underline\"> ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(590,95);to=(590,155)]
			out.print(SortController.printSortableColumn( "Total.", "CT", sd));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(590,155);to=(592,12)]
			out.print("</TH>\r\n            </tr>\r\n            ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(592,12);to=(592,40)]
			 if( result == null ) { 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(592,40);to=(596,12)]
			out.print("\r\n                <tr>\r\n                    <td colspan=\"15\">Selectati categoria sau categoriile de instalatii</td>\r\n                </tr>\r\n            ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(596,12);to=(596,26)]
			 } else { 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(596,26);to=(597,16)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(597,16);to=(597,46)]
			 if( result.size() == 0){ 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(597,46);to=(601,12)]
			out.print("\r\n                    <tr>\r\n                        <td colspan=\"12\">Nu exista fise echipament conform filtrului specificat.</td>\r\n                    </tr>\r\n            ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(601,12);to=(601,24)]
			 }else {
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(601,24);to=(602,16)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(602,16);to=(639,15)]
			 for (int i = 0; i < result.size(); i++) {
                    final Object[] objects = (Object[]) result.get(i);

                    final String numeFiliala   = (String) objects[ 0];
                    final String numeSucursala = (String) objects[ 1];
                    final String numeCentru    = (String) objects[ 2];

                    final int tipInstalatie =  Integer.parseInt( objects[3].toString());

                    String denTipInstalatie = "-";

                    switch ( tipInstalatie){
                        case 1: denTipInstalatie = "Statie"; break;
                        case 2: denTipInstalatie = "Linie"; break;
                        case 3: denTipInstalatie = "PA-PT"; break;
                        case 4: denTipInstalatie = "Bobina"; break;
                        case 5: denTipInstalatie = "Celula"; break;
                        case 6: denTipInstalatie = "Bara"; break;
                        case 7: denTipInstalatie = "Derivatie"; break;
                        case 8: denTipInstalatie = "Trafo"; break;
                        default:
                            denTipInstalatie = "necunoscut";
                            break;
                    }

                    final String idInstalatie = objects[4].toString();
                    final String descInstalatie = objects[5].toString();
                    final String countIncidente = objects[6].toString();

                    final long durataIncidente = Integer.parseInt( objects[7].toString());

                    final double energieNelivrata = Double.parseDouble( objects[8].toString());
                    final double costMent = Double.parseDouble( objects[9].toString());
                    final double costDaune = Double.parseDouble( objects[10].toString());
                    final double costExpl = Double.parseDouble( objects[11].toString());

                    final double costTotal = Double.parseDouble( objects[12].toString());
             
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(639,15);to=(642,43)]
			out.print("\r\n\r\n                    <tr>\r\n                        <td align=\"center\">");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(642,43);to=(642,51)]
			out.print(i+1);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(642,51);to=(644,42)]
			out.print("</td>\r\n                        <td>\r\n                            <label title=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(644,42);to=(644,63)]
			out.print(denTipInstalatie);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(644,63);to=(644,66)]
			out.print(" - ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(644,66);to=(644,85)]
			out.print(descInstalatie);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(644,85);to=(644,93)]
			out.print("\"><nobr>");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(644,93);to=(644,112)]
			out.print(descInstalatie);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(644,112);to=(648,32)]
			out.print("</nobr></label>\r\n                        </td>\r\n                        <td nowrap>\r\n                            <label title=\"Sucursala instalatie\">\r\n                                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(648,32);to=(648,50)]
			out.print(numeSucursala);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(648,50);to=(653,32)]
			out.print("\r\n                            </label>\r\n                        </td>\r\n                        <td nowrap>\r\n                            <label title=\"Centru Exploatare instalatie\">\r\n                                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(653,32);to=(653,47)]
			out.print(numeCentru);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(653,47);to=(657,148)]
			out.print("\r\n                            </label>\r\n                        </td>\r\n                        <td align=\"center\">\r\n                            <a class=\"link\" title=\"Click pentru vizualizare fisele de echipament\" href=\"javascript: openEchipamenteByTipInstalatie(\'");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(657,148);to=(657,166)]
			out.print(tipInstalatie);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(657,166);to=(657,170)]
			out.print("\', \'");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(657,170);to=(657,187)]
			out.print(idInstalatie);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(657,187);to=(658,32)]
			out.print("\')\">\r\n                                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(658,32);to=(658,51)]
			out.print(countIncidente);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(658,51);to=(662,28)]
			out.print("\r\n                            </a>\r\n                        </td>\r\n                        <td align=\"right\">\r\n                            ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(662,28);to=(662,51)]
			out.print(durataIncidente/60);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(662,51);to=(662,53)]
			out.print("h ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(662,53);to=(662,76)]
			out.print(durataIncidente%60);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(662,76);to=(664,43)]
			out.print("\'\r\n                        </td>\r\n                        <td align=\"right\"> ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(664,43);to=(664,56)]
			out.print(costMent);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(664,56);to=(665,43)]
			out.print(" </td>\r\n                        <td align=\"right\"> ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(665,43);to=(665,57)]
			out.print(costDaune);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(665,57);to=(666,43)]
			out.print(" </td>\r\n                        <td align=\"right\"> ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(666,43);to=(666,56)]
			out.print(costExpl);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(666,56);to=(667,43)]
			out.print(" </td>\r\n                        <td align=\"right\"> ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(667,43);to=(667,57)]
			out.print(costTotal);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(667,57);to=(669,180)]
			out.print(" </td>\r\n                        <td align=\"center\">\r\n                            <a class=\"link\" title=\"Click pentru a vizualiza fisele de echipament grupate pe cauze\" href=\"javascript: openEchipamenteGrupatePeCauzeByTipInstalatie( \'");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(669,180);to=(669,198)]
			out.print(tipInstalatie);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(669,198);to=(669,202)]
			out.print("\', \'");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(669,202);to=(669,219)]
			out.print(idInstalatie);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(669,219);to=(675,16)]
			out.print("\')\">\r\n                                vizualizare\r\n                            </a>\r\n                        </td>\r\n                    </tr>\r\n\r\n                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(675,16);to=(675,23)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(675,23);to=(678,28)]
			out.print("\r\n                    <tr noSelect=\"true\" class=\"paginationRow\">\r\n                        <td colspan=\"4\" align=\"left\">\r\n                            ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(678,28);to=(678,77)]
			out.print(PaginationController.printPaginationData(pd));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(678,77);to=(680,61)]
			out.print("\r\n                        </td>\r\n                        <td align=\"center\" class=\"totalCell\">");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(680,61);to=(680,87)]
			if( totaluri == null){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(680,87);to=(680,95)]
			out.print(" &nbsp; ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(680,95);to=(680,105)]
			}else{
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(680,105);to=(680,106)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(680,106);to=(680,134)]
			out.print(totaluri.countIncidente);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(680,134);to=(680,135)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(680,135);to=(680,140)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(680,140);to=(681,60)]
			out.print("</td>\r\n                        <td align=\"right\" class=\"totalCell\">");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(681,60);to=(681,86)]
			if( totaluri == null){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(681,86);to=(681,94)]
			out.print(" &nbsp; ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(681,94);to=(681,104)]
			}else{
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(681,104);to=(681,105)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(681,105);to=(681,137)]
			out.print(totaluri.durataIncidente/60);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(681,137);to=(681,139)]
			out.print("h ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(681,139);to=(681,171)]
			out.print(totaluri.durataIncidente%60);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(681,171);to=(681,172)]
			out.print("\'");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(681,172);to=(681,177)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(681,177);to=(682,24)]
			out.print("</td>\r\n                        ");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(682,177);to=(683,60)]
			out.print("\r\n                        <td align=\"right\" class=\"totalCell\">");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(683,60);to=(683,86)]
			if( totaluri == null){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(683,86);to=(683,94)]
			out.print(" &nbsp; ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(683,94);to=(683,104)]
			}else{
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(683,104);to=(683,105)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(683,105);to=(683,149)]
			out.print(AppConstants.format2(totaluri.costMent));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(683,149);to=(683,150)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(683,150);to=(683,155)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(683,155);to=(684,60)]
			out.print("</td>\r\n                        <td align=\"right\" class=\"totalCell\">");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(684,60);to=(684,86)]
			if( totaluri == null){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(684,86);to=(684,94)]
			out.print(" &nbsp; ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(684,94);to=(684,104)]
			}else{
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(684,104);to=(684,105)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(684,105);to=(684,150)]
			out.print(AppConstants.format2(totaluri.costDaune));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(684,150);to=(684,151)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(684,151);to=(684,156)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(684,156);to=(685,60)]
			out.print("</td>\r\n                        <td align=\"right\" class=\"totalCell\">");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(685,60);to=(685,86)]
			if( totaluri == null){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(685,86);to=(685,94)]
			out.print(" &nbsp; ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(685,94);to=(685,104)]
			}else{
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(685,104);to=(685,105)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(685,105);to=(685,149)]
			out.print(AppConstants.format2(totaluri.costExpl));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(685,149);to=(685,150)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(685,150);to=(685,155)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(685,155);to=(686,60)]
			out.print("</td>\r\n                        <td align=\"right\" class=\"totalCell\">");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(686,60);to=(686,86)]
			if( totaluri == null){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(686,86);to=(686,94)]
			out.print(" &nbsp; ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(686,94);to=(686,104)]
			}else{
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(686,104);to=(686,105)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(686,105);to=(686,151)]
			out.print(AppConstants.format02(totaluri.costTotal));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(686,151);to=(686,152)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(686,152);to=(686,157)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(686,157);to=(689,16)]
			out.print("</td>\r\n                        <td>&nbsp;</td>\r\n                    </tr>\r\n                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(689,16);to=(689,23)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(689,23);to=(690,12)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(690,12);to=(690,19)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(690,19);to=(756,42)]
			out.print("\r\n        </TABLE>\r\n    </form>\r\n        \r\n</td></tr></table>\r\n\r\n\r\n<script type=\"text/javascript\">\r\n    Calendar.setup({\r\n        inputField  : \"data_start\",         // ID of the input field\r\n        ifFormat    : \"%d.%m.%Y\",    // the date format\r\n        button      : \"trigger_data_start\"       // ID of the button\r\n    });\r\n\r\n    Calendar.setup({\r\n        inputField  : \"data_stop\",         // ID of the input field\r\n        ifFormat    : \"%d.%m.%Y\",    // the date format\r\n        button      : \"trigger_data_stop\"       // ID of the button\r\n    });\r\n\r\n    function getCheckBoxes( element){\r\n        var r = new Array();\r\n        var t = element.getElementsByTagName(\"input\");\r\n        for( var i = 0; i < t.length; i++){\r\n            if( t[i].type && t[i].type==\"checkbox\"){\r\n                r.push( t[i]);\r\n            }\r\n        }\r\n\r\n        return r;\r\n    }\r\n\r\n    function onToateClicked( oChecku){\r\n        var disabled = oChecku.checked;\r\n\r\n        var fixed = [\r\n                $(\"statii\"),\r\n                $(\"linii\"),\r\n                $(\"posturi\"),\r\n                $(\"bobine\"),\r\n                $(\"derivatii\"),\r\n                $(\"celule\"),\r\n                $(\"bare\"),\r\n                $(\"trafo\")\r\n        ];\r\n\r\n        //getCheckBoxes( $( \"tableCuCheckboxuri\"))\r\n        doWork( fixed, function(element){\r\n            if( element != oChecku){\r\n                element.disabled = disabled;\r\n                if( element.checked){\r\n                    element.checked = false;\r\n                }\r\n            }\r\n        });\r\n    }\r\n\r\n    function doWork( arr, f){\r\n        for( var i = 0; i < arr.length; i++){\r\n            f( arr[i]);\r\n        }\r\n    }\r\n\r\n    var echipamenteWindow = null;\r\n    function openEchipamenteByTipInstalatie( tipInstalatie, codInstalatie){\r\n        if( echipamenteWindow != null) echipamenteWindow.close();\r\n        echipamenteWindow = window.open( \'");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(756,42);to=(756,68)]
			out.print(AppConstants.APP_NAME);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(756,68);to=(762,42)]
			out.print("?action=showEchipamenteFromRaportTop10&tipInstalatie=\'+tipInstalatie + \"&codInstalatie=\" + codInstalatie,\r\n                \'echipamenteRaport\', \'top=50,left=50,width=850, height=550, status=yes,resizable=yes,dependent=yes,alwaysRaised=yes, scrollbars=yes\');\r\n    }\r\n\r\n    function openEchipamenteGrupatePeCauzeByTipInstalatie( tipInstalatie, codInstalatie){\r\n        if( echipamenteWindow != null) echipamenteWindow.close();\r\n        echipamenteWindow = window.open( \'");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(762,42);to=(762,68)]
			out.print(AppConstants.APP_NAME);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(762,68);to=(770,40)]
			out.print("?action=showEchipamenteFromRaportTop10PeCauze&tipInstalatie=\'+tipInstalatie + \"&codInstalatie=\" + codInstalatie,\r\n                \'echipamenteRaport\', \'top=50,left=50,width=1000, height=550, status=yes,resizable=yes,dependent=yes,alwaysRaised=yes, scrollbars=yes\');\r\n    }\r\n\r\n    function initInstalatieSugest(){\r\n\r\n        var ajaxDataProvider = new AjaxDataProvider( function(){\r\n            var value = $(\'denInstalatie\').value;\r\n            return value.length >= 2 ? \"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(770,40);to=(770,66)]
			out.print(AppConstants.APP_NAME);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(770,66);to=(802,4)]
			out.print("?action=instalatiiSugest&q=\" : null;\r\n        });\r\n\r\n        new InputSugest( $(\"denInstalatie\"), $(\"idInstalatie\"), ajaxDataProvider, {\r\n            beforeRequest : function(){\r\n                $(\'tipInstalatie\').value = \'\';\r\n                $(\'isLF\').value = \'\';\r\n            },\r\n\r\n            onSelect : function( item){\r\n                $(\'tipInstalatie\').value = item.tipInstalatie;\r\n                $(\'isLF\').value = item.isLF;\r\n            }\r\n        });\r\n    }\r\n\r\n    var table = new Table(\'table\', \"table\");\r\n\r\n    setTimeout(\"initInstalatieSugest()\", 1000);\r\n\r\n    function categoriesChecked(){\r\n        document.zaforma.submit();\r\n    }\r\n</script>\r\n\r\n<style type=\"text/css\">\r\n    .totalCell{\r\n        font-weight: bold;\r\n    }\r\n</style>\r\n\r\n<script type=\"text/javascript\">\r\n    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(802,4);to=(802,35)]
			 if ( publicPath != null){ 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(802,35);to=(805,31)]
			out.print("\r\n\r\n        setTimeout(function(){\r\n            window.location = \'");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(805,31);to=(805,46)]
			out.print(publicPath);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(805,46);to=(808,4)]
			out.print("\';\r\n        }, 500);\r\n\r\n    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(808,4);to=(808,11)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/rapoarte/raport-top10-fe.jsp";from=(808,11);to=(809,9)]
			out.print("\r\n</script>");
// end
		} catch (ThreadDeath tde) { throw tde;
		} catch (OutOfMemoryError ome) { throw ome;
		} catch (Throwable t) {
			if (!(t instanceof SkipPageException)) {
				try {
					out.clear();
				} catch(java.io.IOException _jspioex) {}
				_jspx_pageContext.handlePageException(t);
			}
		}finally{
			_jspFactory.releasePageContext(pageContext);
		}
	}

}
