<%@ page import="ro.emid.common.constants.AppConstants" %>
<%@ page import="ro.emid.common.db.ActionLogger" %>
<%@ page import="ro.emid.common.db.DataDB" %>
<%@ page import="ro.emid.common.types.User" %>
<%@ page import="ro.emid.common.utils.ObjectUtils" %>
<%@ page import="ro.emid.common.utils.SessionUtils" %>
<%
    User user = SessionUtils.getUserLogat(session);
%>
Modul administrare
<br/>
<br/>

<%--Incidente--%>
<a href="<%=AppConstants.APP_NAME%>?action=show-users">Utilizatori</a>  |
<a href="<%=AppConstants.APP_NAME%>?action=show-nomenclator-instalatii">Nomenclatoare BDI</a>  |
<a href="<%=AppConstants.APP_NAME%>?action=show-nomenclator">Nomenclatoare generale</a>  |
<a href="<%=AppConstants.APP_NAME%>?action=show-volum-instalatii">Volumul de instalatii</a>  |
<a href="<%=AppConstants.APP_NAME%>?action=show-sesiuni">Sesiuni raportare</a>  |
<a href="<%=AppConstants.APP_NAME%>?action=show-ads">Constanta AD</a>  |

<%--Lpod--%>
<a href="">Proprietati</a>  |
<a href="">CE / Nivele tensiune</a>  |
<a href="">CE / Dispeceri</a>  |
<a href="">Sync AC manager</a>  |
<a href="">Mesage</a>  |
<a href="">Log-uri</a>  |

<br/>

<respmesg>
<%
try{
        final String codLF = ObjectUtils.getStringValue(request.getParameter("codLF"));
        final String codEMID    = ObjectUtils.getStringValue(request.getParameter("newCodEMID")).trim();

        final String inputId    = ObjectUtils.getStringValue(request.getParameter("inputId"));
        final String spanTextId = ObjectUtils.getStringValue(request.getParameter("spanTextId"));

        String previewCodEmid = null;
        try{
           previewCodEmid = DataDB.getCodEmidForLF( codLF);
        }catch (Exception e){
        }

        if( previewCodEmid == null || previewCodEmid.length()==0) previewCodEmid = "null";

        DataDB.saveCodEmid(codLF, codEMID);

        try{
            final String text = ':' + codLF + ", Cod Emid din <b>" + previewCodEmid + "</b> in <b>" + codEMID  + "</b>";
            ActionLogger.LogNomenclator(ActionLogger.ACTION_EDIT, user.getUsername(), text);
        }catch (Exception e){}
%>
    {
        inputId : "<%=ro.emid.common.utils.Util.escapeToJs(inputId)%>",
        spanTextId : "<%=ro.emid.common.utils.Util.escapeToJs(spanTextId)%>",
        codEMID : "<%=ro.emid.common.utils.Util.escapeToJs(codEMID)%>"
    }
<%}catch( Exception t){%>
    <%=t.getMessage()%>
<%}%>
</respmesg>


