Exemple #1
0
        $pdf->SetFont($pdf->FontStd, '', 10);
        $pdf->Cell($pdf->GetPageWidth() * 0.1, 6, get_text('DivisionClass') . ': ', 'LB', 0, 'L', 0);
        $pdf->SetFont($pdf->FontStd, 'B', 10);
        $pdf->Cell($pdf->GetPageWidth() * 0.8 - 20, 6, get_text($MyRow->EvEventName, '', '', true), 'B', 1, 'L', 0);
        $pdf->SetXY($pdf->GetPageWidth() * 0.9 - 10, $pdf->GetY() - 18);
        $pdf->SetFont($pdf->FontStd, 'B', 10);
        $pdf->Cell($pdf->GetPageWidth() * 0.1, 6, get_text('Rank'), 'TLR', 1, 'C', 1);
        $pdf->SetXY($pdf->GetPageWidth() * 0.9 - 10, $pdf->GetY());
        $pdf->SetFont($pdf->FontStd, 'B', 25);
        $pdf->Cell($pdf->GetPageWidth() * 0.1, 12, $MyRow->GrPosition, 'BLR', 1, 'C', 1);
        $WhichScoreEnd = 7;
        if ($MyRow->EvFinalFirstPhase == 64 || $MyRow->EvFinalFirstPhase == 48) {
            $WhichScoreEnd = 6;
        }
        for ($WhichScore = $Start2FirstPhase[$MyRow->EvFinalFirstPhase]; $WhichScore < $WhichScoreEnd; $WhichScore++) {
            DrawScore($pdf, $MyRow, $WhichScore, $WhereX[$WhichScore - $Start2FirstPhase[$MyRow->EvFinalFirstPhase]], $WhereY[$WhichScore - $Start2FirstPhase[$MyRow->EvFinalFirstPhase]], $WhichScore == $WhichScoreEnd - 1);
        }
    }
    safe_free_result($Rs);
}
$pdf->Output();
function DrawScore(&$pdf, $MyRow, $WhichScore, $WhereX, $WhereY, $FinalScore = false)
{
    global $defTotalW, $defGoldW, $defArrowTotW, $ScoreHeight, $NumFasi, $Fasi, $TgtNoFasi, $Score3D, $Start2FirstPhase;
    $scoreStartX = $WhereX;
    $scoreStartY = $WhereY;
    $TotalW = $defTotalW;
    $GoldW = $defGoldW;
    $NumCol = 3;
    $NumRow = 5;
    $CellH = 6;
 $WhereX = NULL;
 $WhereY = NULL;
 $AtlheteName = NULL;
 $FollowingRows = false;
 //DrawScore
 while ($MyRow = safe_fetch($Rs)) {
     $MyRowOpp = safe_fetch($Rs);
     if (empty($_REQUEST["Blank"]) && empty($_REQUEST["IncEmpty"]) && ($MyRow->FinAthlete == 0 || $MyRowOpp->FinAthlete == 0)) {
         // se è vuoto uno dei due arcieri e non è selezionata l'inclusione
         // salta al prossimo record
         continue;
     }
     // disegna lo score di sinistra
     DrawScore($pdf, $MyRow, $MyRowOpp);
     // Disegna lo score di destra
     DrawScore($pdf, $MyRowOpp, $MyRow);
     // print barcode if any
     if (!empty($_REQUEST['Barcode'])) {
         $pdf->setxy($pdf->BarcodeHeaderX, 5);
         $pdf->SetFont('barcode', '', 25);
         $pdf->Cell($pdf->BarcodeHeader, 15, '*' . mb_convert_encoding($MyRow->GrMatchNo . '-0-' . $MyRow->EvCode, "UTF-8", "cp1252") . "*", 0, 1, 'C', 0);
         $pdf->SetFont($pdf->FontStd, '', 10);
         $pdf->setxy($pdf->BarcodeHeaderX, 16);
         $pdf->Cell($pdf->BarcodeHeader, 4, mb_convert_encoding($MyRow->GrMatchNo . '-0-' . $MyRow->EvCode, "UTF-8", "cp1252"), 0, 1, 'C', 0);
     } else {
         $pdf->setBarcodeHeader(10);
     }
     if (!empty($_REQUEST['QRCode'])) {
         foreach ($_REQUEST['QRCode'] as $k => $Api) {
             require_once 'Api/' . $Api . '/DrawQRCode.php';
             $Function = 'DrawQRCode_' . preg_replace('/[^a-z0-9]/sim', '_', $Api);