<?php use_helper('UrlFunctions'); ?>
<?php

if(isset($control)){

 	$o_clienteBean = new ClienteBean();	
	$o_clienteBean->setFlagConHuella("N");
	$o_clienteBean->setFlagHuellaConProblema("N");
	$o_clienteBean->setIdCliente($id);
	$o_clienteDP = new ClienteDP($o_clienteBean);
	$bResult = $o_clienteDP->update();	
	unlink ("../images/huella/cliente/".$id.".txt" );
   
  if(1){
    
    ?>
    <script language="JavaScript">
    parent.objMainTab.reqBody('<?=buildUrl('cli/list_gen')?>','&block=001&insert=1&id=<?=$id;?>');
    parent.objMainTab.windowsCloseAll();
    </script>
    <?
  }else{
    $url = buildUrl('rep/add', "block=".$block."&error=1");
  }
  exit;
}


  //Mercados
  $o_ClienteSystemClass = new ClienteSystemClass(new MercadoBean());
  $a_Mercado = $o_ClienteSystemClass->getMercado();
  
  //Tipos de Negocio
  $o_ClienteSystemClass = new ClienteSystemClass(new TipoNegocioBean());
  $a_TipoNegocio = $o_ClienteSystemClass->getTipoNegocio();

//Cargar Documento
$o_ClienteSystemClass = new ClienteSystemClass(new DocumentoBean());
$a_o_Documento = $o_ClienteSystemClass->getDocumento();

$o_DocumentoClienteBean = new DocumentoClienteBean();
$o_DocumentoClienteBean->setIdCliente($id);
$o_DocumentoClienteBL = new DocumentoClienteBL();
$a_o_documento = $o_DocumentoClienteBL->busquedaDocumentoClienteDetalle($o_DocumentoClienteBean);
if(is_array($a_o_documento)){
	foreach ($a_o_documento as $key =>$o_documento){
		$a_id_documento[] = $o_documento->getIdDocumento();
	}
}

  

$o_ClienteBean = new ClienteBean();
$o_ClienteBean->setIdCliente($id);
$o_class = new ClienteBL();
$a_ObjectBean = $o_class->busquedaCliente($o_ClienteBean);

if(is_array($a_ObjectBean)){
  while(list($key,$o_ObjectBean) = each($a_ObjectBean)){
?>

<img src="/images/common/spacer.gif" width="10">
<table class="cuerpo" width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="0">
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <td class="titleBody">
            <li>Cliente</li>
            <span class="subtitle"><I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:::&nbsp;¿Esta seguro de eliminar la huella del Cliente?</I></span></td>
          <td align="right" valign="baseline">&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
      <script type="text/javascript">
        validatePass = function(){
            valid.onSubmit = false;
        }
      </script>
  <tr>
    <td valign="top">
     <form id="form1" name="form1" method="POST">
      <input type="hidden" name="control" value="1">
      
        <table hspace="20px" class="marco" width="90%">
          <tr>
            <td valign="top">
	
              <table width="100%" border="0" cellpadding="5" cellspacing="0" style="background: #E3E9E2">
          		<tr>
    				  <td height="0">
    				  
    					 <table width="100%" border="0" cellspacing="1" cellpadding="0">
							  <tr>
								<td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="txtDniCliente" >DNI </label></td>
								<td width="38%" nowrap="nowrap"><label class="label" for="Dni">&nbsp;:&nbsp;<?=$o_ObjectBean->getDni() ?></label></td>
								 
							   </tr>
							   <tr>
								<td nowrap="nowrap" class="cabecera"><label class="label req" for="txtNombres" >Nombres </label></td>
								<td width="38%" nowrap="nowrap"><label class="label" for="Nombres">&nbsp;:&nbsp;<?=$o_ObjectBean->getNombres() ?></label></td>
								
							  </tr>
							  <tr>
								<td nowrap="nowrap" width="12%" class="cabecera"><label class="label" for="txtApellidoPaterno">Apellido Paterno </label></td>
								<td width="38%" nowrap="nowrap"><label class="label" for="ApellidoPaterno">&nbsp;:&nbsp;<?=$o_ObjectBean->getApellidoPaterno() ?></label></td>
								 
							  </tr>
							  
							  <tr>
								<td nowrap="nowrap" width="12%" class="cabecera"><label class="label" for="txtApellidoMaterno" >Apellido Materno </label></td>
								<td width="38%" nowrap="nowrap"><label class="label" for="ApellidoMaterno">&nbsp;:&nbsp;<?=$o_ObjectBean->getApellidoMaterno() ?></label></td>
								
							  </tr>
							 
							  <tr>
							   <td nowrap="nowrap" width="12%" class="cabecera"><label class="label" for="txtEstado">Estado</label></td>
								<td width="38%" nowrap="nowrap"><label class="label" for="Estado">&nbsp;:&nbsp;<? if ($o_ObjectBean->getEstado()=='A'){ echo "Activo";} else { echo "Inactivo";}?></label></td>
								<td nowrap="nowrap" width="12%" class="cabecera">&nbsp;</td>
								  
							  </tr>
						</table>
    					
    				</td>
                </tr>
    			<tr>

				<td height="0" width="100%">
    			  <table width="100%" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td><img src="/images/common/spacer.gif" width="10"></td>
					 </tr>
						<tr>
						 <td align="center">
						  <input type="hidden" name="typeSubmit" id="typeSubmit">
						  <input class="button" type="submit" value="Aceptar" onclick="$('typeSubmit').value='list';">
						   <input class="button" type="button" value="Cancelar" onclick="parent.objMainTab.windowsCloseAll();"/>
						  </td>
						</tr>
						<tr>
					<td height="10">&nbsp;</td>
				 </tr>
			    </table>
			    </td>
			   </tr>
  				
        		</tr>
				<tr>
      			</table>
     		</form>
			<script type="text/javascript">
				var valid = new Validation('form1', {immediate : true});
			</script>
			</td>
  		  </tr>
		</table>
    </td>
  </tr>
</table>
<?php
  }
}
?>

