<?php 
require ('../conectar.php');
require ('funciones.php');
$idexp=$_GET["idexp"];
?>
<html>
<head>
<script src="js/jquery-1.2.6.min.js">
</script>
<script>function validar(x,y,tipo){
	if(x==1)
	{x=0;}
	else
	{x=1;}
    $.post("validandocumento.php",
    {
	  validacion:x,
      idexp:y,
	  tipo:tipo
    },
    function(data,status){
    });
  };
  function mensaje()
  {
  alert("No se ha subido el documento");
  };
  
</script>
<style>
			  .datos{border:0;-moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;-khtml-border-radius: 5px;border-collapse: collapse;color:#0d0d0d;font-family:arial;width:99%;}
			  
			  .datos .trd{ color:#000000 min-height:20px !important;max-height:20px !important;height:20px !important; background:#CCCCCC; font-size:9px;border:solid 1px #000000;}
			  .datos .trd td{padding-left:10px; border-left:solid 1px;}
			  .datos .trb{ color:#000000; min-height:20px !important;max-height:20px !important;height:20px !important; font-size:9px;border:solid 1px #000000;}
			  .datos .trb td{padding-left:10px; border-left:solid 1px;}
			  
			  .loading{ position:fixed;left:50%;top:50%;width:250px;height:70px;margin-left:-125px;margin-top:-35px;display:none;background:url(images/bkloading.png);background-repeat:no-repeat;color:#ffffff;padding-top:25px;text-align:center;font-family:arial;font-size:12px;}
              </style>
</head>
<body>
<?php 
$consulta="SELECT concat(c.nombre,' ',c.a_pat,' ',c.a_mat) as cliente, exp.freg, exp.validacion, exp.identificacion, exp.contrato, exp.hojaregistro  FROM expedienteCliente as exp
	INNER JOIN clientes as c ON exp.idcliente=c.id_cliente where idexp='$idexp'";
$re=mysql_query($consulta);
while($ls=mysql_fetch_array($re)){
$consulta=mysql_query("SELECT validacion FROM expedienteCliente WHERE idexp='$idexp'");
$cons=mysql_fetch_array($consulta);
$x=substr($cons['validacion'], 0, 1);
$y=substr($cons['validacion'], 1, 1);
$z=substr($cons['validacion'], 2, 1);
?>
 
<table class="datos">
  <tr class="trd">
    <td width="149" height="29"><strong>Nombre del cliente </strong></td>
    <td width="136"><strong>Fecha de registro</strong></td>
    <td colspan="2"><strong>Identificacion</strong></td>
    <td colspan="2"><strong>Contrato</strong></td>
    <td colspan="2"><strong>Registro</strong></td>
  </tr>
  <tr class="trb">
    <td height="62"><?php echo $ls['cliente'];?></td>
    <td><?php echo fechatexto($ls['freg']);?></td>
    <td width="87"><div align="center">
      <p><strong>Comprobante</strong></p>
      <p onClick="<?php if($ls['identificacion']==""){echo "mensaje()";}?>"><?php if($ls['identificacion']!=""){?><a href="<? echo $ls['identificacion']?>" target="_blank" ><? } ?> <img src="images/zoom.png" width="26" height="24" border='0' style="margin-left:-5px;" alt="Ver comprobante"></a></p>
    </div></td>
    <td width="36"><input name="checkbox2" type="checkbox" onClick="validar('<?echo$x;?>','<?echo$idexp;?>',1)" <?if($x==1){echo"checked='checked'";}?>></td>
    <td width="87"><div align="center">
      <p><strong>Comprobante</strong></p>
      <p onClick="<?php if($ls['contrato']==""){echo "mensaje()";  }?>" ><?php if($ls['contrato']!=""){ ?> <a href="<? echo $ls['contrato'];?>" target="_blank" ><? } ?><img  src="images/zoom.png" width="28" height="29" border='0' style="margin-left:-5px;" alt="Ver comprobante"></a></p>
    </div></td>
    <td width="49"><input name="checkbox" type="checkbox" onClick="validar('<?echo$y?>','<?echo$idexp?>',2)"<?if($y==1){echo"checked='checked'";}?>></td>
    <td width="84"><div align="center">
      <p><strong>Comprobante</strong></p>
      <p onClick="<?php if($ls['hojaregistro']==""){echo "mensaje()";  }?>" ><?php if($ls['hojaregistro']!=""){ ?><a href="<? echo $ls['hojaregistro'];?>" target="_blank"><? } ?><img src="images/zoom.png" width="28" height="29" border='0' style="margin-left:-5px;" alt="Ver comprobante"></a></p>
    </div></td>
    <td width="49"><input type="checkbox" onClick="validar('<?echo$z?>','<?echo$idexp?>',3)"<?if($z==1){echo"checked='checked'";}?>> </td>
  </tr>
</table>
<? }?>
</body>
</html>