<%@ page import="ro.emid.common.constants.GlobalAppConstants" %>
<%@ page import="ro.emid.common.utils.RequestUtils" %>
<%@ page import="ro.emid.common.db.LucrareLogDB" %>
<%@ page import="ro.emid.common.logger.LucrareProgramataLog" %>
<%@ page import="ro.emid.administrare.util.logger.BeanUtils" %>


<%
    final long idLog1 = RequestUtils.getLong( request, "idLog1", -1);
    final long idLog2 = RequestUtils.getLong( request, "idLog2", -1);


    final LucrareProgramataLog log1 = LucrareLogDB.getById( idLog1);
    final LucrareProgramataLog log2 = LucrareLogDB.getById( idLog2);

%>

<%! private static final String [] IGNORED_FIELDS = new String[]{
        "id", "dataOperatie", "userUpdate", "dataUpdate"
}; %>

<respmesg>
    <% if( log1 != null && log2 != null){ %>

        <%
            final BeanUtils.Difference[] differences = BeanUtils.getDifferences( log1, log2, IGNORED_FIELDS);

            if( differences != null && differences.length > 0) for (int i = 0; i < differences.length; i++) {
                final BeanUtils.Difference dif = differences[i];

                %>
                    <li><b><%=dif.getField()%> </b>: <%=GlobalAppConstants.format(dif.getV1(), "")%> -> <%=GlobalAppConstants.format(dif.getV2(), "")%></li>
                <%
            }else{ %>

                Fara modificari ...

        <%  } %>
        
    <% } else { %>
        Nu exista date ...
    <% } %>
</respmesg>

