<?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="../../../appl/shared/default.xsl"/>
	<xsl:import href="../../aaxx/xsl/default.xsl"/>

	<xsl:variable name="xsrtnotificatiecode">BEZMAI</xsl:variable>
	<xsl:variable name="Rev">
		<!-- Revision van deze cust.xsl -->
		<xsl:value-of select="substring(translate('$Revision$', '$ ', ''), 10)"/>
	</xsl:variable>

	<xsl:template name="pageheader_groot">
		<xsl:choose>
			<xsl:when test="$mode='email'">
				<img src="cid:Essent_groot.gif"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:element name="img">
					<xsl:attribute name="src">../../cust/aaes/Essent_groot.gif</xsl:attribute>
				</xsl:element>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="pageheader">
		<table border="0" width="100%">
			<tr>
				<td width="33%" bordercolor="#FFFFFF" align="center">
					<xsl:choose>
						<xsl:when test="$mode='email'">
							<img src="cid:Essent_groot.gif"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:element name="img">
								<xsl:attribute name="src">../../cust/aaes/Essent_groot.gif</xsl:attribute>
							</xsl:element>
						</xsl:otherwise>
					</xsl:choose>
				</td>
				<td width="33%"></td>
				<td width="33%" align="right" valign="bottom" style="text-align:right">
					<b>Afdrukdatum:&#xA0;</b>
					<xsl:value-of select="//header/dateTime"/>
				</td>
			</tr>
		</table>
	</xsl:template>


