

<script>

		function Cancelar_Factura(codfactura) {
			parent.location.href="../Factura/cancelar_proforma _caja.php?codfactura_contado=" + codfactura;
		}


		function eliminar_factura(codfactura) {
			
			 if (confirm(" Desea eliminar la Factura ? "))
					 
			parent.location.href="eliminar_factura.php?numfac=" + codfactura;
		}


				///////////////////////////////////////////////////////MASCARA NUMERICA //////////////////////////////////////////////
		

</script>
<link href="../estilos/estilos.css" type="text/css" rel="stylesheet">
<?php 
include ("../conexion.php");
$cdgcli=$_POST["cdgcli"];


?>

<form  method="POST"   id="formulario" name="Guardar" action="guardar_recibo.php" value='guardar'>
		<table class="fuente9" width="100%" cellspacing=0 cellpadding=0 border=0 ID="Table1">

		<?php				

if ($result = $mysqli->query("SELECT * FROM facturas_contado WHERE estado = 1 ORDER BY codfactura ASC " )) {
   $nrs = $result->num_rows;
   $result->close();
}

	
 if ($nrs>0) { 

 $contador=0;
$consulta = "SELECT * FROM facturas_contado WHERE estado = 1 ORDER BY codfactura ASC ";

if ($resultado = $mysqli->query($consulta)) 

 
    while ($fila = $resultado->fetch_assoc()) {
        $horfac = $fila["horfac"];
        $fecha = $fila["fecha"];
		$fecha= implode("-", array_reverse(explode("-", $fecha)));
		$cdgcli = $fila["cdgcli"];
		$dsccli = $fila["dsccli"];
		$totalfactura = $fila["totalfactura"];
		$codfactura = $fila["codfactura"];
			
				?>
        
        <tr class="<?php echo $fondolinea ?>" onMouseOver="CambiaColor(this,'#000000','#ffffff')" onMouseOut="CambiaColor2(this,'#000000')" >

								<td width="2%"><?php $contador+1;?></td>
							
                                </div></td>
								<td width="11%" align="center"><div align="left"><?php echo $cdgcli; ?> </div></td>
                                <td width="35%" align="center"><div align="left"><?php echo $dsccli; ?>
                                </div></td>
								<td width="15%" align="right"><div align="left"><?php echo $fecha?></div></td>	
								<td width="10%"><div align="left"><?php echo $horfac ;?></div></td>							
								<td width="8%"><div align="right"><?php echo number_format($totalfactura,2,".",",");?></div></td>
		
								<td width="3%">&nbsp;</td>
								<td width="3%"><div align="center"><a href="#"><img src="../img/recibos1.png" width="24" height="24" border="0" onClick="Cancelar_Factura(<?php echo $codfactura ?> )" title="Cancelar Factura"></a></div></td>
								<td width="12%"><div align="center"><a href="#"><img src="../img/Vista (248).png" width="24" height="24" border="0" onClick="eliminar_factura(<?php echo $codfactura ?> )" title="Anular Factura"></a></div></td>
						</tr>
						</tr>	
						<?php $contador++;
							}
							}
						?>			
					</table>
        
   
</form>

</div>


</div>

<iframe id="frame_datos" name="frame_datos" width="0%" height="0" frameborder="0">
	<ilayer width="0" height="0" id="frame_datos" name="frame_datos"></ilayer>
</iframe>