<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt">
  <xsl:import href="../../../appl/shared/default.xsl"/>
  <xsl:variable name="Rev">
    <!-- Revision van deze cust.xsl -->
    <xsl:value-of select="substring(translate('$Revision$', '$ ', ''), 10)"/>
  </xsl:variable>

	<xsl:variable name="Xsrtnotificatiecode">MLDAFM</xsl:variable>

  <xsl:template name="stylesheet">
    <style>
    body {
       font-family: Verdana;
       background-color: rgb(255, 255, 255);
       margin-left:8px;
       margin-top:8px;
       cursor: auto;
       color: #000;
       font-size: 9pt;
    }

    table {
      border: 0;
    }

    table.details {
      background-color: #31398C;
    }

    th {
      font-family: Verdana;
      font-size: 9pt;
      font-weight: normal;
      color: #ffffff;
      text-decoration: none;
      padding-left: 3px;
      padding-right: 3px;
      padding-top: 3px;
      padding-bottom: 3px;
      background-color: #31398C;
    }

    th.resth {
      font-family: Verdana;
      font-size: 9pt;
      font-weight: normal;
      color: #000;
      text-decoration: none;
      padding-left: 3px;
      padding-right: 3px;
      padding-top: 3px;
      padding-bottom: 3px;
      background-color: #fff;
    }

    td, p {
      font-family: Verdana;
      font-style: normal;
      font-size: 8pt;
      font-weight: normal;
      color: #000000;
      text-align: left;
      vertical-align: top;
    }

    td.result {
      text-decoration: none;
      padding-bottom: 2px;
      padding-top: 2px;
      padding-left: 2px;
      padding-right: 2px;
      background-color: #D6D8E8;
    }

    td.resresult {
      text-decoration: none;
      padding-bottom: 2px;
      padding-top: 2px;
      padding-left: 2px;
      padding-right: 2px;
      background-color: #fff;
    }

    td.sec_heading {
      font-size: 9pt;
      text-decoration: none;
      padding-bottom: 2px;
      padding-top: 2px;
      padding-left: 2px;
      padding-right: 2px;
      text-align: left;
      background-color: #d0d0d0;
    }

    td.caption {
      font-size: 18pt;
      padding-bottom: 30px;
      padding-top: 40px;
    }

    td.subcaption {
      font-size: 10pt;
      font-weight: bold;
      text-decoration: underline;
    }

    td.label {
      font-size: 10pt;
    }

    td.value {
      font-style: italic;
      font-size: 10pt;
    }

    td.tekst {
      font-size: 10pt;
    }

    td.adres {
      font-size: 8pt;
      text-align: right;
    }

    td.tekstkop {
      font-weight: bold;
      font-size: 10pt;
    }

    td.tiny {
      font-size: 6pt;
      text-align: right;
    }

    .fatal {
       background-color: red;
       color: white;
       font-weight: bold;
       padding-left: 2px;
       padding-right: 2px;
    }
    </style>
  </xsl:template>

  <xsl:template name="pageheader">
    <table border="0" width="100%">
      <tr>
        <td width="34%">
          <xsl:choose>
            <xsl:when test="$mode='email'">
              <img src="cid:tmpl_logo.gif"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:element name="img">
                <xsl:attribute name="src">../../cust/<xsl:value-of select="//header/custId"/>/tmpl_logo.gif</xsl:attribute>
              </xsl:element>
            </xsl:otherwise>
          </xsl:choose>
        </td>
        <td width="33%"></td>
        <td width="33%" style="text-align:right">
          <b><xsl:value-of select="//lcl/FAC/printdatum"/>:&#xA0;</b><xsl:value-of select="//header/dateTime"/>
        </td>
      </tr>
    </table>
  </xsl:template>

  <xsl:template match="melding" mode="include">
    <xsl:variable name="slatijd">
      <xsl:choose>
        <xsl:when test="uitvoertijd[@eenheid='U']"><xsl:value-of select="uitvoertijd"/>&#xA0;<xsl:value-of select="//lcl/MLD/uren"/></xsl:when>
        <xsl:otherwise><xsl:value-of select="uitvoertijd"/>&#xA0;<xsl:value-of select="//lcl/FAC/dagen"/></xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <table border="0" width="100%">
      <tr>
        <td colspan="4">
          <xsl:choose>
            <xsl:when test="$srtnotificatiecode='MLDACP'">
