/* 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.action.dispecer.JSP_OD;
import ro.emid.common.constants.GlobalAppConstants;
import ro.emid.common.db.CategoryODAccessDB;
import ro.emid.common.db.sqlBuilder.Filter;
import ro.emid.common.db.sqlBuilder.MatchCriteria;
import ro.emid.common.types.CategoryOD;
import ro.emid.common.types.CategoryODConstants;
import java.util.List;

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

public class JEE_jsp_WEB_2d_INF_pagelet_admin_category_alocareCentre_5f_DED_1471592526467 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-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(1,58);to=(2,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(2,64);to=(3,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(3,57);to=(5,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(5,56);to=(6,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(6,63);to=(7,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(7,52);to=(8,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(8,61);to=(9,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(9,35);to=(12,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(12,0);to=(34,2)]
			
    List filiale = null;
    //incarc lista filiale
    request.setAttribute( JSP_OD.RECORDS,
            filiale = CategoryODAccessDB.getAllCategories(
                    new Filter().
                            addCriteria(new MatchCriteria(CategoryODConstants.SQL.ID_PARENT, MatchCriteria.EQUALS, -1))
            )
    );

    for (int i = 0; i < filiale.size(); i++) {
        final CategoryOD filiala = (CategoryOD) filiale.get(i);

        filiala.setChildren(CategoryODAccessDB.getChildCategs(filiala.getId()));

        final List sucursale = filiala.getChildren();
        if( sucursale != null) for (int j = 0; j < sucursale.size(); j++) {
            final CategoryOD sucursala = (CategoryOD) sucursale.get(j);

            sucursala.setChildren(CategoryODAccessDB.getChildCategs(sucursala.getId()));
        }
    }

// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(34,2);to=(51,16)]
			out.print("\r\n\r\n<table width=\"99%\">\r\n    <tr>\r\n        <td colspan=\"2\">\r\n            <b>Alocare Centre exploatare pe Dispceri</b>\r\n        </td>\r\n    </tr>\r\n    <tr valign=\"top\">\r\n        <td width=\"50%\">\r\n            <table cellpadding=2 cellspacing=1 width=\"100%\" class=\"table\" >\r\n                <thead>\r\n                    <tr>\r\n                        <th colspan=2 height=25 nowrap>Structura dispeceri:</th>\r\n                    </tr>\r\n                </thead>\r\n                <tbody>\r\n                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(51,16);to=(52,67)]
			
                    if (null == filiale || filiale.size() == 0) {
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(52,67);to=(58,16)]
			out.print("\r\n                        <TR>\r\n                            <TD>\r\n                                No Sunt filiale definite ...\r\n                            </TD>\r\n                        </TR>\r\n                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(58,16);to=(60,87)]
			} else {
                    for( int i = 0; i < filiale.size(); i++) {
                        final CategoryOD itemFiliala = (CategoryOD) filiale.get( i); 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(60,87);to=(64,32)]
			out.print("\r\n                        <tr class=\"filiala\" valign=\"middle\" onclick=\" showCentreDed( -1);\">\r\n                            <td></td>\r\n                            <TD width=\"100%\">\r\n                                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(64,32);to=(64,58)]
			out.print(itemFiliala.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(64,58);to=(68,24)]
			out.print("\r\n                            </TD>\r\n                        </tr>\r\n\r\n                        ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(68,24);to=(71,98)]
			
                            final List sucursale = itemFiliala.getChildren();
                            if( sucursale != null && sucursale.size() > 0) for (int j = 0; j < sucursale.size(); j++) {
                                final CategoryOD itemSucursala = (CategoryOD) sucursale.get(j); 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(71,98);to=(72,79)]
			out.print("\r\n                                <tr class=\"sucursala\" onclick=\" showCentreDed( ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(72,79);to=(72,105)]
			out.print(itemSucursala.getId());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(72,105);to=(75,40)]
			out.print("); \">\r\n                                    <td></td>\r\n                                    <td style=\"padding-left:20px\">\r\n                                        ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(75,40);to=(75,68)]
			out.print(itemSucursala.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(75,68);to=(79,32)]
			out.print("\r\n                                    </td>\r\n                                </tr>\r\n\r\n                                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(79,32);to=(84,34)]
			
                                    final List centre = itemSucursala.getChildren();
                                    if( centre != null && centre.size() > 0) for (int k = 0; k < centre.size(); k++) {
                                        final CategoryOD itemCentru = (CategoryOD) centre.get( k);

                                
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(84,34);to=(85,76)]
			out.print("\r\n                                <tr class=\"centru\" onclick=\" showCentreDed( ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(85,76);to=(85,99)]
			out.print(itemCentru.getId());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(85,99);to=(88,40)]
			out.print("); \">\r\n                                    <td></td>\r\n                                    <td style=\"padding-left:40px\">\r\n                                        ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(88,40);to=(88,65)]
			out.print(itemCentru.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(88,65);to=(91,32)]
			out.print("\r\n                                    </td>\r\n                                </tr>\r\n                                ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(91,32);to=(93,34)]
			
                                        }
                                
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(93,34);to=(95,32)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(95,32);to=(97,34)]
			
                                        }
                                
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(97,34);to=(98,32)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(98,32);to=(98,37)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(98,37);to=(99,16)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(99,16);to=(99,21)]
			}
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(99,21);to=(124,30)]
			out.print("\r\n                </tbody>\r\n            </table>\r\n        </td>\r\n\r\n        <td id=\"centrele\" >\r\n\r\n            \r\n        </td>\r\n\r\n\r\n\r\n    </tr>\r\n</table>\r\n\r\n\r\n<script type=\"text/javascript\">\r\n    function showCentreDed( idDed){\r\n\r\n        $(\"centrele\").innerHTML = \"\";\r\n\r\n        if( idDed == -1){\r\n            $(\"centrele\").innerHTML = \"Fara centre alocate\";\r\n        }else{\r\n            var params = \"idDed=\"+idDed;\r\n            new Ajax.Request(\'");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(124,30);to=(124,62)]
			out.print(GlobalAppConstants.APP_NAME);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/admin/category/alocareCentre_DED.jsp";from=(124,62);to=(134,0)]
			out.print("?action=getCentreForDed\',{\r\n                method: \'post\',\r\n                parameters: params,\r\n                onComplete: function ( originalRequest){\r\n                    $(\"centrele\").innerHTML = getResponseMesg( originalRequest.responseText);\r\n                }\r\n            });\r\n        }\r\n    }\r\n</script>\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);
		}
	}

}
