$pdf->AliasNbPages(); $pdf->SetLeftMargin(15); $pdf->PageNo(); //$pdf->SetTopMargin(0); $pdf->AddPage(); $pdf->SetFont('Arial', '', 7); $pdf->Cell(190, 10, 'REPORTE DE VENTA DE PRODUCTOS', 0, 0, 'C'); $pdf->Ln(10); $pdf->Cell(150, 5, 'VENTAS REGISTRADAS DESDE EL ' . $_REQUEST['fecha'] . ' AL ' . $_REQUEST['fecha2'] . '', 0, 0, 'L'); $pdf->Ln(5); $pdf->Cell(275, 5, '', 0, 0, 'C'); $pdf->Ln(5); $pdf->SetWidths(array(12, 15, 25, 80, 20, 16, 16)); //srand(microtime()*1000000); $pdf->Row(array('Nro', 'FECHA', 'TIPO PRODUCTO', 'DESCRIPCION', 'CANTIDAD', 'PRECIO', 'IMPORTE')); $rs = $venta->ventas_listar_fecha($_REQUEST['fecha'], $_REQUEST['fecha2']); if ($rs) { $j = 1; $suma_cantidad = 0; $suma_precio = 0; $suma_importe = 0; while ($campo = mysql_fetch_array($rs)) { //cargamos a las variables los campos de la bd $fecha = $venta->_util->obtiene_fecha($campo['ven_fecha']); $tipo = $campo['tipp_descripcion']; $descripcion = $campo['prod_descripcion']; $cantidad = $campo['ven_cantidad']; $precio = $campo['ven_precio']; $unidad = $campo['uni_descripcion']; $moneda = $campo['tipm_descripcion']; $importe = $cantidad * $precio;
<td width="85" align="left" class="enfasis">Hasta</td> <td width="14" align="center" class="enfasis">:</td> <td width="142" align="left"><input name="fecha2" type="text" id="fecha2" value="<?php echo $_REQUEST['fecha2']; ?> " size="10" onkeyup='fn(this.form,this)' class="date-pick"/></td> <td width="126" align="left"><input name="button2" type="button" class="btn" id="button2" value="Listar" onclick='enviar_form("POST","ventas_reporte.php","")' /></td> <td width="154" align="left"> </td> </tr> </table> <table width="100%" border="0"> <tr class="fondonegro"> <td colspan="3">Cliente</td> </tr> <?php $rs = $venta->ventas_listar_fecha($_REQUEST['fecha'], $_REQUEST['fecha2'], '', 'cli_id'); if ($rs) { $j = 1; $total = 0; while ($campo = mysql_fetch_array($rs)) { ?> <tr bgcolor="#FFFFFF"> <td colspan="3"><?php echo $campo['cli_razonsocial']; ?> </td> </tr> <tr bgcolor="#FFFFFF"> <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="6%"> </td>