<?xml version="1.0" encoding="ISO-8859-15"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xslc="http://xslcomponents.org/TR/WD-xslc" xmlns:yui="http://developer.yahoo.com/yui/">
	<xsl:import href="../../yui-VO20210707.xsl"/>
	<xsl:template match="/">
		<xsl:apply-templates select="document"/>
	</xsl:template>
	<xsl:template match="document">
		<html>
			<head>
				<meta http-equiv="Expires" content="0"/>
				<link rel="stylesheet" type="text/css" href="{$XMLC_SkinPath}xslc.css"/>
				<link rel="stylesheet" type="text/css" href="{$XMLC_SkinPath}common.css"/>
				<xsl:call-template name="yui:AutoComplete.Head"/>
				<script language="javascript">
					<![CDATA[function getObjectById(ID) {
	var obj;
	if (document.getElementById)
		return document.getElementById(ID);
	else if (document.all)
		return document.all(ID);
	else
		return eval('document.' + ID);
}

function getParentObjectById(ID)
{
	if (!parent)
		return null;
	if (parent.getObjectById)
		return parent.getObjectById(ID);
	else if (parent.document.getElementById)
		return parent.document.getElementById(ID)
	else if (parent.document.all)
		return parent.document.all(ID);
	else
		return null;
}

function donner_focus(chp)
{

  var focusControl = getObjectById(chp);
	try {
focusControl.focus();
      }
      catch (err) {
      }
}]]>
				</script>
			</head>
			<body onload="donner_focus('InputSearchVO');" style="background:url({$XMLC_Portal}Pictos/backframe.gif) repeat-x top left; ">
				<form action="{/document/Aliases/bdVODLL}SearchVO" name="MainForm" method="post">
					<input type="hidden" name="SVOTypeSearch" value="{/document/OutParams/TypeSearch}"/>
					<input type="hidden" name="SVOTypeVO" value="{/document/OutParams/TypeVO}"/>
					<input type="hidden" name="SVOSITE" value="{/document/OutParams/SITE}"/>
				</form>
				<table cellpadding="0" cellspacing="0" height="100%" width="100%">
					<tr height="8px">
						<td/>
						<td/>
					</tr>
					<tr>
						<td width="140px" align="right">Type Recherche: </td>
						<td>
							<select id="CBsearch" onchange="javascript: document.MainForm.SVOTypeSearch.value=getObjectById('CBsearch').value; document.MainForm.submit(); return false;" style="width:125px">
								<option value="1" style="color:blue">
									<xsl:if test="/document/OutParams/TypeSearch=1">
										<xsl:attribute name="selected"/>
									</xsl:if>Immatriculation</option>
								<option value="2" style="color:blue">
									<xsl:if test="/document/OutParams/TypeSearch=2">
										<xsl:attribute name="selected"/>
									</xsl:if>Acheteur</option>
								<option value="3" style="color:blue">
									<xsl:if test="/document/OutParams/TypeSearch=3">
										<xsl:attribute name="selected"/>
									</xsl:if>N° Véhicule</option>
								<option value="9" style="color:blue">
									<xsl:if test="/document/OutParams/TypeSearch=9">
										<xsl:attribute name="selected"/>
									</xsl:if>N° Affaire Financement</option>
								<option value="18" style="color:blue">
									<xsl:if test="/document/OutParams/TypeSearch=18">
										<xsl:attribute name="selected"/>
									</xsl:if>N° Châssis</option>

								<xsl:if test="/document/XMLC_Params/XMLC_Authenticated != '0' and (/document/XMLC_Params/User_Agent != '1')">
								<option value="4" style="color:orange">
									<xsl:if test="/document/OutParams/TypeSearch=4">
										<xsl:attribute name="selected"/>
									</xsl:if>BProFid - N° Immat</option>
								<option value="5" style="color:orange">
									<xsl:if test="/document/OutParams/TypeSearch=5">
										<xsl:attribute name="selected"/>
									</xsl:if>BProFid - Nom Client</option>
								<option value="6" style="color:orange">
									<xsl:if test="/document/OutParams/TypeSearch=6">
										<xsl:attribute name="selected"/>
									</xsl:if>BProFid - Mobile</option>
								<option value="7" style="color:orange">
									<xsl:if test="/document/OutParams/TypeSearch=7">
										<xsl:attribute name="selected"/>
									</xsl:if>BProFid - Téléphone</option>
								<option value="8" style="color:orange">
									<xsl:if test="/document/OutParams/TypeSearch=8">
										<xsl:attribute name="selected"/>
									</xsl:if>BProFid - Mail</option>
								<option value="19" style="color:orange">
									<xsl:if test="/document/OutParams/TypeSearch=19">
										<xsl:attribute name="selected"/>
									</xsl:if>BProFid - N° Châssis</option>
								<option value="10" style="color:orange">
									<xsl:if test="/document/OutParams/TypeSearch=10">
										<xsl:attribute name="selected"/>
									</xsl:if>BProFid - SIREN</option>
								</xsl:if>

								<xsl:if test="/document/XMLC_Params/XMLC_Authenticated != '0' and (/document/XMLC_Params/XMLC_Administrator = '1' or /document/XMLC_Params/XMLC_Supervisor = '1'  or /document/XMLC_Params/User_CarFid = '1' )">
									<option value="20" style="color:violet">
										<xsl:if test="/document/OutParams/TypeSearch=20">
											<xsl:attribute name="selected"/>
										</xsl:if>SAV - N° Immat</option>
									<option value="21" style="color:violet">
										<xsl:if test="/document/OutParams/TypeSearch=21">
											<xsl:attribute name="selected"/>
										</xsl:if>SAV - Nom Client</option>
									<option value="22" style="color:violet">
										<xsl:if test="/document/OutParams/TypeSearch=22">
											<xsl:attribute name="selected"/>
										</xsl:if>SAV - N° Facture</option>
									<option value="23" style="color:violet">
										<xsl:if test="/document/OutParams/TypeSearch=23">
											<xsl:attribute name="selected"/>
										</xsl:if>SAV - N° Châssis</option>
									<option value="24" style="color:violet">
										<xsl:if test="/document/OutParams/TypeSearch=24">
											<xsl:attribute name="selected"/>
										</xsl:if>SAV - N° TVA</option>
								</xsl:if>
							</select>
						</td>
					</tr>
					<tr>
						<td align="right">Type Véhicule: </td>
						<td>
							<select id="CBTypeVO" name="CBTypeVO" onchange="javascript: document.MainForm.SVOTypeVO.value=getObjectById('CBTypeVO').value; document.MainForm.submit(); return false;" style="width:125px">
								<option value="0" style="color:blue">
									<xsl:if test="/document/OutParams/TypeVO=0">
										<xsl:attribute name="selected"/>
									</xsl:if>Tous Véhicules</option>
								<option value="3" style="color:blue">
									<xsl:if test="/document/OutParams/TypeVO=3">
										<xsl:attribute name="selected"/>
									</xsl:if>VD</option>
								<option value="2" style="color:blue">
									<xsl:if test="/document/OutParams/TypeVO=2">
										<xsl:attribute name="selected"/>
									</xsl:if>VN</option>
								<option value="1" style="color:blue">
									<xsl:if test="/document/OutParams/TypeVO=1">
										<xsl:attribute name="selected"/>
									</xsl:if>VO</option>
							</select>
						</td>
					</tr>
					<tr>
						<td align="right">Site : </td>
						<td>
							<select id="CBSITE" onchange="javascript: document.MainForm.SVOSITE.value=getObjectById('CBSITE').value; document.MainForm.submit(); return false;">
								<option value="ALL" style="color:blue">Tous Sites</option>
								<xsl:for-each select="/document/ListSITES/ListSITE">
									<xsl:sort select="Site"/>
									<option value="{Site}" style="color:blue">
										<xsl:if test="/document/OutParams/SITE=Site">
											<xsl:attribute name="selected"/>
										</xsl:if>
										<xsl:value-of select="Site"/>
									</option>
								</xsl:for-each>
							</select>
						</td>
					</tr>
					<xsl:call-template name="yui:AutoComplete">
						<xsl:with-param name="Name">InputSearchVO</xsl:with-param>
						<xsl:with-param name="InputAttributes">
							<Attributes size="18"/>
						</xsl:with-param>
						<xsl:with-param name="UseShadow">true</xsl:with-param>
						<xsl:with-param name="DatasXMLServiceName">DataSearchVO</xsl:with-param>
						<xsl:with-param name="ResultRecordName">VO</xsl:with-param>
						<xsl:with-param name="ResultFields">
							<Field>
								<Name>VO_Result</Name>
							</Field>
							<Field>
								<Name>VO_ID</Name>
							</Field>
							<Field>
								<Name>idOwner</Name>
							</Field>
							<Field>
								<Name>VO_ORDRE</Name>
							</Field>
							<Field>
								<Name>VO_NO</Name>
							</Field>
							<Field>
								<Name>VO_IMMAT</Name>
							</Field>
							<Field>
								<Name>VO_DESC</Name>
							</Field>
							<Field>
								<Name>VO_BUYER</Name>
							</Field>
							<Field>
								<Name>VO_Icon</Name>
							</Field>
						</xsl:with-param>
						<xsl:with-param name="TemplateResult">&lt;table style="table-layout: fixed;"&gt;&lt;tr&gt;&lt;td style="vertical-align: middle; display: inline-block; width:100px;"&gt;&lt;div style="width:100px; word-wrap: break-word"&gt;&lt;img border="0" src="<xsl:value-of select="$XMLC_PictosPath"/>
							<FieldName>VO_Icon</FieldName>.gif"/&gt;<xsl:choose>
								<xsl:when test="(/document/OutParams/TypeSearch='3')">
									<span style="color:blue">
										<FieldName>VO_NO</FieldName>
									</span>
								</xsl:when>
								<xsl:otherwise>
									<span style="color:purple">
										<FieldName>VO_NO</FieldName>
									</span>
								</xsl:otherwise>
							</xsl:choose>&lt;/div&gt;&lt;/td&gt;&lt;td style="width:80px;"&gt;&lt;div style="width:80px;word-wrap: break-word"&gt;<span style="color:purple">
								<FieldName>VO_ORDRE</FieldName>
							</span>&lt;/div&gt;&lt;/td&gt;&lt;td style="width:80px;"&gt;&lt;div style="width:80px;word-wrap: break-word"&gt;<xsl:choose>
								<xsl:when test="(/document/OutParams/TypeSearch='9') or (/document/OutParams/TypeSearch='20') ">
									<span style="color:blue">
										<FieldName>VO_Result</FieldName>
									</span>
								</xsl:when>
								<xsl:when test="(/document/OutParams/TypeSearch='1') or (/document/OutParams/TypeSearch='')">
									<span style="color:blue">
										<FieldName>VO_IMMAT</FieldName>
									</span>
								</xsl:when>
								<xsl:otherwise>
									<span style="color:purple">
										<FieldName>VO_IMMAT</FieldName>
									</span>
								</xsl:otherwise>
							</xsl:choose>&lt;/div&gt;&lt;/td&gt;&lt;td style="width:125px;"&gt;&lt;div style="width:125px;word-wrap: break-word"&gt;<xsl:choose>
								<xsl:when test="(/document/OutParams/TypeSearch='20') or (/document/OutParams/TypeSearch='21') ">
									<span style="color:purple">
										<FieldName>VO_DESC</FieldName>
									</span>
								</xsl:when>
								<xsl:when test="(/document/OutParams/TypeSearch='10') ">
									<span style="color:purple">
										<FieldName>VO_BUYER</FieldName>
									</span>
								</xsl:when>
								<xsl:when test="(/document/OutParams/TypeSearch='22') ">
									<span style="color:blue">
										<FieldName>VO_DESC</FieldName>
									</span>
								</xsl:when>
								<xsl:otherwise>
									<span style="color:purple">
										<FieldName>VO_DESC</FieldName>
									</span>
								</xsl:otherwise>
							</xsl:choose>&lt;/div&gt;&lt;/td&gt;&lt;td style="width:125px;"&gt;&lt;div style="width:125px;word-wrap: break-word"&gt;<xsl:choose>
								<xsl:when test="(/document/OutParams/TypeSearch='2') or (/document/OutParams/TypeSearch='21') ">
									<span style="color:blue">
										<FieldName>VO_BUYER</FieldName>
									</span>
								</xsl:when>
								<xsl:when test="(/document/OutParams/TypeSearch='18') or (/document/OutParams/TypeSearch='10') or (/document/OutParams/TypeSearch='19') or (/document/OutParams/TypeSearch='23') or (/document/OutParams/TypeSearch='24') ">
									<span style="color:blue">
										<FieldName>VO_Result</FieldName>
									</span>
								</xsl:when>
								<xsl:otherwise>
									<span style="color:purple">
										<FieldName>VO_BUYER</FieldName>
									</span>
								</xsl:otherwise>
							</xsl:choose>&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</xsl:with-param>
						<xsl:with-param name="VActionOnSelect">// attention : ne s'ajoute pas au script 
// à faire dans ..\..\yui-VO20210707.xsl
if (datas[2]!=0) {

if (getObjectById('CBsearch').value &gt;3)  &amp;&amp;  (getObjectById('CBsearch').value &lt;9) 
parent.PopFormAxVO('FormVO', '0&amp;idClient='+datas[1]);

if (getObjectById('CBsearch').value &lt;4) ||  (getObjectById('CBsearch').value==9) 
parent.PopFormAxVO('FormVO', datas[1]);

if ((getObjectById('CBsearch').value &gt;19)  &amp;&amp; (getObjectById('CBsearch').value &lt;29))
  window.open('ReportPDF?rptSelect=idSPL_Docs;3d;'+datas[1]+'&amp;rptName=Facture', '_blank');

 parent.ShowHide('YuiSearch'); return false;
 }</xsl:with-param>
					</xsl:call-template>
				</table>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>
