$OldTeam = '#@#@#'; $isFirstTime = true; $TotalPrice = 0; while ($MyRow = safe_fetch($Rs)) { if ($OldTeam != $MyRow->NationCode) { if (!$isFirstTime) { $pdf->SetFont($pdf->FontStd, '', 8); $pdf->Cell(165, 15, get_text('Cash', 'Tournament') . ":", 0, 0, 'R', 0); $pdf->SetFont($pdf->FontStd, 'B', 12); $pdf->Cell(25, 15, NumFormat($TotalPrice, 2) . " " . $pdf->writeCurrency(), 0, 1, 'R', 0); $pdf->AddPage(); } $isFirstTime = false; $pdf->SetXY(10, $pdf->GetY() + 5); $pdf->SetFont($pdf->FontStd, '', 8); $pdf->Cell($pdf->GetStringWidth(get_text('Country')) + 5, 10, get_text('Country'), 0, 0, 'L', 0); $pdf->SetFont($pdf->FontStd, 'B', 12); $pdf->Cell(15, 10, $MyRow->NationCode, 0, 0, 'C', 0); $pdf->Cell(50, 10, $MyRow->Nation, 0, 1, 'L', 0); $pdf->SetFont($pdf->FontStd, '', 8); $pdf->Cell(19, 10, get_text('Partecipants'), 0, 1, 'L', 0); $pdf->SetFont($pdf->FontStd, 'B', 7); $pdf->Cell(10, 4, '', 0, 0, 'C', 0); $pdf->Cell(10, 4, get_text('SessionShort', 'Tournament'), 1, 0, 'C', 1); $pdf->Cell(15, 4, get_text('Target'), 1, 0, 'C', 1); $pdf->Cell(10, 4, get_text('Code', 'Tournament'), 1, 0, 'C', 1); $pdf->Cell(45, 4, get_text('Athlete'), 1, 0, 'L', 1); $pdf->Cell(15, 4, get_text('AgeCl'), 1, 0, 'C', 1); $pdf->Cell(10, 4, get_text('SubCl', 'Tournament'), 1, 0, 'C', 1); $pdf->Cell(15, 4, get_text('Division'), 1, 0, 'C', 1); $pdf->Cell(15, 4, get_text('Cl'), 1, 0, 'C', 1);