<%@ page import="ro.emid.common.types.Reclamatie" %>
<%@ page import="ro.emid.common.constants.ReclamatieConstants" %>
<%@ page import="ro.emid.common.constants.GlobalAppConstants" %>
<%@ page import="ro.emid.common.constants.AppConstants" %>


<%@ include file="declaratii.jsp"%>

<%
    final Throwable th = (Throwable) session.getAttribute("_reclamatie.error");
    final Reclamatie saved = (Reclamatie) session.getAttribute("_reclamatie.salvata");
%>

<br/>
<br/>
<br/>
<br/>

<table width="100%">
    <tr>
        <td align="center" style="font-size: 16px">

        <% if( th != null){%>
            <span style="color: red"> Eroare la salvare reclamatie: <%=th.getMessage()%> </span>
        <% } else if( saved != null){ %>
            <span> Reclamatie inregistrata cu succes sub numarul : <%=saved.getNiceNumarReclamatie()%> </span>

        <% }else{ %>

            <span>Reclamatia a fost inregistrata</span>

        <% } %>

            <br/>
            <br/>
            <input type="button" value="&nbsp;OK&nbsp;" onclick="window.location = '<%=AppConstants.APP_NAME%>?action=add-reclamatie-form'; " >


        </td>
    </tr>

</table>


<br/>
<br/>
<br/>
<br/>



<%
    session.removeAttribute("_reclamatie.error");
    session.removeAttribute("_reclamatie.salvata");
%>

<script type="text/javascript">
    //clean reclamatie din cookies
    try{
        COOKIE.eraseCookie( '<%=ReclamatieConstants.ID%>');
    }catch(e){
        alert('Eroare la stergere cookie: ' + e.message);
    }
</script>


