<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" version="1.0">
    <xsl:import href="./cust.xsl"/>
    
	<xsl:template match="afspraak" mode="full">
       <xsl:choose>
            <xsl:when test="$mode='summary'"></xsl:when>
            <xsl:when test="$srtnotificatiecode='CUST01'">
            <html>
						<xsl:call-template name="htmlhead"/>
            <body>
            <p>Geachte heer/mevrouw <xsl:value-of select="bezoeker/naam"/>,</p>
            <p>Ik heet u van harte welkom bij NS Stations en bevestig uw afspraak voor 
            <xsl:value-of select="datum/datum"/> om <xsl:value-of select="datum/tijd"/>.</p>
            <p>Ik zal u ophalen in de ontvangsthal van de Katreinetoren in Utrecht.
						<xsl:if test="telefoonnr">
            <br/>Indien u verlaat of verhinderd bent, kunt u dit doorgeven op telefoonnummer <xsl:value-of select="telefoonnr"/>.
            </xsl:if></p>
            <p>Ik verheug mij op uw komst.</p>
            <p>Met vriendelijke groet</p>
            <p><xsl:value-of select="gastheer"/></p>
						<p>NS Stations</p>
            <p>Adres:<br/>
            NS Stations, Katreinetoren<br/>
            Stationshal 17, 3511 CE Utrecht</p>
            <p>Bereikbaarheid<br/>
            Ons kantoor is uitstekend met de trein te bereiken. De ingang van de Katreinetoren bevindt zich in de stationshal van Utrecht Centraal naast de roltrappen van spoor 5-7. Plan uw reis via <a href="www.ns.nl">www.ns.nl</a> of <a href="m.ns.nl">m.ns.nl.</a><br/>
            Parkeren kunt u in de omgeving van het station Utrecht Centraal in een van de parkeergarages.</p>
            </body>
						</html>
            </xsl:when>
       <xsl:otherwise>
		<html>
			<xsl:comment>================================ AFSPRAKEN ==============================</xsl:comment>
			<xsl:comment>Facilitor new style default XSL template for afspraak</xsl:comment>
			<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>
		</html>
       </xsl:otherwise>
      </xsl:choose>
	</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">Geen bezoekers geregistreerd.</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">Bevestiging Bezoekersregistratie <xsl:value-of select="key"/><br/></td>
                </tr>
                <tr>
                  <td class="label" width="20%">Aanvrager</td>
                  <td class="value" width="80%">: <xsl:value-of select="contact_user/naam_full"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%">E-mail adres</td>
                  <td class="value" width="80%">: <xsl:value-of select="contact_user/email"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%">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%">Afdeling</td>
                  <td class="value" width="80%">: <xsl:value-of select="contact_user/afdeling/omschrijving"/></td>
                </tr>
                <tr>
                  <td height="30px"/>
                </tr>
                <xsl:if test="contact_user/key!=ingevoerd_user/key">
                  <tr>
                    <td width="20%" class="label">Behandeld door</td>
                    <td width="80%" class="value">: <xsl:value-of select="ingevoerd_user/naam_full"/></td>
                  </tr>
                  <tr>
                    <td height="30px"/>
                  </tr>
                </xsl:if>
                <xsl:call-template name="bez_begintext"/>
                <tr>
                  <td height="10px"/>
                </tr>
                <tr>
                  <td class="tekstkop" colspan="2" style="text-decoration:underline">Bezoekgegevens</td>
                </tr>
                <tr>
                  <td height="5px"/>
                </tr>
                <tr>
                  <td class="label" width="20%">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%">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%">Op bezoek bij</td>
                  <td class="value" width="80%">: <xsl:value-of select="gastheer"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%">Telefoon</td>
                  <td class="value" width="80%">: <xsl:value-of select="telefoonnr"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%">Bezoek locatie</td>
                  <td class="value" width="80%">: <xsl:value-of select="plaats/plaatsaanduiding"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%">Actie</td>
                  <td class="value" width="80%">: <xsl:value-of select="actie"/></td>
                </tr>
                <xsl:if test="opmerking!=''">
                  <tr>
                    <td class="label" width="20%">Opmerking</td>
                    <td class="value" width="80%">: <xsl:value-of select="opmerking"/></td>
                  </tr>
                </xsl:if>
                <tr>
                  <td height="10"/>
                </tr>
                <!-- afspraak -->
                <xsl:for-each select="bezoeker">
                  <xsl:sort select="naam"/>
                  <xsl:choose>
                    <xsl:when test="position() = 1">
                      <tr>
                        <td height="10" style="border-right: 0px solid; border-top: 0px solid; border-left: 0px solid; border-bottom: 0px solid"/>
                      </tr>
                      <tr>
                        <td colspan="3" class="label">Bezoeker(s)</td>
                      </tr>
                    </xsl:when>
                  </xsl:choose>
                  <tr>
                    <td class="result">
                      <xsl:value-of select="naam"/>
                    </td>
                    <td class="result">
                      <xsl:value-of select="bedrijf"/>
                      <xsl:if test="deel">[P]arkeerplaats gereserveerd</xsl:if>
                    </td>
                  </tr>
                </xsl:for-each>
                <xsl:call-template name="bez_endtext"/>
              </table>
              <!-- Bevestiging bezoekers registratie -->
            </xsl:otherwise>
          </xsl:choose>
        </TD>
        <TD WIDTH="30" ROWSPAN="30" ID="RECHTERMARGE"/>
      </TR>
    </TABLE>
  </xsl:template>

	<xsl:template match="afspraak" mode="badge">
		<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" width="480px">
			<tr>
				<td colspan="3" style="text-align:center; font-size:32px; font-weight: bold; height:60px;">Bezoeker</td>
			</tr>
			<tr>
				<td colspan="3" style="text-align:left; font-size:16px; font-weight: bold; height:20px; font-variant: small-caps;">
					<xsl:value-of select="bezoeker/naam"/>
				</td>
			</tr>
			<tr>
				<td colspan="3" style="text-align:left; font-size:16px; font-weight: bold; font-variant: small-caps;">
					<xsl:value-of select="bezoeker/bedrijf"/>
				</td>
			</tr>
			<tr>
				<td height="20px">&#xA0;</td>
			</tr>
			<tr>
				<td style="font-weight: bold;">Date:</td>
				<td style="font-weight: bold;">
					<xsl:value-of select="bezoeker/done/datum"/>
				</td>
				<td rowspan="2" style="text-align:right;">
					<xsl:element name="img">
					  <xsl:attribute name="wxidth">140px</xsl:attribute>
						<xsl:attribute name="src">../../appl/shared/barcode.asp?text=9078563412&amp;height=50&amp;narrow=1&amp;wide=3</xsl:attribute>
					</xsl:element>
				</td>
			</tr>
			<tr>
				<td style="font-weight: bold;">Guest of:</td>
				<td style="font-weight: bold; font-variant: small-caps;">
					<xsl:value-of select="gastheer"/>
				</td>
			</tr>
		</TABLE>
	</xsl:template>    

</xsl:stylesheet>





























