<?php
include('../../clases/clase.conexion.php');
include('../../clases/user/clase.numeroletras.php');
include('../../funciones/variables.php');
include('../../funciones/funciones.php');
$var = VarServer("MYSQLI");
$obj = new clsConexion($var[0],$var[1],$var[2],$var[3],$var[4]);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<table width="672" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="51" height="21" valign="top">CANTIDAD</td>
    <td width="54" valign="top">UNIDAD</td>
    <td width="419" valign="top">DESCRIPCION</td>
    <td width="73" valign="top">P.UNIT.</td>
    <td width="75" valign="top">V.VENTA</td>
  </tr>
	<?php
    $sql = "select D.id_producto AS CPRO, A.descripcion AS PRODUCTO, D.PRECIO, D.CANTIDAD, D.TOTAL
    from _sv_venta_detalle D
    inner join _sv_producto A ON D.id_producto = A.id_producto
    where D.id_venta=5";
    $obj->AbrirConexion();
    $rs = $obj->Query($sql);
    $obj->CerrarConexion();
    $j=0;
    $bgcolor1 = 'class="even_row" ';
    $bgcolor2 = 'class="odd_row" ';
    $varTotal = 0;
    while($fila = $obj->FetchArray($rs))	{
    	$varTotal = $varTotal + $fila["TOTAL"]; 
    ?>
  <tr>
    <td height="21" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td valign="top"><?php
        if(!is_null($fila["CANTIDAD"]) && $fila["CANTIDAD"]<>0)
            echo number_format($fila["CANTIDAD"],"0",".",",");
        ?></td>
    <td valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
<?php
}
?>
</table>
</body>
</html>
