$ShowStatusLegend = false; $FirstTime = true; $DivSize = ($pdf->getPageWidth() - 35) / count($DivArray); $SesSize = $DivSize / (count($SesArray) + 1); while ($MyRow = safe_fetch($Rs)) { if ($FirstTime || !$pdf->SamePage(16)) { $TmpSegue = !$pdf->SamePage(16); $pdf->SetFont($pdf->FontStd, 'B', 10); $pdf->SetXY(25, $pdf->GetY() + 5); $pdf->Cell($pdf->getPageWidth() - 35, 6, get_text('StatClasses', 'Tournament'), 1, 1, 'C', 1); if ($TmpSegue) { $pdf->SetXY($pdf->getPageWidth() - 40, $pdf->GetY() - 6); $pdf->SetFont($pdf->FontStd, 'I', 6); $pdf->Cell(30, 6, get_text('Continue'), 0, 1, 'R', 0); } $pdf->SetX(25); $pdf->SetFont($pdf->FontStd, 'B', 10); foreach ($DivArray as $Value) { $pdf->Cell($DivSize, 6, $Value, 1, 0, 'C', 1); } $pdf->Cell(0.1, 6, '', 0, 1, 'C', 0); $pdf->SetX(25); $pdf->SetFont($pdf->FontStd, 'B', 8); for ($i = 0; $i < count($DivArray); $i++) { foreach ($SesArray as $Value) { $TotArray[] = 0; $pdf->Cell($SesSize, 4, $Value == 0 ? '--' : $Value, 1, 0, 'C', 1); } $pdf->Cell($SesSize, 4, get_text('TotalShort', 'Tournament'), 1, 0, 'C', 1); } $pdf->Cell(0.1, 4, '', 0, 1, 'C', 0);
$pdf->Cell(10, 5 * $hLine + ($MyRow->FrqTip || $AllQuestions ? 4 : 0), $MyRow->FrqId . ".", 'LTB', 0, 'L', 0); $pdf->Cell(60, 5 * $hLine, $MyRow->FrqQuestion, 'T' . ($MyRow->FrqTip || $AllQuestions ? '' : 'B'), 0, 'L', 0); switch ($MyRow->FrqType) { case 0: $pdf->Cell(120, 5 * $hLine, get_text('jrTextBox', 'Common', $MyRow->FrqOptions > 0 ? $MyRow->FrqOptions : 255), 'RT' . ($MyRow->FrqTip || $AllQuestions ? '' : 'B'), 1, 'L', 0); break; case 1: $pdf->Cell(120, 5 * $hLine, get_text('jrTextArea', 'Common', explode('|', $MyRow->FrqOptions)), 'RT' . ($MyRow->FrqTip || $AllQuestions ? '' : 'B'), 1, 'L', 0); break; case 2: $pdf->Cell(120, 5 * $hLine, get_text('jrYesNo', 'Common'), 'RT' . ($MyRow->FrqTip || $AllQuestions ? '' : 'B'), 1, 'L', 0); break; case 3: if ($hLine != 1) { $pdf->MultiCell(120, 5, get_text('jrSingleChoice', 'Common', str_replace("|", " / ", $MyRow->FrqOptions)), 0, 'L', 0, 0, '', '', true, 1, false, true, 5 * $hLine); $pdf->SetX($pdf->GetX() - 120); $pdf->Cell(120, 5 * $hLine, '', 'RT' . ($MyRow->FrqTip || $AllQuestions ? '' : 'B'), 1, 'L', 0); } else { $pdf->Cell(120, 5 * $hLine, get_text('jrSingleChoice', 'Common', str_replace("|", " / ", $MyRow->FrqOptions)), 'RT' . ($MyRow->FrqTip || $AllQuestions ? '' : 'B'), 1, 'L', 0); } break; case 4: if ($hLine != 1) { $pdf->MultiCell(120, 5, get_text('jrMultiChoice', 'Common', str_replace("|", " / ", $MyRow->FrqOptions)), 0, 'L', 0, 0, '', '', true, 1, false, true, 5 * $hLine); $pdf->SetX($pdf->GetX() - 120); $pdf->Cell(120, 5 * $hLine, '', 'RT' . ($MyRow->FrqTip || $AllQuestions ? '' : 'B'), 1, 'L', 0); } else { $pdf->Cell(120, 5 * $hLine, get_text('jrMultiChoice', 'Common', str_replace("|", " / ", $MyRow->FrqOptions)), 'RT' . ($MyRow->FrqTip || $AllQuestions ? '' : 'B'), 1, 'L', 0); } break; }
if ($CurTeam != $MyRow->NationCode) { // Sicuramente devo incrementare la posizione $MyPos++; // Se non ho parimerito il ranking � uguale alla posizione if (!($MyRow->TeScore == $MyScoreOld && $MyRow->TeGold == $MyGoldOld && $MyRow->TeXnine == $MyXNineOld)) { $MyRank = $MyPos; } if ($MyRank <= 3) { $pdf->SetFont($pdf->FontStd, 'B', 8); $pdf->Cell(20, 4 * $MyRow->Quanti, $MyRank == 1 ? get_text('MedalGold') : ($MyRank == 2 ? get_text('MedalSilver') : ($MyRank == 3 ? get_text('MedalBronze') : "")), 1, 0, 'L', 0); $pdf->SetFont($pdf->FontStd, '', 7); $pdf->Cell(10, 4 * $MyRow->Quanti, $MyRow->NationCode, 'LTB', 0, 'C', 0); $pdf->Cell(75, 4 * $MyRow->Quanti, $MyRow->Nation, 'RTB', 0, 'L', 0); } } else { $pdf->SetX($pdf->GetX() + 105); } if ($MyRank <= 3) { $pdf->SetFont($pdf->FontStd, '', 7); $pdf->Cell(50, 4, $MyRow->FirstName . ' ' . $MyRow->Name, 'TRB', 0, 'L', 0); $pdf->SetFont($pdf->FontFix, '', 6); $pdf->Cell(8, 4, number_format($MyRow->QuScore, 0, '', get_text('NumberThousandsSeparator')), 1, 0, 'R', 0); if ($CurTeam != $MyRow->NationCode) { $CurTeam = $MyRow->NationCode; $pdf->SetFont($pdf->FontFix, 'B', 8); $pdf->Cell(11, 4 * $MyRow->Quanti, number_format($MyRow->TeScore, 0, '', get_text('NumberThousandsSeparator')), 'TB', 0, 'R', 0); $pdf->SetFont($pdf->FontFix, '', 7); $pdf->Cell(8, 4 * $MyRow->Quanti, $MyRow->TeGold, 'TB', 0, 'R', 0); $pdf->Cell(8, 4 * $MyRow->Quanti, $MyRow->TeXnine, 'TBR', 0, 'R', 0); } $pdf->Cell(0.5, 4, '', 0, 1, 'C', 0);