<!-- <xsl:template match="melding" mode="full"> + <xsl:template match="melding" mode="include"> in melding.xsl -->

	<xsl:template match="reservering" 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(rsv_ruimte))">
							<table>
								<tr>
									<td height="20"/>
								</tr>
								<tr>
									<td class="caption">Annulering</td>
								</tr>
								<tr>
									<td>
										<b>Op uw naam heeft een reservering<xsl:if test="key!=''"> onder nummer <xsl:value-of select="key"/></xsl:if> plaatsgevonden, die vervolgens direct weer is verwijderd.</b>
										<br/>
										<br/>Deze reservering wordt niet verder verwerkt.<br/><br/>
                  Wilt u toch een reservering aanmaken voeg dan een nieuwe reservering toe waarbij een zaal, voorziening of artikel gereserveerd is.</td>
								</tr>
							</table>
						</xsl:when>
						<xsl:otherwise>
							<!-- Bevestiging reservering -->

							<!-- De algemene gegevens van de deelreservering met het laagste volgnummer worden gebruikt als referentie gegevens! -->
							<xsl:variable name="min_volgnr">
								<xsl:value-of select="//reservering/rsv_ruimte/volgnr[not(. &gt; //reservering/rsv_ruimte/volgnr)]"/>
							</xsl:variable>

							<table border="0" bordercolor="#ffffff" width="100%">
								<tr>
									<td class="caption" valign="top" colspan="2">
										<xsl:choose>
											<xsl:when test="@content='complete'">Reservering <xsl:value-of select="key"/><br/></xsl:when>
											<xsl:otherwise>Deelreservering <xsl:value-of select="key"/> / <xsl:value-of select="$min_volgnr"/><br/></xsl:otherwise>
										</xsl:choose>
										<xsl:if test="string(rsv_ruimte[volgnr=$min_volgnr]/omschrijving)!=''">(<xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/omschrijving"/>)</xsl:if>&#xA0;</td>
								</tr>
								<tr>
									<td width="20%" class="label">Aanvrager</td>
									<td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/contact_user/naam_full"/></td>
								</tr>
								<tr>
									<td width="20%" class="label">E-mail adres</td>
									<td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/contact_user/email"/></td>
								</tr>
								<tr>
									<td width="20%" class="label">Locatie</td>
									<td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/contact_user/werkplek/plaats/regio/district/locatie/omschrijving"/></td>
								</tr>
								<tr>
									<td width="20%" class="label">Afdeling</td>
									<td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/contact_user/afdeling/omschrijving"/></td>
								</tr>
								<tr>
									<td width="20%" class="label">Gastheer/-vrouw</td>
									<td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/host_user/naam_full"/></td>
								</tr>
								<tr>
									<td width="20%" class="label">Personeelsnummer</td>
									<td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/host_user/nr"/></td>
								</tr>
								<tr>
									<td width="20%" class="label">Kostenplaats</td>
									<td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/kostenplaats/nr"/>&#xA0;
										<xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/kostenplaats/omschrijving"/>
									</td>
								</tr>
								<tr>
									<td height="30px"/>
								</tr>
								<xsl:if test="rsv_ruimte[volgnr=$min_volgnr]/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 width="20%" class="label">Datum</td>
										<td width="80%" class="value">: <xsl:value-of select="datum/datum"/></td>
									</tr>
									<tr>
										<td height="30px"/>
									</tr>
								</xsl:if>
								<tr>
									<td colspan="2" class="tekst">
										<xsl:choose>
											<xsl:when test="$srtnotificatiecode='RESNEW'"/>
											<xsl:when test="$srtnotificatiecode='RESDEL'">DE RESERVERING IS VERVALLEN</xsl:when>
											<xsl:otherwise>
												<xsl:call-template name="res_begintext"/>
											</xsl:otherwise>
										</xsl:choose>
									</td>
								</tr>
								<tr>
									<td height="10px"/>
								</tr>
								<tr>
									<td class="tekstkop" colspan="2" style="text-decoration:underline">Reserveringsgegevens</td>
								</tr>
								<tr>
									<td height="5px"/>
								</tr>
								<xsl:if test="string(rsv_ruimte[volgnr=$min_volgnr]/opmerking)!=''">
									<tr>
										<td colspan="2" class="label">Opmerking</td>
									</tr>
									<tr>
										<td colspan="2" class="value">
											<xsl:call-template name="linebreaks">
												<xsl:with-param name="string" select="rsv_ruimte[volgnr=$min_volgnr]/opmerking"/>
											</xsl:call-template>
										</td>
									</tr>
									<tr>
										<td height="5px"/>
									</tr>
								</xsl:if>
								<tr>
									<td colspan="2">
										<table cellpadding="0" cellspacing="0" border="1" bordercolor="#000000" frame="box">
											<!-- rsv_ruimte -->
											<xsl:for-each select="rsv_ruimte">
												<xsl:sort select="volgnr" data-type="number"/>
												<xsl:call-template name="rsv_ruimte">
													<xsl:with-param name="min_volgnr" select="$min_volgnr"/>
												</xsl:call-template>
											</xsl:for-each>
											<!-- totaal reservering -->
											<tr>
												<td height="10px" style="border-style:solid;border-width:0px;"/>
											</tr>
											<tr>
												<td class="tekstkop" align="right" colspan="2" style="border-style:solid;border-width:0px;">Totaalprijs reservering:</td>
												<td class="tekstkop" style="text-align:right;border-style:solid;border-width:0px;">
													<xsl:call-template name="europrijs">
														<xsl:with-param name="prijs" select="sum(rsv_ruimte/prijs[string(number(.))!='NaN'])+sum(rsv_ruimte/rsv_deel/prijs[string(number(.))!='NaN'])+sum(rsv_ruimte/rsv_artikel/prijs[string(number(.))!='NaN'])"/>
													</xsl:call-template>
												</td>
											</tr>
										</table>
									</td>
								</tr>
								<xsl:call-template name="res_endtext">
									<xsl:with-param name="min_volgnr" select="$min_volgnr"/>
								</xsl:call-template>
							</table>
							<!-- Bevestiging reservering -->
						</xsl:otherwise>
					</xsl:choose>
				</TD>
				<TD WIDTH="30" ROWSPAN="30" ID="RECHTERMARGE"/>
			</TR>
		</TABLE>
	</xsl:template>

	<!-- Klantspecifieke begintekst voor reserveringsgegevens op reserveringsbon -->
	<xsl:template name="res_begintext">
		<tr>
			<td colspan="2" class="tekst">
				<xsl:choose>
					<xsl:when test="$srtnotificatiecode = 'RESINF'">Geachte heer, mevrouw,
						<br/>
						<br/>Onderstaande reservering staat geregistreerd in ons systeem. 
            Indien deze reservering niet meer van toepassing is dient u deze zo snel mogelijk, maar in ieder geval binnen 1 werkdag te annuleren.
						<br/>
						<br/><b>Klik <xsl:element name="a">
						            <xsl:attribute name="href">https://<xsl:value-of select="$FacilitorRoot"/>?<xsl:value-of select="../bookmarks/reservering"/><xsl:value-of select="rsv_ruimte/key"/></xsl:attribute>hier</xsl:element> om je reservering direct te annuleren.</b>
						<br/>
						<br/>Wanneer de reservering gewoon doorgang vindt, hoeft u niet op deze herinnering te reageren.
						<br/>
					</xsl:when>
					<xsl:otherwise>
					</xsl:otherwise>
				</xsl:choose>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="string-replace-all">
		<xsl:param name="text"/>
		<xsl:param name="replace"/>
		<xsl:param name="by"/>
		<xsl:choose>
			<xsl:when test="contains($text, $replace)">
				<xsl:value-of select="substring-before($text,$replace)"/>
				<xsl:value-of select="$by"/>
				<xsl:call-template name="string-replace-all">
					<xsl:with-param name="text" select="substring-after($text,$replace)"/>
					<xsl:with-param name="replace" select="$replace"/>
					<xsl:with-param name="by" select="$by"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$text"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<!--===================================================================================================-->
	<!-- RAPPORT - RAPPORT - RAPPORT - RAPPORT - RAPPORT - RAPPORT - RAPPORT - RAPPORT - RAPPORT - RAPPORT -->
	<!--===================================================================================================-->
	<xsl:template match="rapport" mode="cust">
		<xsl:if test="@view='aaes_v_rap_res_infobord' or @view='AAES_V_RAP_RES_INFOBORD' or @view='res_v_rap_infobord' or @view='RES_V_RAP_INFOBORD'">
			<html>
				<head>
					<style>th {
      color: #e60166;
      font-family: Verdana;
      font-weigth: bold;
      font-size: 14pt;
      padding:  3px;
    }
    td {
      color: #e60166;
      font-family: Verdana;
      font-size: 14pt;
      padding:  3px;
    }
    .odd {
      background-color: #f6f6f6;
    }
    .even {
      background-color: #ffffff;
    }
    div {
      background-color: #e60166;
    }
    p {
      font-family: Verdana;
      font-size: 30pt;
      text-align: center;
    }
    body {
      margin: 0;
      overflow: hidden;
    }</style>

					<script language="javascript">
						<xsl:variable name="sorted">
							<xsl:for-each select="rapport_data/data_row">
								<xsl:sort select="REGELS" order="ascending"/>
								<xsl:copy-of select="."/>
							</xsl:for-each>
						</xsl:variable>

						<xsl:variable name="regels">
							<xsl:for-each select="msxml:node-set($sorted)/data_row">
								<xsl:if test="not(preceding-sibling::data_row[1]/REGELS) and REGELS!=''">
									<xsl:value-of select="REGELS"/>
								</xsl:if>
							</xsl:for-each>
						</xsl:variable>var count = 1;
var screenlength = 20;
						<xsl:if test="$regels!=''">screenlength=<xsl:value-of select="$regels"/>;</xsl:if>var line_refresh = 5; // refresh time in seconds

function alternate(){
  if (document.getElementsByTagName){
    var table = document.getElementById("result");
    var rows = table.getElementsByTagName("tr");
    for (i = 0; i &lt; rows.length; i++) {
    //manipulate rows
      if (i % 2 == 0) {
        rows[i].className = "even";
      }
      else {
        rows[i].className = "odd";
      }
    }
  }
}

function startAutoRefreshTim() {
  // verwijder scrollbar
  parent.document.body.style.overflow = "hidden";

  if (document.all.timeID2.value > 0) {
    clearInterval(document.all.timeID2.value);
    document.all.timeID2.value = -1;
  }

  var table = document.getElementById("result");
  var rows = table.getElementsByTagName("tr");

  if (count &lt; rows.length - screenlength) {
    // hide top line
    trnr = document.getElementById("tr"+count);
    if (trnr) trnr.style.display = "none";
    count = count + 1;
  }
  else {
    for (i = 0; i &lt; rows.length; i++) {
    //unhide rows
      rows[i].style.display = "block"
      count = 1;
    }
  }
  document.all.timeID2.value = setInterval('startAutoRefreshTim();', line_refresh * 1000);
}</script>
				</head>

				<xsl:variable name="locatie">
					<xsl:if test="contains(where,'locatie_code')">
						<xsl:for-each select="rapport_data/data_row">
							<xsl:if test="position()=1">Welkom in <xsl:value-of select="LOCATIE_OMSCHRIJVING"/></xsl:if>
						</xsl:for-each>
					</xsl:if>
				</xsl:variable>

				<xsl:variable name="sorted">
					<xsl:for-each select="rapport_data/data_row">
						<xsl:sort select="TIJD_VAN"/>
						<xsl:sort select="RUIMTE"/>
						<xsl:if test="(OFFSET &lt; 60 and OFFSET &gt; -60) or AKTIEF = 'active'">
							<xsl:copy-of select="."/>
						</xsl:if>
					</xsl:for-each>
				</xsl:variable>

				<body onLoad="alternate();startAutoRefreshTim();parent.Activate();parent.document.body.style.overflow='hidden';">
					<table width="100%" cellpadding="0" cellspacing="0">
						<tr>
							<td colspan="5" text-align="center">
								<p>
									<xsl:if test="$locatie=''">Welkom</xsl:if>
									<xsl:value-of select="$locatie"/>
								</p>
							</td>
						</tr>
						<tr height="20px">
							<td colspan="5"/>
						</tr>
						<tr>
							<th width="1%" style="text-align:left"></th>
							<th width="15%" style="text-align:left">Tijd</th>
							<th width="30%" style="text-align:left">Omschrijving</th>
							<th width="30%" style="text-align:left">Kamer</th>
							<th width="24%" style="text-align:left">Voorzitter</th>
						</tr>
					</table>

					<table id="result" width="100%" cellpadding="0" cellspacing="0">
						<xsl:for-each select="msxml:node-set($sorted)/data_row">
							<xsl:element name="tr">
								<xsl:attribute name="id">tr<xsl:value-of select="position()"/></xsl:attribute>
								<td width="1%"/>
								<td width="15%">
									<xsl:value-of select="TIJD_VAN"/>-<xsl:value-of select="TIJD_TOT"/></td>
								<td width="30%">
									<xsl:value-of select="OMSCHRIJVING"/>
								</td>
								<td width="30%">
									<xsl:value-of select="RUIMTE"/>
								</td>
								<td width="24%">
									<xsl:value-of select="GASTHEER"/>
								</td>
							</xsl:element>
						</xsl:for-each>
					</table>
					<input type="hidden" name="timeID2" value="-1"/>
				</body>
			</html>
		</xsl:if>
		<xsl:if test="@view='AAES_V_RAP_FIAT_LEIDING' or @view='aaes_v_rap_fiat_leiding'">

			<script>
				<xsl:text disable-output-escaping="yes">
				function run_afwijzen (p_mld_key) {
					l_id = 'reden_' + p_mld_key;
					l_obj = document.getElementById (l_id);
					$.post('../../cust/aaes/mld_statusupdate.asp?meldingnr=' + p_mld_key + '&amp;mld_status=1&amp;mld_info=' + l_obj.value, {}, FcltCallbackRefresh, "json");
				}
				</xsl:text>
			</script>

			<table width="100%" class="DefResultsetTable" border="1" cellpadding="0" cellspacing="0">
				<colgroup>
					<col width="8%"/>
					<col width="8%"/>
					<col width="8%"/>
					<col width="30%"/>
					<col width="8%"/>
					<col width="30%"/>
					<col width="8%"/>
				</colgroup>

				<xsl:if test="count(rapport_data/data_row)=0">
					<tr>
						<td>
							<center>
								<b>Geen gegevens gevonden</b>
							</center>
						</td>
					</tr>
				</xsl:if>

				<xsl:variable name="sorted">
					<xsl:for-each select="rapport_data/data_row">
						<xsl:sort select="STATUS" order="descending"/>
						<xsl:sort select="GEPLANDE_EINDDATUM"/>
						<xsl:copy-of select="."/>
					</xsl:for-each>
				</xsl:variable>

				<xsl:for-each select="msxml:node-set($sorted)/data_row">
					<xsl:if test="position() = 1">
						<tr>
							<th class="DefResultsetHeading" style="text-align:left">Nummer</th>
							<th class="DefResultsetHeading" style="text-align:left">Datum</th>
							<th class="DefResultsetHeading" style="text-align:left">Aanvrager</th>
							<th class="DefResultsetHeading" style="text-align:left">Verzoek</th>
							<th class="DefResultsetHeading" style="text-align:left">Status</th>
							<th class="DefResultsetHeading" colspan="2" style="text-align:center">Accepteren / Afwijzen / Details</th>
						</tr>
					</xsl:if>

					<tr>
						<td class="DRR" style="text-align:left">
							<xsl:value-of select="NUMMER"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:left">
							<xsl:value-of select="DATUM"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:left">
							<xsl:value-of select="MELDER"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:left">
							<b>
								<xsl:value-of select="MELDING"/>
							</b>
							<br/>
							<xsl:call-template name="linebreaks">
								<xsl:with-param name="string" select="MELDING_TEKST"/>
							</xsl:call-template>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:left">
							<xsl:value-of select="STATUS"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<xsl:if test="MLD_STATUSES_KEY != '4'">
							<td class="DRR" style="text-align:left">Reden voor afwijzing:<br/>
								<xsl:element name="textarea">
									<xsl:attribute name="id">reden_<xsl:value-of select="HIDE_F_MLD_MELDING_KEY"/></xsl:attribute>
									<xsl:attribute name="type">textarea</xsl:attribute>
									<xsl:attribute name="cols">40</xsl:attribute>
									<xsl:attribute name="rows">3</xsl:attribute>
								</xsl:element>
							</td>
							<td class="DRR" style="text-align:left">
								<table width="100%" cellpadding="0" cellspacing="0">
									<tr>
										<xsl:element name="td">
											<xsl:attribute name="colspan">2</xsl:attribute>
											<xsl:attribute name="class">DRR</xsl:attribute>
											<xsl:attribute name="title">link voor accepteren lease-auto aanvraag</xsl:attribute>
											<xsl:attribute name="style">{ cursor: hand; border:none; text-align:right; }</xsl:attribute>
											<xsl:attribute name="onclick">$.post('../../cust/aaen/mld_statusupdate.asp?meldingnr=<xsl:value-of select="HIDE_F_MLD_MELDING_KEY"/>&amp;mld_status=4', {}, FcltCallbackRefresh, "json");</xsl:attribute>
											<u>Accepteren</u>
										</xsl:element>
									</tr>
									<tr>
										<td>&#xA0;</td>
									</tr>
									<tr>
										<xsl:element name="td">
											<xsl:attribute name="class">DRR</xsl:attribute>
											<xsl:attribute name="title">link voor afwijzen lease-auto aanvraag</xsl:attribute>
											<xsl:attribute name="style">{ cursor: hand; border:none; text-align:right; }</xsl:attribute>
											<xsl:attribute name="onclick">run_afwijzen (<xsl:value-of select="HIDE_F_MLD_MELDING_KEY"/>)</xsl:attribute>
											<u>Afwijzen</u>
										</xsl:element>
									</tr>
								</table>
							</td>
						</xsl:if>
						<xsl:if test="MLD_STATUSES_KEY = '4'">
							<td/>
							<td class="DRR" style="text-align:left">
								<table width="100%" cellpadding="0" cellspacing="0">
									<tr>
										<xsl:element name="td">
											<xsl:attribute name="colspan">2</xsl:attribute>
											<xsl:attribute name="class">DRR</xsl:attribute>
											<xsl:attribute name="title">Ga naar melding</xsl:attribute>
											<xsl:attribute name="style">{ cursor: hand; border:none; text-align:right; }</xsl:attribute>
											<xsl:attribute name="onclick">FcltMgr.openDetail('/appl/mld/mld_melding.asp?mld_key=<xsl:value-of select="HIDE_F_MLD_MELDING_KEY"/>&amp;urole=bo', {}, FcltCallbackRefresh, "json");</xsl:attribute>
											<u>Bekijken</u>
										</xsl:element>
									</tr>
								</table>
							</td>
						</xsl:if>
					</tr>
				</xsl:for-each>
			</table>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2007. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\..\TEMP\AAAR_files\melding121055_20150205132902.xml" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->