/* 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 ro.emid.common.utils.ObjectUtils;
import ro.emid.common.db.CategoryAccessDB;
import ro.emid.common.types.Eveniment;
import ro.emid.incidente.db.EvenimentAccessDB;
import ro.emid.common.types.Category;
import ro.emid.incidente.IncidenteSessionUtils;
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 javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public class JEE_jsp_WEB_2d_INF_pagelet_incidente_selectareCentru_1495030452458 extends com.sap.engine.services.servlets_jsp.lib.jspruntime.JspBase{

	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/incidente/selectareCentru.jsp";from=(1,53);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/selectareCentru.jsp";from=(2,55);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/selectareCentru.jsp";from=(3,51);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/selectareCentru.jsp";from=(4,59);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/selectareCentru.jsp";from=(5,50);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/selectareCentru.jsp";from=(6,60);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/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/incidente/selectareCentru.jsp";from=(8,48);to=(10,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(10,0);to=(10,48)]
			 if (request.getAttribute("close") !=null) {
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(10,48);to=(12,25)]
			out.print("\r\n    <script type=\"text/javascript\">\r\n        opener.location=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(12,25);to=(12,51)]
			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/incidente/selectareCentru.jsp";from=(12,51);to=(15,0)]
			out.print("?action=showEvenimente\";\r\n        window.close();\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/incidente/selectareCentru.jsp";from=(15,0);to=(15,5)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(15,5);to=(17,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(17,0);to=(23,2)]
			
    final long idSucursala = IncidenteSessionUtils.getSucursalaId(session);
    final Category[] centre = CategoryAccessDB.getAllCategoriesByParentId(idSucursala);
    final long evenimentId = ObjectUtils.getLongValue(request.getParameter("evenimentId"), -1);

    final Eveniment evenimentu = EvenimentAccessDB.getById( evenimentId);

// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(23,2);to=(32,48)]
			out.print("\r\n\r\n\r\n<TABLE class=\"gsapthead\" align=center border=0 cellPadding=10 cellSpacing=0 width=\"100%\">\r\n    <TBODY>\r\n        <TR>\r\n            <TD>\r\n                <TABLE align=center border=0 cellPadding=5 cellSpacing=0 width=\"100%\" class=\"gsaptd\">\r\n                <tr><td>\r\n                    Ati selectat evenimentul <b>");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(32,48);to=(32,73)]
			out.print(evenimentu.getText());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(32,73);to=(32,92)]
			out.print("</b> cu numarul <b>");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(32,92);to=(32,122)]
			out.print(evenimentu.getNrComanda());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(32,122);to=(34,77)]
			out.print("</b><br>\r\n                    Unde doriti sa trimiteti evenimentul?\r\n                    <form name=\"zaforma\" style=\"padding:0; margin:5\" action=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(34,77);to=(34,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/incidente/selectareCentru.jsp";from=(34,103);to=(36,71)]
			out.print("\" method=\"post\">\r\n                        <input type=\"hidden\" name=\"action\" value=\"changeCentruForEveniment\">\r\n                        <input type=\"hidden\" name=\"evenimentId\" value=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(36,71);to=(36,87)]
			out.print(evenimentId);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(36,87);to=(40,28)]
			out.print("\">\r\n\r\n                        <select name=\"codFormatie\">\r\n                            <option value=\"\">Selectati:</option>\r\n                            ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(40,28);to=(41,70)]
			for (int i = 0; i < centre.length; i++) {
                                final Category category = centre[i];
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(41,70);to=(42,49)]
			out.print("\r\n                                <optgroup label=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(42,49);to=(42,72)]
			out.print(category.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(42,72);to=(43,36)]
			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/incidente/selectareCentru.jsp";from=(43,36);to=(43,133)]
			 final Category[] formatii = CategoryAccessDB.getAllCategoriesByParentId( category.getId()); 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(43,133);to=(44,36)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(44,36);to=(45,81)]
			 for (int j = 0; j < formatii.length; j++) {
                                        final Category formatia = formatii[j]; 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(45,81);to=(46,55)]
			out.print("\r\n                                        <option value=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(46,55);to=(46,80)]
			out.print(formatia.getCodSap());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(46,80);to=(46,82)]
			out.print("\">");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(46,82);to=(46,105)]
			out.print(formatia.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(46,105);to=(47,36)]
			out.print("</option>\r\n                                    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(47,36);to=(47,41)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(47,41);to=(49,28)]
			out.print("\r\n                                </optgroup>\r\n                            ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(49,28);to=(49,33)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-incidente/servlet_jsp/emid-incidente/root/WEB-INF/pagelet/incidente/selectareCentru.jsp";from=(49,33);to=(65,0)]
			out.print("\r\n                        </select>\r\n\r\n                        <br> <br>\r\n                        <input type=\"submit\" value=\"Trimite\" />  &nbsp;&nbsp;\r\n                        <input type=\"button\" value=\"Renunta\" onclick=\"window.close()\" />\r\n\r\n                    </form>\r\n                    </td></tr>\r\n                    </TABLE></td>\r\n            </TR>\r\n        </TBODY>\r\n    </TABLE>\r\n\r\n\r\n\r\n");
// 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);
		}
	}

}
