示例#1
0
function writeData($pdf, $data, $Description, $Category, $Awarders, $indEvent)
{
    global $par_RepresentCountry, $par_PlayAnthem;
    $arrOrisPosition = array('', 'Gold Medal', 'Silver Medal', 'Bronze Medal', '4th Place', '5th');
    $pdf->AddPage();
    $pdf->setXY(OrisPDF::leftMargin, $pdf->lastY);
    writeGroupHeader($pdf, $Description, $Category, $indEvent);
    writeHiLight($pdf, "GO FANFARE");
    $pdf->SetFont($pdf->FontStd, '', 14);
    $pdf->MultiCell(0, 6, $Awarders, 0, 'L', 0);
    $pdf->SetFont($pdf->FontStd, '', 12);
    for ($i = count($data) - 1; $i >= 0; $i--) {
        if ($indEvent) {
            writeHiLight($pdf);
            $pdf->Cell(0, 6, $arrOrisPosition[$data[$i][0]], 0, 1, 'L', 0);
            if ($par_RepresentCountry) {
                $pdf->Cell(0, 6, "representing " . $data[$i][2], 0, 1, 'L', 0);
            }
            $pdf->SetFont($pdf->FontStd, 'B', 12);
            $pdf->Cell(0, 6, $data[$i][1], 0, 1, 'L', 0);
            $pdf->SetFont($pdf->FontStd, '', 12);
        } else {
            $pdf->SetFont($pdf->FontStd, 'B', 12);
            writeHiLight($pdf);
            $pdf->Cell(0, 6, $arrOrisPosition[$data[$i][0]], 0, 1, 'L', 0);
            if ($par_RepresentCountry) {
                $pdf->SetFont($pdf->FontStd, 'B', 12);
                $pdf->Cell(0, 6, $data[$i][1], 0, 1, 'L', 0);
                $pdf->SetFont($pdf->FontStd, '', 12);
                $pdf->Cell(0, 6, "represented by ", 0, 1, 'L', 0);
            }
            for ($j = 0; $j < count($data[$i][2]); $j++) {
                $pdf->SetFont($pdf->FontStd, '', 12);
                $pdf->Cell(0, 6, $data[$i][2][$j], 0, 1, 'L', 0);
            }
        }
    }
    if ($par_PlayAnthem) {
        writeHiLight($pdf, "NATIONAL ANTHEM");
        $pdf->Cell(0, 7, "Ladies and Gentlemen, the National Anthem of ", 0, 1, 'L', 0);
        $pdf->SetFont($pdf->FontStd, 'B', 12);
        $pdf->Cell(0, 7, $indEvent ? $data[0][2] : $data[0][1], 0, 1, 'L', 0);
    }
    $pdf->SetFont($pdf->FontStd, '', 12);
    writeHiLight($pdf, "ACKNOWLEDGE MEDALLISTS");
    $pdf->Cell(0, 7, "Ladies and Gentlemen, please give a warm round of applause to our Athletes", 0, 1, 'L', 0);
}
示例#2
0
            $DistSize = 48 / $rankData['meta']['numDist'];
        } elseif ($rankData['meta']['numDist'] >= 4 && $rankData['meta']['double']) {
            $DistSize = 48 / ($rankData['meta']['numDist'] / 2 + 1);
        } else {
            $AddSize = (48 - $rankData['meta']['numDist'] * 12) / 2;
        }
        //Verifico se l'header e qualche riga ci stanno nella stessa pagina altrimenti salto alla prosisma
        if (!$pdf->SamePage(28)) {
            $pdf->AddPage();
        }
        writeGroupHeader($pdf, $section['meta'], $DistSize, $AddSize, $rankData['meta']['numDist'], $rankData['meta']['double'], false);
        foreach ($section['items'] as $item) {
            writeDataRow($pdf, $item, $DistSize, $AddSize, $rankData['meta']['numDist'], $rankData['meta']['double']);
            if (!$pdf->SamePage(4 * ($rankData['meta']['double'] ? 2 : 1))) {
                $pdf->AddPage();
                writeGroupHeader($pdf, $section['meta'], $DistSize, $AddSize, $rankData['meta']['numDist'], $rankData['meta']['double'], true);
            }
        }
        $pdf->SetY($pdf->GetY() + 5);
    }
}
if (!isset($isCompleteResultBook)) {
    $pdf->Output();
}
function writeDataRow($pdf, $item)
{
    $pdf->SetFont($pdf->FontStd, 'B', 8);
    $pdf->Cell(20, 4, $item['rank'] == 1 ? get_text('MedalGold') : ($item['rank'] == 2 ? get_text('MedalSilver') : ($item['rank'] == 3 ? get_text('MedalBronze') : "")), 1, 0, 'L', 0);
    $pdf->SetFont($pdf->FontStd, '', 7);
    $pdf->Cell(50, 4, $item['athlete'], 1, 0, 'L', 0);
    $pdf->SetFont($pdf->FontStd, '', 7);