<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<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">BEZBAD</xsl:variable>

  <xsl:template match="bezoeker" mode="full">
    <xsl:choose>
      <xsl:when test="$mode='summary'"></xsl:when>
    <xsl:otherwise>
    <html>
      <xsl:comment>================================ BEZOEKER ==============================</xsl:comment>
      <xsl:comment>FACILITOR default XSL template for bezoeker</xsl:comment>
      <xsl:choose>
         <xsl:when test="$srtnotificatiecode = 'BEZBAD'">
           <xsl:apply-templates select="." mode="badge"/>
         </xsl:when>
         <xsl:otherwise>
          <xsl:call-template name="htmlhead"/>
          <xsl:element name="body">
            <xsl:if test="$mode!='email'">
              <xsl:attribute name="onload">window.print();</xsl:attribute>
            </xsl:if>
            <xsl:call-template name="pageheader"/>
            <xsl:apply-templates select="." mode="include"/>
            <xsl:call-template name="pagefooter"/>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </html>
    </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:template match="bezoeker" mode="badge">
    <head>
      <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
      <!--Generic Facilitor HTML head for ANY report-->
      <meta http-equiv="pragma" content="no-cache"/>
      <meta http-equiv="expires" content="0"/>
      <meta http-equiv="cache-control" content="no-cache"/>
      <title><xsl:value-of select="//lcl/FAC/facilitorformulier"/></title>
      <xsl:call-template name="stylesheet"/>
      <style>
        html,body {
          padding:0; margin:0;
          border: none;
          width:85mm; height:52mm;
          position: absolute;
          font-family: Calibri, Tahoma, Verdana, Arial;
        }
        div#blauw {
          position: absolute;
          background-color: #003478;
          margin: 0; padding: 0;
          width: 64mm;
          height: 11mm;
          top: 0;
          left: 0;
        }
        div#header {
          position: relative;
          color: #fff;
          font-weight: normal;
          font-size: 20pt;
          line-height: 11mm;
          text-align: left;
          margin: 0 0 0 8mm; padding: 0;
        }
        div#naam {
          position: absolute;
          color: #000;
          font-weight: bold;
          text-align: left;
          font-size: 28pt;
          line-height: 11mm;
          vertical-align: top;
          margin: 0; padding: 0;
          border: none;
          width: 75mm;
          height: 22mm;
          top: 17mm;
          left: 8mm;
        }
        img#footer {
          position: absolute;
          margin: 0; padding: 0;
          top: 42mm;
          left: 8mm;
          width: 75mm;
        }
      </style>
    </head>
    <xsl:element name="body">
      <xsl:attribute name="onload">window.print();</xsl:attribute>
      <div id="blauw">
        <div id="header">Besucher/Visitor</div>
      </div>
      <div id="naam"><xsl:value-of select="naam"/></div>
      <xsl:element name="img">
        <xsl:attribute name="id">footer</xsl:attribute>
        <xsl:attribute name="src">../../cust/<xsl:value-of select="//header/custId"/>/badge_logo.gif</xsl:attribute>
      </xsl:element>
    </xsl:element>
  </xsl:template>

  <xsl:template match="afspraak" mode="include">
    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">
      <TR>
        <TD WIDTH="40" ROWSPAN="30" ID="LINKERMARGE"/>
        <TD>
          <xsl:choose>
            <xsl:when test="not(boolean(bezoeker))">
              <table>
                <tr>
                  <td height="20"/>
                </tr>
                <tr>
                  <td class="caption"><xsl:value-of select="//lcl/BEZ/geen_bezoekers"/></td>
                </tr>
              </table>
            </xsl:when>
            <xsl:otherwise>
              <!-- Bevestiging bezoekers registratie -->
              <table border="0" bordercolor="#ffffff" width="100%">
                <tr>
                  <td class="caption" valign="top" colspan="2"><xsl:value-of select="//lcl/BEZ/bevestiging_bezoekersregistratie"/>&#xA0;<xsl:value-of select="key"/><br/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/FAC/aanvrager"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="contact_user/naam_full"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/FAC/e-mail"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="contact_user/email"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/FAC/locatie"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="contact_user/werkplek/plaats/regio/district/locatie/omschrijving"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/FAC/afdeling"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="contact_user/afdeling/omschrijving"/></td>
                </tr>
                <tr>
                  <td height="20px"/>
                </tr>
                <xsl:if test="contact_user/key!=ingevoerd_user/key">
                  <tr>
                    <td width="20%" class="label"><xsl:value-of select="//lcl/BEZ/behandeld_door"/></td>
                    <td width="80%" class="value">: <xsl:value-of select="ingevoerd_user/naam_full"/></td>
                  </tr>
                  <tr>
                    <td height="20px"/>
                  </tr>
                </xsl:if>
                <xsl:call-template name="bez_begintext"/>
                <tr>
                  <td height="20px"/>
                </tr>
                <tr>
                  <td class="tekstkop" colspan="2"><xsl:value-of select="//lcl/BEZ/bezoekgegevens"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/BEZ/datum_bezoek"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="datum/datum"/>
                    <xsl:if test="datum/datum!=eind/datum">- <xsl:value-of select="eind/datum"/></xsl:if>
                  </td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/BEZ/tijd_bezoek"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="datum/tijd"/> - <xsl:value-of select="eind/tijd"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/BEZ/op_bezoek_bij"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="host_user/naam_full"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/FAC/telefoon"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="host_user/telefoonnr"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/BEZ/bezoek_locatie"/></td>
                  <td class="value" width="80%">
                     <xsl:choose>
                        <xsl:when test="plaats/plaatsaanduiding">
                           : <xsl:value-of select="plaats/plaatsaanduiding"/>
                        </xsl:when>
                        <xsl:otherwise>
                           : <xsl:value-of select="ruimte"/>
                        </xsl:otherwise>
                     </xsl:choose>
                  </td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/BEZ/actie"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="actie"/></td>
                </tr>
                <xsl:if test="opmerking!=''">
                  <tr>
                    <td class="label" width="20%"><xsl:value-of select="//lcl/FAC/opmerking"/></td>
                    <td class="value" width="80%">: <xsl:value-of select="opmerking"/></td>
                  </tr>
                </xsl:if>
                <tr>
                  <td height="30px"/>
                </tr>

                <!-- afspraak -->
                <tr>
                      <td colspan="2" class="tekstkop"><xsl:value-of select="//lcl/BEZ/bez_begintext2"/></td>
                </tr>
                <tr>
                   <td colspan="2">
                      <table border="0" bordercolor="#ffffff" width="100%">
                         <tr>
                            <th><xsl:value-of select="//lcl/FAC/naam"/></th>
                            <th><xsl:value-of select="//lcl/FAC/bedrijf"/></th>
                            <th><xsl:value-of select="//lcl/BEZ/parkeerplaats_gereserveerd"/></th>
                         </tr>
                         <xsl:for-each select="bezoeker">
                           <xsl:sort select="naam"/>
                           <tr>
                             <td class="result" width="20%">
                               <xsl:value-of select="naam"/>
                             </td>
                             <td class="result" width="20%">
                               <xsl:value-of select="bedrijf"/>
                             </td>
                             <td class="result" width="60%">
                               <xsl:if test="parkeerplaats"><xsl:value-of select="parkeerplaats"/></xsl:if>
                              </td>
                                    </tr>
                           <xsl:for-each select="kenmerk[@type!='L' and @type!='Q']">
                                    <xsl:sort select="@volgnummer" data-type="number"/>
                                    <xsl:if test=".!=''">
                                      <tr>
                                        <td align="right">
                                          <b>
                                            <xsl:value-of select="@naam"/>:</b>
                                        </td>
                                        <td colspan="2">
                                          <xsl:value-of select="."/>
                                        </td>
                                      </tr>
                                    </xsl:if>
                                  </xsl:for-each>
                         </xsl:for-each>
                         <xsl:call-template name="bez_endtext"/>
                       </table>
                      </td>
                        </tr>
              </table>
              <!-- Bevestiging bezoekers registratie -->
            </xsl:otherwise>
          </xsl:choose>
        </TD>
        <TD WIDTH="30" ROWSPAN="30" ID="RECHTERMARGE"/>
      </TR>
    </TABLE>
  </xsl:template>

</xsl:stylesheet>
