<%@ language="javascript"%>
<% /*
     $Revision$
     $Id$
*/ %>
<%
    function cent(amount) {
    // returns the amount in the .99 format
        amount -= 0;
        amount = (Math.round(amount*100))/100;
        return (amount == Math.floor(amount)) ? amount + '.00' : (  (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
    }
   %>
<!--#include file="../../appl/Shared/common.inc"-->
<% FCLTHeader.Set({root: "../../appl/"}); %>
<!--#include file="../../appl/Shared/iface.inc"-->
<!-- #include file="../../appl/Shared/funcodes.inc" -->
<%
if( func_enabled[ "WEB_RELMAN"] ) {
%>
<script type="text/javascript">

function conn_DoContract(cid)
{
    cwnd = window.open('../../cust/conn/contract_info.asp?cid='+cid, 'ContractInfo',
         "width=768, height=500, directories=no,location=no,menubar=no,"
       + "resizable=yes,status=no,titlebar=yes,toolbar=no,scrollbars=yes");
    cwnd.focus();
}

</script>

<%

var alg_locatie_key = getQParamInt('lkey');
var sql,oRs;
var obj_name;
FACPageTitle = L("lcl_obj_info_title");
%>

<html>
<head>
<%       FCLTHeader.Generate(); %>
</head>

<%

var names = new Array();
max_i=0;
names[max_i++] = "Complex";
names[max_i++] = L("lcl_obj_inf_room");
names[max_i++] = L("lcl_opp");
names[max_i++] = L("lcl_covering");
names[max_i++] = L("lcl_descr");
names[max_i++] = "Bedrijf";
names[max_i++] = "Dicht per";
names[max_i++] = "Open per";
names[max_i++] = "Kengetal";
names[max_i++] = "Totaal";
names[max_i++] = "(Toeslag)";
names[max_i++] = "Programma";
names[max_i++] = "Freq.";
names[max_i++] = "Dicht";

sql  = " SELECT COMPLEX, ";
sql += "        GEBOUW||'-'|| TO_CHAR(verdieping)||'-'||ruimte Ruimtenr,";
sql += "        OPPERVLAKTE, VLOERSOORT, OMSCHRIJVING, ";
sql += "        SCHOON, RUIMTE_DICHT_DATUM, RUIMTE_OPEN_DATUM, ";
sql += "        KENGETAL, TOT_RUIMTE_BEDRAG, TOESLAG_BEDRAG, PROGRAMMA, FREQUENTIE, ";
sql += "        SCH_DICHT";
sql += "   FROM CONN_V_SCHOONGEG2  ";
sql += "      WHERE alg_locatie_key = " + alg_locatie_key;
sql += "        AND OPPERVLAKTE IS NOT NULL";
sql += "   ORDER BY Ruimtenr                                                                                                                                                              "

%>
<body class="modal">


<%
oRs=Oracle.Execute(sql);
if (oRs.eof)
{
  Response.Write(L("lcl_object_not_found"));
  Response.End();
}
oRsL=Oracle.Execute("SELECT * FROM CONN_V_SCHOON_LOC_GEG WHERE alg_locatie_key = " + alg_locatie_key);
%>

<table id='conntable' width='100%'>
<TR><TD width="50%"><TABLE>
<tr><td class="label"><label>Complexcode:</label></td><td><%=oRsL("Complex")%></td></tr>
<tr><td class="label"><label>Complexnaam:</label></td><td><%=oRsL("Complexnaam")%></td></tr>
<tr><td class="label"><label>Toeslag (%):</label></td><td><%=oRsL("TOESLAG")%></td></tr>
<tr><td class="label"><label>Datum afsluiten locatie:</label></td><td><%=oRsL("LOC_DICHT_DATUM")%></td></tr>
<tr><td class="label"><label>Fin. datum afsluiten:</label></td><td><%=oRsL("LOC_FIN_DICHT_DATUM")%></td></tr>
<tr><td class="label"><label>Bedrag:</label></td><td><%=cent(oRsL("TOT_RUIMTE_BEDRAG"))%></td></tr>
<tr><td class="label"><label>(Toeslag:)</label></td><td><%=cent(oRsL("TOESLAG_BEDRAG"))%></td></tr>
<tr><td class="label"><label>Opmerking:</label></td><td><pre style="font-family: Verdana"><%=oRsL("OPMERKING")%></pre></td></tr>
</TABLE></TD>
<TD valign="top"><TABLE>
<tr><td class="label"><label>Opp. glas kantoor:</label></td><td><%=oRsL("GLAS_KANTOOR")%></td></tr>
<tr><td class="label"><label>Opp. glas stalling:</label></td><td><%=oRsL("GLAS_STALLING")%></td></tr>
<tr><td class="label"><label>Opp. tegelwerk:</label></td><td><%=oRsL("TEGELWERK")%></td></tr>
<tr><td class="label"><label>Aantal overheaddeuren:</label></td><td><%=oRsL("OVERHEADDEUREN")%></td></tr>
<tr><td class="label"><label>Mantelobject:</label></td><td><%=oRsL("MANTELOBJECT")%></td></tr>
</TABLE></TD></TR>
<tr><td colspan="2" align="center"><h3>Info indien schoonmaak op locatieniveau</h3></td></tr>
<tr><td class="label"><label>Bestek:</label></td><td><%=oRsL("BESTEK")%></td></tr>
<tr><td class="label"><label>Schoonmaakbedrijf:</label></td><td><%=oRsL("SCHOON")%></td></tr>
<tr><td class="label"><label>Schoonmaakprogramma:</label></td><td><a title="Klik voor schoonmaakprogramma" href="../../cust/conn/Schoonmaak/Schoon - <%= oRsL("PROGRAMMA")%>.htm" target=_new><%=oRsL("PROGRAMMA")%></a></td></tr>
<tr><td class="label"><label>Frequentie:</label></td><td><%=oRsL("FREQUENTIE")%></td></tr>
<tr><td class="label"><label>Kengetal:</label></td><td><%=oRsL("KENGETAL")%></td></tr>
<tr><td class="label"><label>Oppervlakte:</label></td><td><%=oRsL("OPPERVLAKTE")%></td></tr>
</table>
<%oRsL.close();%>
<p>
<table class="rstable" id='conntable' width='100%'>
<tr>
<td valign=top>
         <table cellpadding="0" cellspacing="0" width='100%' >

         <tr><thead>
         <%
                for( i=1 ; i < max_i ; i++ ){
         %>
                        <th><%=names[i]%></th>
         <%
                }
         %></thead>
         </tr>

         <%
            if( sql != "" ){
                oRs = Oracle.Execute(sql);
                var count = 0;
                var sumTot = 0;
                while( !oRs.eof ){
         %>
         <tr>
         <%
                for( i=1 ; i < max_i ; i++ ){
                if (i==9||i==10)
                    txt=cent(oRs(i));
                else
                    if (i==max_i-1)
                        txt=oRs(i)=="1"?"Dicht":"";
                    else
                        txt=oRs(i);
         %>
                         <td <% if (i>=8||i==2) {%> align=right <%}%>
                             <% if (oRs("SCH_DICHT")=="1") {%> style="color:#FF6060" <%}%> class="nowrap">
                             <%=txt%>
                         </td>
         <%      }
                 sumTot += 0+(oRs("TOT_RUIMTE_BEDRAG"));
                 oRs.MoveNext();
         %>
         </tr>

         <%
              }
            oRs.Close();
            }
         %>
         <tr><td colspan="12" class="label"><label>Totaal contract:</label></td><td align=right>&euro;&nbsp;<%=cent(sumTot)%></td></tr>
         </table>
</td>

</tr>
</table>

</body>
</html>
<% } else { %>
<html>
<%       FCLTHeader.Generate(); %>
<body>
<p><%=L("lcl_no_auth")%></p>
<% } %>

</body>
</html>