<br/><br/>Beste <xsl:value-of select="voor/naam_friendly"/>,
<br/><br/>Hartelijk dank voor het registreren van je melding. De melding is in goede orde ontvangen en wordt door ons in behandeling genomen.
            </xsl:when>
            <xsl:when test="$srtnotificatiecode='MLDAFM'">
<br/><br/>Beste <xsl:value-of select="voor/naam_friendly"/>,
<br/><br/>Je melding is door ons afgehandeld. Hieronder tref je een korte beschrijving aan.
            </xsl:when>
            <xsl:otherwise/>
          </xsl:choose>
        </td>
      </tr>
      <tr>
        <td colspan="2" class="caption" style="padding-top:20px;padding-bottom:20px">
          <b><xsl:value-of select="//lcl/MLD/melding"/>&#160;<xsl:value-of select="discipline/srtdiscipline/prefix"/><xsl:value-of select="key"/></b>
        </td>
        <td colspan="2" class="caption" style="padding-top:20px;padding-bottom:20px">
          <xsl:if test="spoed&lt;3"><b><xsl:value-of select="//lcl/MLD/spoed"/></b></xsl:if>
        </td>
      </tr>
      <tr>
        <td width="18%"><br/><b><xsl:value-of select="//lcl/FAC/aanvrager"/>:</b></td>
        <td width="32%"><br/><xsl:value-of select="voor/naam_friendly"/> </td>
        <td width="18%"><br/><b><xsl:value-of select="//lcl/FAC/telefoon"/>:</b></td>
        <td width="32%"><br/><xsl:choose><xsl:when test="voor/telefoonnr!=''"><xsl:value-of select="voor/telefoonnr"/></xsl:when><xsl:otherwise><xsl:value-of select="voor/mobiel"/></xsl:otherwise></xsl:choose></td>
      </tr>
      <tr>
        <td colspan="2"/>
        <td><b><xsl:value-of select="//lcl/FAC/afdeling"/>:</b></td>
        <td><xsl:value-of select="voor/afdeling/omschrijving"/></td>
      </tr>
      <tr><td colspan="4"><hr/></td></tr>
      <tr>
        <td><b><xsl:value-of select="//lcl/FAC/locatie"/>:</b></td>
        <td><xsl:value-of select="plaats/regio/district/locatie/code"/> (<xsl:value-of select="plaats/regio/district/locatie/omschrijving"/>)</td>
        <td><b><xsl:value-of select="//lcl/MLD/status"/>:</b></td>
        <td><xsl:value-of select="status"/></td>
      </tr>
      <tr>
        <xsl:choose>
          <xsl:when test="plaats/@type='T'">
            <td><b><xsl:value-of select="//lcl/FAC/terrein"/>:</b></td>
            <td>
              <xsl:value-of select="plaats/regio/district/locatie/terrein/code"/>&#xA0;
              <xsl:if test="plaats/regio/district/locatie/terrein/naam!=''">(<xsl:value-of select="plaats/regio/district/locatie/terrein/naam"/>)</xsl:if>
            </td>
          </xsl:when>
          <xsl:otherwise>
            <td><b><xsl:value-of select="//lcl/FAC/gebouw"/>:</b></td>
            <td>
              <xsl:value-of select="plaats/regio/district/locatie/gebouw/code"/>&#xA0;
              <xsl:if test="plaats/regio/district/locatie/gebouw/naam!=''">(<xsl:value-of select="plaats/regio/district/locatie/gebouw/naam"/>)</xsl:if>
            </td>
          </xsl:otherwise>
        </xsl:choose>
        <td><b><xsl:value-of select="//lcl/MLD/melddatum"/>:</b></td>
        <td><xsl:value-of select="gemeld/datum"/>&#xA0;<xsl:value-of select="gemeld/tijd"/></td>
      </tr>
      <tr>
        <xsl:choose>
          <xsl:when test="plaats/regio/district/locatie/gebouw/verdieping!=''">
            <td><b><xsl:value-of select="//lcl/FAC/bouwlaag"/>:</b></td>
            <td><xsl:value-of select="plaats/regio/district/locatie/gebouw/verdieping/code"/></td>
          </xsl:when>
          <xsl:otherwise><td colspan="2"/></xsl:otherwise>
        </xsl:choose>
        <td><b><xsl:value-of select="//lcl/MLD/uitvoertijd"/>:</b></td>
        <td><xsl:value-of select="$slatijd"/></td>
      </tr>
      <tr>
        <xsl:choose>
          <xsl:when test="plaats/regio/district/locatie/gebouw/verdieping/ruimte!=''">
            <td><b><xsl:value-of select="//lcl/FAC/ruimte"/>:</b></td>
            <td>
              <xsl:value-of select="plaats/regio/district/locatie/gebouw/verdieping/ruimte/nr"/>&#xA0;
              <xsl:if test="plaats/regio/district/locatie/gebouw/verdieping/ruimte/omschrijving!=''">(<xsl:value-of select="plaats/regio/district/locatie/gebouw/verdieping/ruimte/omschrijving"/>)</xsl:if>
            </td>
          </xsl:when>
          <xsl:otherwise><td colspan="2"/></xsl:otherwise>
        </xsl:choose>
        <td><b><xsl:value-of select="//lcl/MLD/datum_gereed"/>:</b></td>
        <td><xsl:value-of select="datum_gepland/datum"/>&#xA0;<xsl:value-of select="datum_gepland/tijd"/></td>
      </tr>
      <tr><td colspan="4"><hr/></td></tr>
      <tr>
        <td><b><xsl:value-of select="//lcl/MLD/stdmelding"/>:</b></td>
        <td><xsl:value-of select="stdmelding/omschrijving"/></td>
        <td><b><xsl:value-of select="//lcl/MLD/vakgroep"/>:</b></td>
        <td><xsl:value-of select="discipline/omschrijving"/></td>
      </tr>
      <tr>
        <td><b><xsl:value-of select="//lcl/FAC/omschrijving"/>:</b></td>
        <td colspan="3"><xsl:call-template name="linebreaks"><xsl:with-param name="string" select="omschrijving"/></xsl:call-template></td>
      </tr>
      <xsl:for-each select="kenmerk[@type!='L' and @type!='l' and @type!='Q' and count(@xmlnode)=0]">
        <xsl:sort select="@volgnummer" data-type="number"/>
        <xsl:if test=".!=''">
          <tr>
            <td><b><xsl:value-of select="@naam"/>:</b></td>
            <td colspan="3"><xsl:value-of select="."/></td>
          </tr>
        </xsl:if>
      </xsl:for-each>
      <xsl:if test="count(deel)&gt;0">
        <xsl:for-each select="deel">
          <xsl:sort select="omschrijving"/>
          <tr>
            <xsl:choose>
              <xsl:when test="position()=1"><td><b><xsl:value-of select="//lcl/MLD/objecten"/>:</b></td></xsl:when>
              <xsl:otherwise><td/></xsl:otherwise>
            </xsl:choose>
            <td colspan="3"><xsl:value-of select="omschrijving"/></td>
          </tr>
        </xsl:for-each>
      </xsl:if>
      <xsl:if test="opmerking!=''">
        <tr>
          <td><b><xsl:value-of select="//lcl/MLD/afhandeling"/>:</b></td>
          <td colspan="3"><xsl:call-template name="linebreaks"><xsl:with-param name="string" select="opmerking"/></xsl:call-template></td>
        </tr>
      </xsl:if>
      <tr height="20px"><td colspan="4"/></tr>
      <tr>
        <td colspan="4">
          <xsl:choose>
            <xsl:when test="$srtnotificatiecode='MLDACP'">
<br/><br/>De meest actuele status van de melding kun je vinden door <a href="https://blcc.facilitor.nl"><nobr>hier</nobr></a> te klikken. 
<br/><br/>Met vriendelijke groet,
<br/>Brightlands Servicedesk 
            </xsl:when>
            <xsl:when test="$srtnotificatiecode='MLDAFM'">
<br/><br/>De meest actuele status van de melding kun je vinden door <a href="https://blcc.facilitor.nl"><nobr>hier</nobr></a> te klikken. 
<br/><br/>Met vriendelijke groet,
<br/>Brightlands Servicedesk 
            </xsl:when>
            <xsl:otherwise/>
          </xsl:choose>
        </td>
      </tr>
    </table>
  </xsl:template>
</xsl:stylesheet>
