<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslc="http://xslcomponents.org/TR/WD-xslc">
	<xsl:import href="../../xslc.xsl"/>
	<xsl:import href="../../Common.xsl"/>
	<xsl:template match="/">
		<xsl:apply-templates select="document"/>
	</xsl:template>
	<xsl:template match="document">
		<xsl:call-template name="xslc:Page">
			<xsl:with-param name="BodyAttributes">
				<Attributes onload="SetTextFact();"/>
			</xsl:with-param>
			<xsl:with-param name="Head">
				<script language="javascript">
					<![CDATA[
function SetTextFact() {
var divFact = document.all ? document.all["zoneFact"] : document.getElementById ? document.getElementById("zoneFact") : ""
var txtFact = ']]>
					<xsl:value-of select="/document/GetStatsS/GetStats/txtFichier"/>
					<![CDATA['; 
divFact.innerText =  txtFact.replace(/ /g,'').replace(/&lt;br&gt;/g,'\n').replace(/&#160;/g,' ').replace(/&#39;/g,"'");
} // SetTextFact]]>
				</script>
				<script language="javascript">
					<![CDATA[// ==========================================================================
// Afficher la fenêtre popup pour la saisie des infos ProFid
// ==========================================================================
function PopFormAxVO(PopID, idVO) {
  if (popObj = getObjectById(PopID)) {
      popObj.src = XMLC_BaseHRef+'FormAxVO?idTVO='+idVO;
  }
}]]>
					<![CDATA[// ==========================================================================
// Afficher la fenêtre popup pour la saisie des infos ProFid
// ==========================================================================
function lPopFormAxVO(PopID, idClient) {
  args='0';
  evt = event;
 if (evt.shiftKey)
    args='1';
  if (popObj = getObjectById(PopID)) {
      popObj.src = XMLC_BaseHRef+'FormAxVO?idClient='+idClient+'&idVersion='+args;
  }
}]]>
				</script>
			</xsl:with-param>
			<xsl:with-param name="Title">
				<xsl:value-of select="/document/GetStatsS/GetStats/typeDocument"/>&#160;<xsl:value-of select="/document/GetStatsS/GetStats/nDocument"/>
			</xsl:with-param>
			<xsl:with-param name="Body">
				<xsl:variable name="stSiteValue">
					<xsl:choose>
						<xsl:when test="/document/GetStatsS/GetStats/TypeDMS= '' or /document/GetStatsS/GetStats/TypeDMS= '0' or /document/GetStatsS/GetStats/TypeDMS= '1'">color:blue;</xsl:when>
						<xsl:otherwise>
							<xsl:choose>
								<xsl:when test="/document/GetStatsS/GetStats/TypeDMS= '2'">color:red;</xsl:when>
							</xsl:choose>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<form action="{/document/Aliases/bdVODLL}CarFidShowFact" name="MainForm" method="post">
					<input type="hidden" name="idSPL_Docs" value="{/document/Params/idSPL_Docs}"/>
					<input type="hidden" name="cfTitle" value="{/document/Params/cfTitle}"/>
					<input type="hidden" name="fClause" value="{/document/Params/fClause}"/>
					<input type="hidden" name="sClause" value="{/document/Params/sClause}"/>
					<input type="hidden" size="200" name="wClause" value="{/document/Params/wClause}"/>
					<input type="hidden" name="oClause" value="{/document/Params/oClause}"/>
				</form>
				<xsl:call-template name="xslc:ApplicationMessages"/>
				<div id="vdivFormVO" class="BoxFrameVN" style="position: absolute; display: none; z-index:1000; PADDING-LEFT: 7 px; ">
					<button class="window-close" onclick="javascript: window.parent.ShowHideForm(vidPaneID);">
						<img border="0" src="{$XMLC_PictosPath}ico_closenew.gif" alt="pour quitter sans enregistrer ..."/>
					</button>Visualisation des données d'un Client<iframe id="FormVO" name="FormVO" border="0" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="{$XMLC_Portal}blank.htm" style="position: absolute; z-index:1000;PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; "/>
				</div>
				<div id="zoneTop" style="{$stSiteValue}">Statistiques CarFid du <xsl:value-of select="/document/Params/CFDeb"/> au <xsl:value-of select="/document/Params/CFFin"/>
				</div>
				<xsl:apply-templates select="GetStatsS"/>
				<xsl:call-template name="xslc:PoweredBy"/>
			</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="GetStatsS">
		<table width="720px" nowrap="nowrap" style="border-width:1px;border-color:#c8c8c8;">
			<tr style="background: #c8c8c8;">
				<td width="80px">système</td>
				<td align="center" width="60px">n° début</td>
				<td align="center" width="60px">n° fin</td>
				<td align="center" width="60px">nb</td>
				<td align="center" width="60px">filtre</td>
				<td align="center" width="100px">statut</td>
				<td align="center" width="250px">infos doublons</td>
				<td/>
			</tr>
			<xsl:apply-templates select="GetStats"/>
		</table>
	</xsl:template>
	<xsl:template match="GetStats">
		<xsl:variable name="clValue">
			<xsl:choose>
				<xsl:when test="TypeDMS=''">clRowHeader</xsl:when>
				<xsl:otherwise>
					<xsl:choose>
						<xsl:when test="position() mod 2 = 1">clRowLight</xsl:when>
						<xsl:otherwise>clRowDark</xsl:otherwise>
					</xsl:choose>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<tr class="{$clValue}">
			<td>
				<xsl:if test="TypeDMS='1'">carbase</xsl:if>
				<xsl:if test="TypeDMS='2'">dcs</xsl:if>
			</td>
			<xsl:choose>
				<xsl:when test="TypeDMS=''">
					<td align="center" colspan="2">
						<xsl:value-of select="MaxDocs"/>
					</td>
				</xsl:when>
				<xsl:otherwise>
					<td align="center">
						<xsl:value-of select="MinDocs"/>
					</td>
					<td align="center">
						<xsl:value-of select="MaxDocs"/>
					</td>
				</xsl:otherwise>
			</xsl:choose>
			<td align="center">
				<xsl:value-of select="cptDocs"/>
			</td>
			<td align="center">
				<xsl:if test="cptInfo!='0'">
					<xsl:value-of select="cptInfo"/>
				</xsl:if>
			</td>
			<td align="center">
				<xsl:if test="cptOK!='0'">
					<xsl:value-of select="cptOK"/>
				</xsl:if>
			</td>
			<td align="center">
				<xsl:value-of select="cptDbl"/>
			</td>
			<td/>
		</tr>
	</xsl:template>
</xsl:stylesheet>
