<?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="./environment.xsl"/>
	<xsl:variable name="Rev">
		<!-- Revision van deze cust.xsl -->
		<xsl:value-of select="substring(translate('$Revision$', '$ ', ''), 10)"/>
	</xsl:variable>

	<xsl:variable name="xsrtnotificatiecode">MLDNOT</xsl:variable>

	<xsl:template name="stylesheet">
		<style>body {
       font-family: MS Sans Serif;
       background-color: rgb(255, 255, 255);
       margin-left:0px;
       margin-top:8px;
       cursor: auto;
    }

    table {
      border: 0;
    }

    table.details {
      background-color: #cc0000;
    }

    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: #333333;
    }

    td {
      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: #dddddd;
    }

    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.smallcaption {
      font-size:   10pt;
			font-weight: bold;
    }

    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 match="reservering" mode="include"> in reservering.xsl -->
	<!-- <xsl:template name="res_begintext"> in reservering.xsl -->
	<!-- <xsl:template name="res_endtext"> in reservering.xsl -->
	<!-- <xsl:template name="rsv_ruimte"> in reservering.xsl -->

	<!-- <xsl:template match="bestelling" mode="include"> in bestelling.xsl -->
	<!-- <xsl:template match="bestelopdracht" mode="include"> in bestelling.xsl -->

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


	<xsl:template match="deel" mode="include">
		<xsl:choose>
			<xsl:when test="srtdeel/key = '41'">
				<p>
					<b>Bruikleenovereenkomst</b>
					<br/>
					<br/>Bruikleenovereenkomst voor een kunstwerk in een werkruimte voor provinciale medewerkers.</p>
				<table border="1" bordercolor="#000000" cellpadding="1" cellspacing="0" width="100%">
					<tr>
						<td class="smallcaption" rowspan="3">Aanvrager:</td>
						<td class="label">Naam:</td>
						<td class="value">
							<xsl:value-of select="kenmerk[@naam = 'Uitgeleend aan']/perslid/naam_full"/>
						</td>
						<td width="200px" rowspan="10">
							<xsl:element name="img">
								<xsl:attribute name="src">../../cust/pnbr/flexfiles/INS/I<xsl:value-of select="key"/>/4/<xsl:value-of select="kenmerk[@naam = 'Foto']"/></xsl:attribute>
								<xsl:attribute name="width">200px</xsl:attribute>
							</xsl:element>
						</td>
					</tr>
					<tr>
						<td class="label">Telefoonnummer:</td>
						<td class="value">
							<xsl:value-of select="kenmerk[@naam = 'Uitgeleend aan']/perslid/telefoonnr"/>
						</td>
					</tr>
					<tr>
						<td class="label">Handtekening aanvrager:</td>
						<td class="value">&#xA0;</td>
					</tr>

					<tr>
						<td class="smallcaption" rowspan="4">Kunstwerk:</td>
						<td class="label">kunstenaar:</td>
						<td class="value">
							<xsl:value-of select="kenmerk[@naam = 'Naam kunstenaar']"/>
						</td>
					</tr>
					<tr>
						<td class="label">titel:</td>
						<td class="value">
							<xsl:value-of select="kenmerk[@naam = 'Titel kunstwerk']"/>
						</td>
					</tr>
					<tr>
						<td class="label">ID code:</td>
						<td class="value">
							<xsl:value-of select="omschrijving"/>
						</td>
					</tr>
					<tr>
						<td class="label">gewenste locatie</td>
						<td class="value">
							<xsl:value-of select="plaats/plaatsaanduiding"/>&#xA0;
							<xsl:value-of select="plaats/regio/district/locatie/gebouw/verdieping/ruimte/omschrijving"/>
						</td>
					</tr>
					<tr>
						<td class="smallcaption" rowspan="3">Eigendom:</td>
						<td class="label">Kunstcollectie provincie:</td>
						<td class="value">&#xA0;</td>
					</tr>
					<tr>
						<td class="label">Privé eigendom:</td>
						<td class="value">&#xA0;</td>
					</tr>
					<tr>
						<td class="label">Aankoop ikv projecten</td>
						<td class="value">&#xA0;</td>
					</tr>
					<tr>
						<td height="50" class="smallcaption">Akkoord beheerder</td>
						<td colspan="3" class="value">&#xA0;</td>
					</tr>
					<tr>
						<td height="50" class="smallcaption">Datum plaatsing</td>
						<td colspan="3" class="value">&#xA0;</td>
					</tr>
					<tr>
						<td height="50" class="smallcaption">Akkoord voor ontvangst aanvrager</td>
						<td colspan="3" class="value">&#xA0;</td>
					</tr>
					<tr>
						<td height="50" class="smallcaption">Einde uitleentermijn</td>
						<td colspan="3" class="value">&#xA0;</td>
					</tr>
					<tr>
						<td height="50" class="smallcaption">Akkoord voor retourontvangst beheerder</td>
						<td colspan="3" class="value">&#xA0;</td>
					</tr>
				</table>
			</xsl:when>

			<xsl:otherwise>
				<table border="0" cellpadding="1" width="100%" bordercolor="#000000">
					<xsl:if test="binding='P'">
						<tr>
							<td colspan="5" style="border-bottom:solid; border-top:solid; border-width:2px" class="smallcaption">
								<strong>INLEVERBEWIJS / ONTVANGSTBEWIJS* <xsl:value-of select="srtdeel/omschrijving"/>&#xA0;<xsl:value-of select="omschrijving"/></strong>
							</td>
						</tr>
						<tr>
							<td class="label">Naam</td>
							<td class="value">
								<xsl:value-of select="persoon/naam_full"/>
							</td>
							<td colspan="2" width="50%"></td>
						</tr>
						<tr>
							<td class="label">Dir./bureau</td>
							<td class="value">
								<xsl:value-of select="persoon/afdeling/naam"/>&#xA0;-&#xA0;<xsl:value-of select="persoon/afdeling/omschrijving"/></td>
							<td colspan="2" width="50%"></td>
						</tr>
						<tr>
							<td class="label">Locatie</td>
							<td class="value">
								<xsl:value-of select="persoon/werkplek/plaats/plaatsaanduiding"/>
							</td>
							<td colspan="2" width="50%"></td>
						</tr>
						<tr>
							<td class="label">Telefoon</td>
							<td class="value">
								<xsl:value-of select="persoon/telefoonnr"/>
							</td>
							<td colspan="2" width="50%"></td>
						</tr>
						<tr>
							<td class="label">Userid</td>
							<td class="value">
								<xsl:value-of select="persoon/oslogin"/>
							</td>
							<td colspan="2" width="50%"></td>
						</tr>
						<tr>
							<td height="20px"></td>
						</tr>
						<tr>
							<td colspan="5" style="border-bottom:solid; border-top:solid; border-width:2px" class="smallcaption">
								<strong>Uitgegeven object:</strong>
							</td>
						</tr>
					</xsl:if>
					<xsl:if test="binding!='P'">
						<tr>
							<td colspan="3" class="caption">
								<strong>
									<xsl:value-of select="srtdeel/omschrijving"/>&#xA0;<xsl:value-of select="omschrijving"/></strong>
							</td>
							<td style="text-align:right">
								<xsl:element name="img">
									<xsl:attribute name="width">140px</xsl:attribute>
									<xsl:attribute name="src">../../appl/shared/barcode.asp?text=<xsl:value-of select="key"/>&amp;height=50&amp;narrow=1&amp;wide=3</xsl:attribute>
								</xsl:element>
							</td>
						</tr>

						<tr>
							<td class="label">
								<xsl:value-of select="//lcl/CNT/groep"/>
							</td>
							<td class="value">
								<xsl:value-of select="srtdeel/srtgroep/omschrijving"/>
							</td>
							<td colspan="2" width="50%"></td>
						</tr>
					</xsl:if>
					<xsl:if test="binding='R'">
						<tr>
							<td class="label">
								<xsl:value-of select="//lcl/CNT/plaats"/>
							</td>
							<td class="value">
								<xsl:value-of select="plaats/plaatsaanduiding"/>&#xA0;
								<xsl:value-of select="plaats/regio/district/locatie/gebouw/verdieping/ruimte/omschrijving"/>
							</td>
						</tr>
					</xsl:if>
					<xsl:if test="binding='T'">
						<tr>
							<td class="label">
								<xsl:value-of select="//lcl/CNT/plaats"/>
							</td>
							<td class="value">
								<xsl:value-of select="terreinsector/naam"/>
							</td>
						</tr>
					</xsl:if>
					<xsl:if test="binding='Px'">
						<tr>
							<td class="label">
								<xsl:value-of select="//lcl/CNT/eigenaar"/>
							</td>
							<td class="value">
								<xsl:value-of select="persoon/naam_full"/>
							</td>
						</tr>
					</xsl:if>
					<xsl:if test="binding='A'">
						<tr>
							<td class="label">
								<xsl:value-of select="//lcl/CNT/eigenaar"/>
							</td>
							<td class="value">
								<xsl:value-of select="afdeling/omschrijving"/>
							</td>
						</tr>
					</xsl:if>
					<xsl:if test="binding='W'">
						<tr>
							<td class="label">
								<xsl:value-of select="//lcl/CNT/plaats"/>
							</td>
							<td class="value">
								<xsl:value-of select="werkplek/plaats/plaatsaanduiding"/>/<xsl:value-of select="werkplek/volgnr"/></td>
						</tr>
					</xsl:if>
					<xsl:for-each select="kenmerk[count(@xmlnode)=0]">
						<xsl:sort select="@volgnummer" data-type="number"/>
						<xsl:if test=".!=''">
							<tr>
								<td class="label">
									<xsl:value-of select="@naam"/>:</td>
								<td class="value">
									<xsl:call-template name="linebreaks">
										<xsl:with-param name="string" select="."/>
									</xsl:call-template>
								</td>
							</tr>
						</xsl:if>
					</xsl:for-each>
					<tr>
						<td></td>
						<td colspan="3">
							<table border="1">
								<xsl:for-each select="deel">
									<xsl:apply-templates select="." mode="include"/>
								</xsl:for-each>
							</table>
						</td>
					</tr>
					<xsl:if test="binding='P'">
						<tr>
							<td height="100px"></td>
						</tr>
						<tr>
							<td class="label">Handtekening voor ontvangst<br/>en akkoord voorwaarden</td>
							<td class="label">:</td>
							<td class="label">Ontvangstdatum</td>
							<td class="label">:&#xA0;&#xA0;&#xA0;/&#xA0;&#xA0;&#xA0;/&#xA0;&#xA0;&#xA0;</td>
						</tr>
						<tr>
							<td height="20px"></td>
						</tr>
						<tr>
							<td colspan="5" class="label">Naam medewerker Dienstenplein:</td>
						</tr>
						<tr>
							<td height="20px"></td>
						</tr>
						<tr>
							<td colspan="5" class="label">
								<bl>
									<li>Voor de geleverde artikelen zijn de "Algemene voorwaarden provinciaal ICT eigendom" van kracht.</li>
									<li>De ontvanger verklaart met het tekenen van dit document dan hij/zij bovenstaande artikelen heeft
				ontvangen en bekend is met de geldende voorwaarden en hiermee akkoord gaat.</li>
								</bl>
							</td>
						</tr>
						<tr>
							<td height="20px">* Doorhalen wat niet van toepassing is.</td>
						</tr>
					</xsl:if>
				</table>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>


	<xsl:param name="mode"/>
	<xsl:template match="rapport">


		<xsl:if test="@view = 'PNBR_V_RAP_DAGSTAAT_CAT' or @view = 'PNBR_V_RAP_DAGSTAAT_EVEN'">
			<style>tbody {
       page-break-inside: avoid;
    }
    th {
      border: 0px none #ffffff;
      text-align: left;
      font-weight: normal;
      background-color: #EEEEEE;
      color: #000000;
    }
    td {
      background-color: #FFFFFF;
    }
		.new {
			font-weight: bold;
			background-color: #f9ee7d;
		}
    .tdt {
      border-top: 1px solid #808080;
    }
    .tdtr {
      border-right: 1px solid #808080;
      border-top: 1px solid #808080;
    }
    .tdtl {
      border-left: 1px solid #808080;
      border-top: 1px solid #808080;
    }
    .tdl {
      border-left: 1px solid #808080;
    }
    .tdr {
      border-right: 1px solid #808080;
    }
    .tdb {
      border-bottom: 1px solid #808080;
    }
    .tdbr {
      border-right: 1px solid #808080;
      border-bottom: 1px solid #808080;
    }
    .tdbl {
      border-left: 1px solid #808080;
      border-bottom: 1px solid #808080;
    }</style>

			<xsl:variable name="viewnaam">
				<xsl:value-of select="@view"/>
			</xsl:variable>

			<xsl:variable name="afdrukdatum">
				<xsl:value-of select="//header/dateTime"/>
			</xsl:variable>

			<xsl:variable name="titel">
				<xsl:choose>
					<xsl:when test="$viewnaam='PNBR_V_RAP_DAGSTAAT_CAT'">Dagstaat</xsl:when>
					<xsl:otherwise>Evenementen</xsl:otherwise>
				</xsl:choose>
			</xsl:variable>

			<table width="100%" cellspacing="0" cellpadding="5">

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

        <!-- catering niet opnemen op de dagstaat als deze afgeleverd/afgehaald moet worden in het dienstenplein
				     of als het een lege voorzieningenreservering is (opstelling is leeg en aantalcatering = 0) -->
				<xsl:variable name="sorted">
					<xsl:if test="@view = 'PNBR_V_RAP_DAGSTAAT_CAT'">
						<xsl:for-each select="rapport_data/data_row">
							<xsl:sort select="VERDIEPING"/>
							<xsl:sort select="TIJDSORT"/>
							<xsl:if test="RUIMTE != 'PH-01-P-36' and not (not(OPSTELLING) and AANTALCATERING = 0)">
								<xsl:copy-of select="."/>
							</xsl:if>
						</xsl:for-each>
					</xsl:if>
					<xsl:if test="@view = 'PNBR_V_RAP_DAGSTAAT_EVEN'">
						<xsl:for-each select="rapport_data/data_row">
							<xsl:sort select="TIJDSORT"/>
							<xsl:if test="RUIMTE != 'PH-01-P-36'">
								<xsl:copy-of select="."/>
							</xsl:if>
						</xsl:for-each>
					</xsl:if>
				</xsl:variable>


				<xsl:for-each select="msxml:node-set($sorted)/data_row">

					<xsl:variable name="prev_nr">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/NUMMER"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>

					<xsl:variable name="next_nr">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="following-sibling::data_row[1]/NUMMER"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>

					<xsl:variable name="prev_opm">
						<xsl:choose>
							<xsl:when test="position()=1"></xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/OPMERKING"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>

					<xsl:variable name="prev_cdk">
						<xsl:choose>
							<xsl:when test="position()=1"></xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/CDK"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>

					<xsl:variable name="prev_gs">
						<xsl:choose>
							<xsl:when test="position()=1"></xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/GS"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>

					<xsl:variable name="prev_verdieping">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/VERDIEPING"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>

					<xsl:variable name="prev_datum">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/FCLT_D_DATUM"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>

					<xsl:variable name="prev_activiteit">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/ACTIVITEIT"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>

					<xsl:if test="$prev_nr != NUMMER">

						<xsl:if test="position() != 1">
							<tr>
								<td class="tdbl">&#xA0;</td>
								<td class="tdb">&#xA0;</td>
								<td class="tdb">&#xA0;</td>
								<td class="tdb">&#xA0;</td>
								<td class="tdb">&#xA0;</td>
								<td class="tdb">
									<xsl:if test="$prev_cdk=1">aanwezig cdk</xsl:if>
									<xsl:if test="$prev_gs=1">
										<xsl:if test="$prev_cdk=1">
											<br/>
										</xsl:if>aanwezig gedeputeerde</xsl:if>
									<xsl:if test="$prev_activiteit='Evenement'">
										<xsl:if test="$prev_cdk=1 or $prev_gs=1">
											<br/>
										</xsl:if>
										<i>evenement</i>
									</xsl:if>&#xA0;</td>
								<td class="tdb">&#xA0;</td>
								<td class="tdbr" colspan="5">
									<xsl:call-template name="linebreaks">
										<xsl:with-param name="string" select="$prev_opm"/>
									</xsl:call-template>&#xA0;</td>
							</tr>
							<xsl:text disable-output-escaping="yes">&lt;/tbody&gt;</xsl:text>
						</xsl:if>

						<xsl:if test="($prev_verdieping != VERDIEPING and $viewnaam='PNBR_V_RAP_DAGSTAAT_CAT') or                       ($prev_datum != FCLT_D_DATUM and $viewnaam='PNBR_V_RAP_DAGSTAAT_EVEN') or position() = 1">


							<xsl:if test="position() != 1">
								<xsl:text disable-output-escaping="yes">&lt;/table&gt;</xsl:text>
								<div style="page-break-before:always">&#xA0;</div>
								<xsl:text disable-output-escaping="yes">&lt;table width="100%" cellspacing="0" cellpadding="5"&gt;</xsl:text>
							</xsl:if>
							<thead>
								<tr>
									<th height="15" colspan="7" style="background-color: #FFFFFF">
										<b style="font-size: 14pt;">
											<xsl:value-of select="$titel"/>
										</b>
									</th>
									<th colspan="5" style="background-color: #FFFFFF; text-align:right">Afdrukdatum: <xsl:value-of select="$afdrukdatum"/></th>
								</tr>
								<tr>
									<th height="15" colspan="12" style="border-left: 1px solid #808080; border-right: 1px solid #808080; border-top: 1px solid #808080;">
										<b>
											<xsl:value-of select="DAGVWEEK"/>&#xA0;<xsl:value-of select="DAG"/>&#xA0;<xsl:value-of select="MAAND"/>&#xA0;<xsl:value-of select="JAAR"/><xsl:if test="$viewnaam='PNBR_V_RAP_DAGSTAAT_CAT'"> - <xsl:value-of select="VERDIEPING"/></xsl:if></b>
									</th>
								</tr>
								<tr>
									<th colspan="3" style="border-left: 1px solid #808080; border-bottom: 1px solid #808080;">van - tot</th>
									<th style="border-bottom: 1px solid #808080;">Aantal</th>
									<th style="border-bottom: 1px solid #808080;">Ruimte</th>
									<th style="border-bottom: 1px solid #808080;">Reservering</th>
									<th style="border-bottom: 1px solid #808080;">Levertijd</th>
									<th style="border-bottom: 1px solid #808080;">Melder</th>
									<th style="border-bottom: 1px solid #808080;">Telefoonnr</th>
									<th style="border-bottom: 1px solid #808080;">Kost.pl.</th>
									<th style="border-bottom: 1px solid #808080;">Begr. post</th>
									<th style="border-right: 1px solid #808080; border-bottom: 1px solid #808080;">Opstelling</th>
								</tr>
							</thead>
						</xsl:if>
						<tr>
							<td style="background-color: #ffffff" height="10"></td>
						</tr>
						<xsl:text disable-output-escaping="yes">&lt;tbody&gt;</xsl:text>
						<tr>
							<td class="tdtl">
								<b>
									<xsl:value-of select="RUIMTE_VAN"/>
								</b>&#xA0;</td>
							<td class="tdt">
								<b>-</b>
							</td>
							<td class="tdt">
								<b>
									<xsl:value-of select="RUIMTE_TOT"/>
								</b>&#xA0;</td>
							<td class="tdt" align="right">&#xA0;<xsl:value-of select="BEZOEKERS"/>&#xA0;</td>
							<td class="tdt">
								<xsl:value-of select="RUIMTE"/>&#xA0;</td>
							<td class="tdt">
								<b>
									<xsl:value-of select="OMSCHRIJVING"/>
								</b>&#xA0;</td>
							<td class="tdt">&#xA0;</td>
							<td class="tdt">
								<xsl:value-of select="MELDER"/>&#xA0;</td>
							<td class="tdt">
								<xsl:value-of select="TELEFOON"/>&#xA0;</td>
							<td class="tdt">
								<xsl:value-of select="KOSTENPLAATS"/>&#xA0;</td>
							<td class="tdt">
								<xsl:value-of select="BEGRPOST"/>&#xA0;</td>
							<td class="tdtr">
								<xsl:value-of select="OPSTELLING"/>&#xA0;</td>
						</tr>
					</xsl:if>
					<xsl:if test="$prev_nr = NUMMER or V_OMSCHRIJVING != ''">
						<tr>
							<td class="tdl">&#xA0;</td>
							<td>&#xA0;</td>
							<td>&#xA0;</td>
							<td>&#xA0;</td>
							<td align="right">
								<xsl:value-of select="V_AANTAL"/>&#xA0;</td>
							<td>
								<xsl:value-of select="V_OMSCHRIJVING"/>&#xA0;</td>
							<td>
								<xsl:value-of select="V_VAN"/>&#xA0;</td>
							<td>&#xA0;</td>
							<td>&#xA0;</td>
							<td>&#xA0;</td>
							<td>&#xA0;</td>
							<td class="tdr">&#xA0;</td>
						</tr>
					</xsl:if>
					<xsl:if test="$next_nr = ''">
						<tr>
							<td class="tdbl">&#xA0;</td>
							<td class="tdb">&#xA0;</td>
							<td class="tdb">&#xA0;</td>
							<td class="tdb">&#xA0;</td>
							<td class="tdb">&#xA0;</td>
							<td class="tdb">
								<xsl:if test="$prev_cdk=1">aanwezig cdk</xsl:if>
								<xsl:if test="$prev_gs=1">
									<xsl:if test="$prev_cdk=1">
										<br/>
									</xsl:if>aanwezig gedeputeerde</xsl:if>
								<xsl:if test="$prev_activiteit='Evenement'">
									<xsl:if test="$prev_cdk=1 or $prev_gs=1">
										<br/>
									</xsl:if>
									<i>evenement</i>
								</xsl:if>&#xA0;</td>
							<td class="tdb">&#xA0;</td>
							<td class="tdbr" colspan="5">
								<xsl:call-template name="linebreaks">
									<xsl:with-param name="string" select="$prev_opm"/>
								</xsl:call-template>&#xA0;</td>
						</tr>
					</xsl:if>
				</xsl:for-each>
				<tr>
					<td class="tdbl">&#xA0;</td>
					<td colspan="10" class="tdb">&#xA0;</td>
					<td class="tdbr">&#xA0;</td>
				</tr>
			</table>
		</xsl:if>

		<xsl:if test="@view = 'PNBR_V_RAP_IDEEENBUS' or @view = 'pnbr_v_rap_ideeenbus'">
			<xsl:variable name="viewnaam">
				<xsl:value-of select="@view"/>
			</xsl:variable>

			<script language="javascript">function showhidedetails(rowid) {
  // verwijder scrollbar
  parent.document.body.style.overflow="hidden";

  trnr = document.getElementById('tr_einde');
  if(trnr) trnr.style.display= "none"

  trnr = document.getElementById(rowid);
  if(trnr) {
	   if (trnr.style.display == "none") {
       trnr.style.display= "table-row"
     }
     else {
       trnr.style.display= "none"
    }
  }
}</script>


			<table width="100%" cellspacing="0" cellpadding="5" border="1">

				<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="substring(DATUM,7,4)" order="descending"/>
						<!-- year sort -->
						<xsl:sort select="substring(DATUM,4,2)" order="descending"/>
						<!-- month sort -->
						<xsl:sort select="substring(DATUM,1,2)" order="descending"/>
						<!-- day sort -->

						<xsl:copy-of select="."/>
					</xsl:for-each>
				</xsl:variable>

				<thead>
					<tr>
						<th>Nummer</th>
						<th>Datum</th>
						<th>Omschrijving</th>
						<th>Status</th>
					</tr>
				</thead>

				<xsl:for-each select="msxml:node-set($sorted)/data_row">
					<xsl:element name="tr">
						<xsl:attribute name="id">
							<xsl:value-of select="MELDING"/>
						</xsl:attribute>
						<td>
							<xsl:value-of select="MELDING"/>
						</td>
						<td>
							<xsl:value-of select="DATUM"/>
						</td>
						<td>
							<xsl:element name="a">
								<xsl:attribute name="onclick">showhidedetails('<xsl:value-of select="MELDING"/>_1');</xsl:attribute>
								<xsl:attribute name="style">{ cursor: hand; color: red;}</xsl:attribute><xsl:value-of select="FCLT_F_KORTE_OMSCHRIJVING"/></xsl:element>
						</td>
						<td>
							<xsl:value-of select="FCLT_F_STATUS"/>
						</td>
					</xsl:element>
					<xsl:element name="tr">
						<xsl:attribute name="id">
							<xsl:value-of select="MELDING"/>_1</xsl:attribute>
						<xsl:attribute name="style">display:none;</xsl:attribute>						<td colspan="4" cellspacing="100">
							<table width="100%" cellspacing="0" cellpadding="5" border="0">
								<tr>
									<td width="40">&#xA0;</td>
									<td style="background-color:#cccccc;" align="right" width="150px">
										<b>Idee:&#xA0;</b>
									</td>
									<td style="background-color:#cccccc;">
										<xsl:value-of select="IDEE"/>
									</td>
									<td width="40"></td>
								</tr>
								<tr>
									<td width="40">&#xA0;</td>
									<td style="background-color:#cccccc;" align="right">
										<b>Financieel voordeel:&#xA0;</b>
									</td>
									<td style="background-color:#cccccc;">
										<xsl:value-of select="FINANCIEEL"/>
									</td>
									<td width="40"></td>
								</tr>
								<tr>
									<td width="40">&#xA0;</td>
									<td style="background-color:#cccccc;" align="right">
										<b>Immaterieel voordeel:&#xA0;</b>
									</td>
									<td style="background-color:#cccccc;">
										<xsl:value-of select="IMMATERIEEL"/>
									</td>
									<td width="40"></td>
								</tr>
								<tr>
									<td width="40">&#xA0;</td>
									<td style="background-color:#cccccc;" align="right">
										<b>Afhandeling:&#xA0;</b>
									</td>
									<td style="background-color:#cccccc;">
										<xsl:value-of select="AFHANDELING"/>
									</td>
									<td width="40"></td>
								</tr>
							</table>
						</td>
					</xsl:element>
				</xsl:for-each>
				<tr id="tr_einde" height="300">
					<td colspan="4">
					</td>
				</tr>
			</table>
		</xsl:if>

		<xsl:if test="@view = 'PNBR_V_RAP_APPL_BESCHIKB' or @view = 'pnbr_v_rap_appl_beschikb'">
			<xsl:variable name="viewnaam">
				<xsl:value-of select="@view"/>
			</xsl:variable>

			<table width="100%" cellspacing="0" cellpadding="5" border="1">
				<tr>
					<xsl:for-each select="rapport_data/data_row">
						<th style="text-align: center">
							<xsl:value-of select="APPLICATIE"/>
						</th>
					</xsl:for-each>
				</tr>
				<tr>
					<xsl:for-each select="rapport_data/data_row">
						<xsl:element name="td">
							<xsl:if test="STATUS = 'DOWN'">
								<xsl:attribute name="style">cursor:pointer; color: red; font-weight:bold; text-align: center;</xsl:attribute>
							</xsl:if>
							<xsl:if test="STATUS = 'UP'">
								<xsl:attribute name="style">cursor:pointer; color: green; text-align: center;</xsl:attribute>
							</xsl:if>
							<xsl:attribute name="onclick">FcltMgr.openDetail('appl/ins/ins_deel.asp?urole=bo&amp;ins_key=<xsl:value-of select="INS_KEY"/>', 'Details <xsl:value-of select="HIDE_F_MLD_MELDING_KEY"/>');</xsl:attribute>
							<xsl:value-of select="STATUS"/>
						</xsl:element>
					</xsl:for-each>
				</tr>
			</table>
		</xsl:if>

		<xsl:if test="@view = 'PNBR_V_RAP_BESCHIKB_DIENST' or @view = 'pnbr_v_rap_beschikb_dienst'">
			<xsl:variable name="viewnaam">
				<xsl:value-of select="@view"/>
			</xsl:variable>

			<table width="100%" cellspacing="0" cellpadding="5" border="1">
				<tr>
					<xsl:for-each select="rapport_data/data_row">
						<th style="text-align: center">
							<xsl:value-of select="NAAM"/>
						</th>
					</xsl:for-each>
				</tr>
				<tr>
					<xsl:for-each select="rapport_data/data_row">
						<xsl:element name="td">
							<xsl:attribute name="style">cursor:pointer; text-align: center; font-weight:bold;</xsl:attribute>
							<xsl:attribute name="onclick">FcltMgr.openDetail('appl/ins/ins_deel.asp?urole=bo&amp;ins_key=<xsl:value-of select="INS_KEY"/>', 'Details <xsl:value-of select="HIDE_F_MLD_MELDING_KEY"/>');</xsl:attribute>
							<xsl:value-of select="DECT"/>
						</xsl:element>
					</xsl:for-each>
				</tr>
				<tr>
					<xsl:for-each select="rapport_data/data_row">
						<xsl:element name="td">
							<xsl:attribute name="style">cursor:pointer; text-align: center; font-weight:bold;</xsl:attribute>
							<xsl:attribute name="onclick">FcltMgr.openDetail('appl/ins/ins_deel.asp?urole=bo&amp;ins_key=<xsl:value-of select="INS_KEY"/>', 'Details <xsl:value-of select="HIDE_F_MLD_MELDING_KEY"/>');</xsl:attribute>
							<xsl:value-of select="MOBIEL"/>
						</xsl:element>
					</xsl:for-each>
				</tr>
			</table>
		</xsl:if>

		<xsl:if test="@view = 'PNBR_V_RAP_DPL_MELDINGEN' or @view = 'pnbr_v_rap_dpl_meldingen'">

			<xsl:variable name="viewnaam">
				<xsl:value-of select="@view"/>
			</xsl:variable>

			<xsl:variable name="sorted">
				<xsl:for-each select="rapport_data/data_row">
					<xsl:sort select="MLD_KEY"/>
					<xsl:if test="AFGEMELD = 0">
						<xsl:copy-of select="."/>
					</xsl:if>
				</xsl:for-each>
			</xsl:variable>

			<table width="100%" cellspacing="0" cellpadding="5" border="1">
				<tr>
					<th style="text-align: center">Datum</th>
					<th style="text-align: center">ACTUELE MELDINGEN</th>
					<th style="text-align: center">Workaround</th>
				</tr>
				<xsl:for-each select="msxml:node-set($sorted)/data_row">
					<xsl:element name="tr">
						<xsl:attribute name="class">
							<xsl:if test="INTERVALWIJZ &lt; 1">updated</xsl:if>
						</xsl:attribute>
						<xsl:attribute name="style">cursor:pointer;</xsl:attribute>
						<td>
							<xsl:value-of select="DATUM"/>
						</td>
						<xsl:element name="td">
							<xsl:attribute name="onclick">FcltMgr.openDetail('appl/mld/mld_melding.asp?urole=bo&amp;mld_key=<xsl:value-of select="MLD_KEY"/>', '');</xsl:attribute>
							<xsl:value-of select="OMSCHRIJVING"/>
						</xsl:element>
						<td>
							<xsl:choose>
								<xsl:when test="WORKAROUND='0'">Nee</xsl:when>
								<xsl:when test="WORKAROUND='1'">Ja</xsl:when>
							</xsl:choose>
						</td>
					</xsl:element>
				</xsl:for-each>
			</table>

			<br/>

			<xsl:variable name="sorted2">
				<xsl:for-each select="rapport_data/data_row">
					<xsl:sort select="MLD_KEY"/>
					<xsl:if test="AFGEMELD = 1">
						<xsl:copy-of select="."/>
					</xsl:if>
				</xsl:for-each>
			</xsl:variable>

			<table width="100%" cellspacing="0" cellpadding="5" border="1">
				<tr>
					<th style="text-align: center">Datum</th>
					<th style="text-align: center">AFGESLOTEN MELDINGEN</th>
					<th style="text-align: center">Workaround</th>
				</tr>

				<xsl:for-each select="msxml:node-set($sorted2)/data_row">
					<xsl:element name="tr">
						<xsl:attribute name="class">
							<xsl:if test="INTERVALWIJZ &lt; 1">updated</xsl:if>
						</xsl:attribute>
						<xsl:attribute name="style">cursor:pointer;</xsl:attribute>
						<td>
							<xsl:value-of select="DATUM"/>
						</td>
						<xsl:element name="td">
							<xsl:attribute name="onclick">FcltMgr.openDetail('appl/mld/mld_melding.asp?urole=bo&amp;mld_key=<xsl:value-of select="MLD_KEY"/>', '');</xsl:attribute>
							<xsl:value-of select="OMSCHRIJVING"/>
						</xsl:element>
						<td>
							<xsl:choose>
								<xsl:when test="WORKAROUND='0'">Nee</xsl:when>
								<xsl:when test="WORKAROUND='1'">Ja</xsl:when>
							</xsl:choose>
						</td>
					</xsl:element>
				</xsl:for-each>
			</table>
		</xsl:if>

		<xsl:if test="@view = 'PNBR_V_RAP_MELDING_TOP25' or @view = 'pnbr_v_rap_melding_top25'">
			<xsl:variable name="viewnaam">
				<xsl:value-of select="@view"/>
			</xsl:variable>

			<table width="100%" cellspacing="0" cellpadding="5" border="1">
				<tr>
					<th>Vakgroep</th>
					<th>Melding</th>
					<th>Aantal</th>
				</tr>
				<xsl:for-each select="rapport_data/data_row">
					<xsl:sort select="AANTAL" data-type="number" order="descending"/>
					<xsl:if test="position() &lt; 26">
						<tr>
							<td>
								<xsl:value-of select="INS_DISCIPLINE_OMSCHRIJVING"/>
							</td>
							<td>
								<xsl:value-of select="MLD_STDMELDING_OMSCHRIJVING"/>
							</td>
							<td>
								<xsl:value-of select="AANTAL"/>
							</td>
						</tr>
					</xsl:if>
				</xsl:for-each>
			</table>
		</xsl:if>

		<xsl:if test="@view = 'PNBR_V_RAP_BEZOEKERS_C_TOREN' or @view = 'pnbr_v_rap_bezoekers_c_toren'">
			<style>tbody {
       page-break-inside: avoid;
    }
    th {
      border: 0px none #ffffff;
	  font-family: Verdana;
      text-align: left;
      font-weight: bold;
      background-color: #DD0000;
      color: #FFFFFF;
    }
    td {
  	  font-family: Verdana;
      background-color: #FFFFFF;
    }</style>

			<xsl:variable name="viewnaam">
				<xsl:value-of select="@view"/>
			</xsl:variable>

			<xsl:variable name="afdrukdatum">
				<xsl:value-of select="//header/dateTime"/>
			</xsl:variable>

			<table width="100%" cellspacing="0" cellpadding="5">

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

				<xsl:for-each select="rapport_data/data_row">
				<xsl:sort select="HIDE_F_TS"/>

					<xsl:if test="position() = 1">
					<tr>
						<th>Locatie</th>
						<th>Datum</th>
						<th>Van</th>
						<th>Tot</th>
						<th>Bezoeker</th>
						<th>Bedrijf</th>
						<th>Opdrachtgever</th>
						<th>Telefoon</th>
						<th>Opmerking</th> 
					</tr>
					</xsl:if>
					<tr>
						<td><xsl:value-of select="LOCATIE"/></td>
						<td><xsl:value-of select="DATUM"/></td>
						<td><xsl:value-of select="VAN"/></td>
						<td><xsl:value-of select="TOT"/></td>
						<td><xsl:value-of select="BEZOEKER"/></td>
						<td><xsl:value-of select="BEDRIJF"/></td>
						<td><xsl:value-of select="OPDRACHTGEVER"/></td>
						<td><xsl:value-of select="TELEFOON"/></td>
						<td><xsl:value-of select="OPMERKING"/></td> 
					</tr>
				</xsl:for-each>

			</table>
		</xsl:if>

	</xsl:template>
</xsl:stylesheet>