<%@ page import="ro.emid.common.types.SetValue" %>
<%@ page import="java.util.Map" %>
<%@ page import="ro.emid.common.utils.StringUtils" %>
<%@ page import="ro.emid.common.constants.AppConstants" %>

<%
    final SetValue item = (SetValue) request.getAttribute("item");

    final Map errors = (Map) request.getAttribute("errors");
%>

<TABLE cellSpacing=1 cellPadding=5 width="100%">
    <TR>
        <TD>
            <TABLE class=gSAPTHEAD cellSpacing=1 cellPadding=2 width="100%" border=0>
                <tr>
                    <td align="left">
                        <span style="FONT-WEIGHT: bold; FONT-SIZE: 16px;"> Editare nomenclator:</span>
                    </td>
                </tr>
            </TABLE>
            <form name="zaforma" action="<%=AppConstants.APP_NAME%>" method="post">
                <input type="hidden" name="action" value="saveSetValue">
                <input type="hidden" name="id" value="<%=item.getId()%>">
                <input type="hidden" name="tip" value="<%=item.getTip()%>">

                <table>
                    <tr>
                        <td>Tip:</td>
                        <td>
                            <%=SetValue.getTipName( item.getTip())%>
                            <% if( errors != null && errors.get("tip") != null ) { %> <span style="color:red"><%=errors.get("tip")%></span> <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>Cod:</td>
                        <td>
                            <input type="text" class="gsapinputtext" size="50" autocomplete="off" name="cod" value="<%=AppConstants.format( item.getCod())%>">

                            <% if( errors != null && errors.get("cod") != null ) { %> <span style="color:red"><%=errors.get("cod")%></span> <% } %>
                        </td>
                    </tr>
                    <tr>
                        <td>Descriere:</td>
                        <td>
                            <input type="text" class="gsapinputtext" size="50" autocomplete="off" name="valoare" value="<%=AppConstants.format( item.getValoare())%>">

                            <% if( errors != null && errors.get("valoare") != null ) { %> <span style="color:red"><%=errors.get("valoare")%></span> <% } %>
                        </td>
                    </tr>
                    <tr>
                        <td ></td>
                        <td>
                            <input type="submit" value="Salveaza"> &nbsp;
                            <input type="button" value="Renunta" onclick="window.location = '<%=AppConstants.APP_NAME%>?action=showSetValue&tip=<%=item.getTip()%>'">
                        </td>
                    </tr>
                </table>
            </form>
        </TD>
    </TR>
</TABLE>