<!--  $Id$  -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:include href="/app/tools/support/templates/layout.xsl" />

  <xsl:template name="mainBody" >
    <xsl:call-template name="bodyTitle" >
      <xsl:with-param name="title">Client Detail</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="bodyMessage" />
    <xsl:call-template name="displayForm" />
  </xsl:template>

  <xsl:template name="displayForm" >
    <div name="body_form">
      <xsl:choose>
        <xsl:when test="Form/ClientID &gt; 0">
          <xsl:call-template name="displayDetail" />
        </xsl:when>
        <xsl:otherwise>
          Client not found
        </xsl:otherwise>
      </xsl:choose>
    </div>
  </xsl:template>

  <xsl:template name="displayDetail" >
    <form method="post" action="{$moduleURL}" >
      <input type="hidden" name="c"><xsl:attribute name="value"><xsl:value-of select="/Root/Cmd" /></xsl:attribute></input>
      <input type="hidden" name="ClientID"><xsl:attribute name="value"><xsl:value-of select="Form/ClientID" /></xsl:attribute></input>
      <input type="hidden" name="action"><xsl:attribute name="value"><xsl:value-of select="Params/action" /></xsl:attribute></input>
    <fieldset>
      <legend>Client</legend>
      <table>

        <tr>
          <xsl:call-template name="textField" >
            <xsl:with-param name="label">Client ID</xsl:with-param>
            <xsl:with-param name="value" select = "Form/ClientID" />
          </xsl:call-template>
        </tr>

        <tr>
          <xsl:call-template name="textField" >
            <xsl:with-param name="label">Name</xsl:with-param>
            <xsl:with-param name="value" select = "Form/ClientName" />
          </xsl:call-template>
        </tr>

      </table>
    </fieldset>
    </form>
  </xsl:template>

  <xsl:template name="displayButtons" >
    <xsl:if test="/Root/Params/ClientID" >
      <xsl:call-template name="backButton" >
        <xsl:with-param name="buttonText">Return to Client</xsl:with-param>
        <xsl:with-param name="command" >client_detail</xsl:with-param>
        <xsl:with-param name="args" >
          <ClientID><xsl:value-of select="/Root/Params/ClientID" /></ClientID>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:if>
    <xsl:call-template name="submitButton" />
  </xsl:template>

</xsl:stylesheet>
