<%@ page import="ro.emid.callcenter.obj.CityChanges" %>
<%@ page import="ro.emid.callcenter.obj.StreetChanges" %>

<respmesg>
<%
    CityChanges[] resultCity = (CityChanges[]) request.getAttribute("resultCity");
    StreetChanges[] resultStreet = (StreetChanges[]) request.getAttribute("resultStreet");


%>

<span class="bold">Lista localitati</span>

<%if (resultCity != null && resultCity.length > 0){
%>

<table>
   <thead>
    <th width="30%" align="left">Localitate</th>
    <th width="25%" align="left">Tip modificare</th>
    <th width="25%" align="left">Status</th>
    <th width="40%" align="left">Descriere</th>
   </thead>
    <tbody>
    <%for(int i=0; i<resultCity.length; i++){
        CityChanges city = (CityChanges) resultCity[i];
    %>
    <tr>
        <%
            String tipModificare = "";
            if ("I".equals(city.getTipModificare())) tipModificare = "Insert";
            else if ("U".equals(city.getTipModificare())) tipModificare = "Update";
            else if ("E".equals(city.getTipModificare())) tipModificare = "Eroare";
        %>
        <%
            String status = "";
            if ("S".equals(city.getStatus())) status = "Succes";
            else if ("E".equals(city.getStatus())) status = "Eroare";
        %>
        <td align="left"><%=city.getDenLocalitate()%></td>
        <td align="left"><%=tipModificare%></td>
        <td align="left"><%=status%></td>
        <td align="left"><%=city.getDescriere()%></td>
    </tr>
    <%}%>

    </tbody>

</table>
<%}else{
%>
    Nu exista inregistrari...

<%}%>

<br>

<span class="bold">Lista strazi</span>
    <%
        if (resultStreet != null && resultStreet.length > 0){
    %>


    <table>
        <thead>
        <th width="35%" align="left">Strada</th>
        <th width="25%" align="left">Tip modificare</th>
        <th width="25%" align="left">Status</th>
        <th width="40%" align="left">Descriere</th>
        </thead>
        <tbody>
        <%for(int i=0; i<resultStreet.length; i++){
            StreetChanges street = (StreetChanges) resultStreet[i];
        %>
        <tr>
            <%
                String tipModificare = "";
                if ("I".equals(street.getTipModificare())) tipModificare = "Insert";
                else if ("U".equals(street.getTipModificare())) tipModificare = "Update";
                else if ("E".equals(street.getTipModificare())) tipModificare = "Eroare";
            %>
            <%
                String status = "";
                if ("S".equals(street.getStatus())) status = "Succes";
                else if ("E".equals(street.getStatus())) status = "Eroare";
            %>
            <td align="left"><%=street.getDenStrada()%></td>
            <td align="left"><%=tipModificare%></td>
            <td align="left"><%=status%></td>
            <td align="left"><%=street.getDescriere()%></td>
        </tr>
        <%}%>

        </tbody>

    </table>
    <%}else{
    %>
    Nu exista inregistrari...

    <%}%>
</respmesg>

