$pdf->NoDrawing(); } if (isset($_REQUEST["ScoreDraw"]) && $_REQUEST["ScoreDraw"] == "CompleteTotals") { $pdf->PrintTotalColumns(); } $Ath4Target = 4; $session = intval($_REQUEST['x_Session']); } if ($session > 0) { $ses = GetSessions(null, false, array($session . '_Q')); $Ath4Target = $ses[0]->SesAth4Target; } $defScoreX = $pdf->getSideMargin(); $defScoreX2 = ($pdf->GetPageWidth() + $pdf->getSideMargin()) / 2; $defScoreY = $pdf->getSideMargin(); $defScoreY2 = ($pdf->GetPageHeight() + $pdf->getSideMargin()) / 2; $defScoreW = ($pdf->GetPageWidth() - $pdf->getSideMargin() * 3) / 2; $defScoreH = ($pdf->GetPageHeight() - $pdf->getSideMargin() * 3) / 2; if ($Ath4Target == 2) { $defScoreX = $pdf->getSideMargin() * 3; $defScoreH = $pdf->GetPageWidth() - $pdf->getSideMargin() * 2; $defScoreW = ($pdf->GetPageHeight() - $defScoreX * 3) / 2; } elseif ($Ath4Target == 3) { $defScoreH = $pdf->GetPageWidth() - $pdf->getSideMargin() * 2; $defScoreW = ($pdf->GetPageHeight() - $pdf->getSideMargin() * 4) / 3; } if (!empty($_REQUEST['QRCode'])) { $QRCodeX = 0; $QRCodeY = 0; switch ($Ath4Target) { case 2:
<?php require_once dirname(dirname(__FILE__)) . '/config.php'; require_once 'Common/pdf/ScorePDF.inc.php'; require_once 'Common/Fun_FormatText.inc.php'; $pdf = new ScorePDF(true); $NumEnd = 12; $NumDistances = 1; $defScoreX = $pdf->getSideMargin(); $defScoreX2 = ($pdf->GetPageWidth() + $pdf->getSideMargin()) / 2; $defScoreY = $pdf->getSideMargin(); $defScoreY2 = ($pdf->GetPageHeight() + $pdf->getSideMargin()) / 2; $defScoreW = ($pdf->GetPageWidth() - $pdf->getSideMargin() * 3) / 2; $defScoreH = ($pdf->GetPageHeight() - $pdf->getSideMargin() * 3) / 2; $MisArray = array(1 => array($defScoreX, $defScoreY), 2 => array($defScoreX2, $defScoreY), 3 => array($defScoreX, $defScoreY2), 4 => array($defScoreX2, $defScoreY2), 5 => array($defScoreX, $defScoreY), 6 => array($defScoreX2, $defScoreY), 7 => array($defScoreX, $defScoreY2), 8 => array($defScoreX2, $defScoreY2)); //$MyQuery = "SELECT TtNumEnds,TtNumDist FROM Tournament INNER JOIN Tournament*Type AS tt ON ToType=TtId WHERE ToId=" . StrSafe_DB($_SESSION['TourId']); $MyQuery = "SELECT ToNumEnds AS TtNumEnds,ToNumDist AS TtNumDist FROM Tournament WHERE ToId=" . StrSafe_DB($_SESSION['TourId']); $Rs = safe_r_sql($MyQuery); if (safe_num_rows($Rs) == 1) { $r = safe_fetch($Rs); $NumEnd = $r->TtNumEnds; $NumDistances = $r->TtNumDist; } $FillWithArrows = false; if (isset($_REQUEST["ScoreFilled"]) && $_REQUEST["ScoreFilled"] == 1) { $FillWithArrows = true; } $pdf->FillWithArrows = $FillWithArrows; if (!(isset($_REQUEST["ScoreHeader"]) && $_REQUEST["ScoreHeader"] == 1)) { $pdf->HideHeader(); }
$YScorePos = array(); if ($Portrait) { // portrait mode! $NumW = 3; $NumH = ceil($NumEnd * 3 / (IANSEO_ARROWS * $NumW)); if ($NumW > $NumH) { $NumW = $NumH; $NumH = 3; } } else { // Landscape mode! $NumH = 3; $NumW = ceil($NumEnd * 3 / (IANSEO_ARROWS * $NumH)); } $ScoreW = ($pdf->GetPageWidth() - $Margin * ($NumW + 1)) / $NumW; $ScoreH = ($pdf->GetPageHeight() - $Margin * ($NumH + 1)) / $NumH; if ($Portrait) { foreach (range($NumH - 1, 0) as $r) { foreach (range($NumW - 1, 0) as $c) { $XScorePos[] = $Margin + ($ScoreW + $Margin) * $c; $YScorePos[] = $Margin + ($ScoreH + $Margin) * $r; } } } else { foreach (range($NumW - 1, 0) as $c) { foreach (range(0, $NumH - 1) as $r) { $XScorePos[] = $Margin + ($ScoreW + $Margin) * $c; $YScorePos[] = $Margin + ($ScoreH + $Margin) * $r; } } }