$j=$i;
					$l=0;
					$nl++;
				}
				else
					$i++;
			}
			return $nl;
		}
	}
	
	$pdf = new pdf('L','mm','A4');
	$pdf->AliasNbPages();
	$titulos = array('SUC','GUIA','FECHA','REMITENTE','DESTINATARIO','VALOR DECLARADO','SEGURO');
	$medidas = array(15,25,20,80,80,27,27);
	$pdf->Header($_GET[fechainicio],$_GET[fechafin]);
	$pdf->AddPage();
	$pdf->SetFont('Arial','B',7);
	//Table with 20 rows and 4 columns
	
	$pdf->SetWidths($medidas);
	
	$pdf->Titulos($titulos,$medidas);
	
	$pdf->SetFont('Arial','',7);
	for($i=0;$i<count($data);$i++){
		$pdf->Row($data[$i]);
	}
	
	$pdf->addLeyenda2("TOTAL:",180,210);
	$pdf->addLeyenda2("$".number_format($tvalor,2,'.',','),180,235);