<%@ page import="ro.emid.common.types.OrdinServiciu" %>
<%@ page import="ro.emid.common.constants.AppConstants" %>
<%@ page import="ro.emid.callcenter.util.CallcenterHelper" %>
<%@ page import="ro.emid.common.utils.DateUtils" %>
<%@ page import="java.util.List" %>

<%
        /**
         * @see ro.emid.callcenter.i10n.action.ShowOrdineServiciuAction
         */
    final List<OrdinServiciu> ordineServiciu = (List<OrdinServiciu>) request.getAttribute("list");
%>

<respmesg>
    <%
        if (CallcenterHelper.isIntegratedWithOpen()){
    %>
    <TABLE id="ordine" border=0 cellPadding=2 cellSpacing=1 width="100%" class="gSAPTHEAD" style="BACKGROUND-COLOR: white; margin-top:5px">
        <TR noSelect="true">
            <TH class="gsapthead" height=25 noWrap>&nbsp;Nr. OS.:&nbsp;</TH>
            <TH class="gsapthead" noWrap >&nbsp;Tip:&nbsp;</TH>
            <TH class="gsapthead" noWrap >&nbsp;Stare:&nbsp;</TH>
            <TH class="gsapthead" noWrap >&nbsp;Dat.est.rezolv.:&nbsp;</TH>
            <TH class="gsapthead" noWrap >&nbsp;D.Starii:&nbsp;</TH>
        </TR>

        <% if( ordineServiciu == null || ordineServiciu.size() == 0){%>
            <tr><td colspan="5" noSelect="true">Nu exista date.</td></tr>
        <% } else for (final OrdinServiciu ordinServiciu : ordineServiciu) { %>
                <tr>
                    <td><%=ordinServiciu.getCodOrden()%></td>
                    <td><%=ordinServiciu.getTip()%></td>
                    <td><%=ordinServiciu.getStare()%></td>
                    <td><%=AppConstants.formatx(ordinServiciu.getDEstRez())%></td>
                    <td><%=AppConstants.formatx(ordinServiciu.getDStare())%></td>
                </tr>
        <% }%>
    </TABLE>
    <%}
        else {
    %>

    <TABLE id="ordine" border=0 cellPadding=2 cellSpacing=1 width="100%" class="gSAPTHEAD" style="BACKGROUND-COLOR: white; margin-top:5px">
        <TR noSelect="true">
            <TH class="gsapthead" height=25 noWrap>&nbsp;Nr. comanda:&nbsp;</TH>
            <TH class="gsapthead" noWrap >&nbsp;Tip comanda:&nbsp;</TH>
            <TH class="gsapthead" noWrap >&nbsp;Descriere:&nbsp;</TH>
            <TH class="gsapthead" noWrap >&nbsp;Tip proces:&nbsp;</TH>
            <TH class="gsapthead" noWrap >&nbsp;Data creare:&nbsp;</TH>
            <TH class="gsapthead" noWrap >&nbsp;Stare sistem:&nbsp;</TH>
            <TH class="gsapthead" noWrap >&nbsp;Stare utilizator:&nbsp;</TH>
            <TH class="gsapthead" noWrap >&nbsp;D.Start baza:&nbsp;</TH>
            <TH class="gsapthead" noWrap >&nbsp;D.Final.baza:&nbsp;</TH>
        </TR>

        <% if( ordineServiciu == null || ordineServiciu.size() == 0){%>
        <tr><td colspan="10" noSelect="true">Nu exista date.</td></tr>
        <% } else for (final OrdinServiciu ordinServiciu : ordineServiciu) { %>
            <tr>
                <td><%=ordinServiciu.getNrComanda()%></td>
                <td><%=ordinServiciu.getTipComanda()%></td>
                <td><%=ordinServiciu.getDescriere()%></td>
                <td><%=ordinServiciu.getTipProces()%></td>
                <td><%=DateUtils.format(ordinServiciu.getDataCreare(), DateUtils.RO.ONLY_DATE_FORMAT)%></td>
                <td><%=ordinServiciu.getStareSistem()%></td>
                <td><%=ordinServiciu.getStareUtilizator()%></td>
                <td><%=DateUtils.format(ordinServiciu.getDataStartBaza(), DateUtils.RO.ONLY_DATE_FORMAT)%></td>
                <td><%=DateUtils.format(ordinServiciu.getDataFinalizareBaza(), DateUtils.RO.ONLY_DATE_FORMAT)%></td>
            </tr>
        <% }%>
    </TABLE>


    <%}%>
</respmesg>