} $pdf->SetDrawColor(0x0, 0x0, 0x0); // riquadro colore $pdf->Rect($myPosX, $myPosY, 93, 93, 'F'); // $pdf->Rect($myPosX, $myPosY, 93, 20, 'F'); // $pdf->Rect($myPosX, $myPosY+20, 93, 10, 'F'); // $pdf->Rect($myPosX, $myPosY+65, 93, 10, 'F'); // $pdf->Rect($myPosX, $myPosY+85, 93, 10, 'F'); // bordo $pdf->Rect($myPosX, $myPosY, 93, 136, 'D'); //Header $pdf->SetXY($myPosX, $myPosY + 7.5); $pdf->Cell(93, 6, $rowInfo->ToName, 0, 1, 'C', 0); $pdf->SetFont($pdf->FontStd, 'I', 8); $pdf->SetX($myPosX); $pdf->Cell(93, 6, $rowInfo->ToWhere . ', ' . TournamentDate2String($rowInfo->DtFrom, $rowInfo->DtTo), 0, 1, 'C', 2); $pdf->SetDrawColor(0x99, 0x0, 0x0); if (!is_null($MyRow->PhPhoto)) { $im = imagecreatefromstring(base64_decode($MyRow->PhPhoto)); $height = imagesy($im) * 20 / imagesx($im); imagedestroy($im); $pdf->Image('@' . base64_decode($MyRow->PhPhoto), $myPosX + 36.5, $pdf->GetY() + 5, 20, 0); $pdf->Rect($myPosX + 36.5, $pdf->GetY() + 5, 20, $height, 'D'); } //Matricola if (is_null($MyRow->PhPhoto) && $MyRow->AcIsAthlete == 1) { $pdf->SetXY($myPosX + 5, $myPosY + 30); } else { $pdf->SetXY($myPosX + 5, $myPosY + 43); } //+$height);
$tmpX = $pdf->getImageRBX() + 2; } if ($MyRow->AcTitleReverse) { $pdf->SetTextColor(255); } $pdf->SetFont('', 'B', 16); //Cognome e Nome $pdf->SetXY($tmpX, $PosY + $AccH * 0.08); $pdf->Cell($AccW + 2 - $tmpX - $PosX, $AccH * 0.07000000000000001, $MyRow->FirstName, 0, 0, 'C', 0); $pdf->SetXY($tmpX, $PosY + $AccH * 0.15); $pdf->Cell($AccW + 2 - $tmpX - $PosX, $AccH * 0.07000000000000001, $MyRow->Name, 0, 0, 'C', 0); $pdf->SetDefaultColor(); $pdf->SetXY($PosX, $PosY + $AccH * 0.25); //Luogo $pdf->SetFont('', '', 7); $pdf->Cell($AccW, $AccH * 0.02, $pdf->Where . ", " . TournamentDate2String($pdf->WhenF, $pdf->WhenT), 0, 0, 'C', 0); //SPAZIO BIANCO DI RISPETTO: Altezza 2/20 (totale 8/20, ne restano 12/20) //SECONDA Area dell'accredito: Logo DX e Nome/Country/Categoria/Photo - Altezza 7/20 (totale 15/20, ne restano 5/20) $tmpX = $PosX + 2; if (!is_null($ImgDxSize)) { //Immagine Organizzatore (DX) if ($ImgDxSize[1] >= $ImgDxSize[0]) { //Immagine + alta che larga, comanda l'altezza $pdf->Image($pdf->ToPaths['ToRight'], $tmpX, $PosY + $AccH * 0.3 + 2, 0, $AccH * 0.25 - 4); } else { $pdf->Image($pdf->ToPaths['ToRight'], $tmpX, $PosY + $AccH * 0.3 + 2, $AccW * 0.25 - 4, 0); } $tmpX = $pdf->getImageRBX() + 2; } $tmpImgW = 0; $im = $CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION["TourCodeSafe"] . '-En-' . $MyRow->EnId . '.jpg';
$pdf->Cell(70, 7, get_text($RowTournament->TtName, 'Tournament'), 'TR', 1, 'L', 0); //Denominazione $pdf->SetFont($pdf->FontStd, '', 10); $pdf->Cell(40, 7, get_text('TourName', 'Tournament') . ": ", 'L', 0, 'L', 0); $pdf->SetFont($pdf->FontStd, 'B', 10); $pdf->Cell(150, 7, $RowTournament->ToName, 'R', 1, 'L', 0); //Organizzazione $pdf->SetFont($pdf->FontStd, '', 10); $pdf->Cell(40, 7, get_text('TourCommitee', 'Tournament') . ": ", 'L', 0, 'L', 0); $pdf->SetFont($pdf->FontStd, 'B', 10); $pdf->Cell(150, 7, $RowTournament->ToCommitee . " - " . $RowTournament->ToComDescr, 'R', 1, 'L', 0); //Luogo e data di Svolgimento $pdf->SetFont($pdf->FontStd, '', 10); $pdf->Cell(40, 7, get_text('TourWhen', 'Tournament') . ": ", 'L', 0, 'L', 0); $pdf->SetFont($pdf->FontStd, 'B', 10); $pdf->Cell(50, 7, TournamentDate2String($RowTournament->DtFrom, $RowTournament->DtTo), 0, 0, 'L', 0); $pdf->SetFont($pdf->FontStd, '', 10); $pdf->Cell(30, 7, get_text('TourWhere', 'Tournament') . ": ", 0, 0, 'R', 0); $pdf->SetFont($pdf->FontStd, 'B', 10); $pdf->Cell(70, 7, $RowTournament->ToWhere, 'R', 1, 'L', 0); $pdf->SetFont($pdf->FontStd, 'B', 1); $pdf->Cell(190, 0.5, '', 1, 1, 'L', 1); $pdf->SetXY($pdf->GetX(), $pdf->GetY() + 5); //Parte di Report vera e propria /*$MySql = "SELECT FrqId, FrqStatus, FrqQuestion, FrqTip, FrqType, FrqOptions, TtCategory " . "FROM FinalReportQ " . "INNER JOIN Tournament ON ToId=" . StrSafe_DB($_SESSION['TourId']) . " " . "INNER JOIN Tournament*Type ON TtId=ToType "; if($AllQuestions) $MySql .= "WHERE FrqStatus > 0 "; else
function __construct($DocTitolo, $Portrait = true, $Headers = '', $StaffVisibility = true) { global $CFG; $this->ShowStaff = $StaffVisibility; if ($Headers and is_file($Headers)) { $tmp = unserialize(file_get_contents($Headers)); foreach ($tmp as $k => $v) { $this->{$k} = $v; } if (!defined('ProgramVersion')) { define('ProgramVersion', $tmp->ProgramVersion); } if (!defined('ProgramBuild')) { define('ProgramBuild', $tmp->ProgramBuild); } if (!defined('ProgramRelease')) { define('ProgramRelease', $tmp->ProgramRelease); } if (file_exists($this->TourPath . '/topleft.png')) { $this->ToPaths['ToLeft'] = $this->TourPath . '/topleft.png'; } if (file_exists($this->TourPath . '/topright.png')) { $this->ToPaths['ToRight'] = $this->TourPath . '/topright.png'; } if (file_exists($this->TourPath . '/bottom.png')) { $this->ToPaths['ToBottom'] = $this->TourPath . '/bottom.png'; } } elseif (CheckTourSession()) { $Sql = "SELECT ToCode, ToName, ToComDescr, ToWhere, " . "date_format(ToWhenFrom, '" . get_text('DateFmtDB') . "') as ToWhenFrom, date_format(ToWhenTo, '" . get_text('DateFmtDB') . "') as ToWhenTo," . "ToWhenFrom AS DtFrom,ToWhenTo AS DtTo," . "(ToImgL) as ImgL, (ToImgR) as ImgR, (ToImgB) as ImgB, ToGolds AS TtGolds, ToXNine AS TtXNine,ToGoldsChars,ToXNineChars, " . "ToPrintPaper, ToPrintChars, ToCurrency, ToPrintLang " . "FROM Tournament WHERE ToId = " . StrSafe_DB($_SESSION['TourId']); $Rs = safe_r_sql($Sql); //print $Sql;exit; if (safe_num_rows($Rs) == 1) { $r = safe_fetch($Rs); $this->Code = $r->ToCode; $this->Name = $r->ToName; $this->Oc = $r->ToComDescr; $this->Where = $r->ToWhere; $this->WhenF = $r->ToWhenFrom; $this->WhenT = $r->ToWhenTo; $this->imgL = $r->ImgL; $this->imgR = $r->ImgR; $this->imgB = $r->ImgB; $this->prnGolds = $r->TtGolds; $this->prnXNine = $r->TtXNine; $this->goldsChars = $r->ToGoldsChars; $this->xNineChars = $r->ToXNineChars; $this->docUpdate = date('Ymd.His'); // patch $this->DtFrom = $r->DtFrom; $this->DtTo = $r->DtTo; $this->TournamentDate2String = TournamentDate2String($this->WhenF, $this->WhenT); // texts $this->Continue = get_text('Continue'); $this->LegendSO = get_text('LegendSO', 'Tournament'); $this->CoinTossShort = get_text('CoinTossShort', 'Tournament'); $this->CoinToss = get_text('CoinToss', 'Tournament'); $this->ShotOffShort = get_text('ShotOffShort', 'Tournament'); $this->ShotOff = get_text('ShotOff', 'Tournament'); $this->LegendStatus = get_text('LegendStatus', 'Tournament'); $this->Partecipation = get_text('Partecipation'); $this->IndQual = get_text('IndQual', 'Tournament'); $this->IndFin = get_text('IndFin', 'Tournament'); $this->TeamQual = get_text('TeamQual', 'Tournament'); $this->TeamFin = get_text('TeamFin', 'Tournament'); $this->MixedTeamFinEvent = get_text('MixedTeamFinEvent', 'Tournament'); $this->Yes = get_text('Yes'); $this->No = get_text('No'); // --- if ($r->ToPrintPaper) { $this->PageSize = 'LETTER'; } switch ($r->ToPrintChars) { case 0: // helvetica & standard european fonts $this->FontStd = 'helvetica'; break; case 1: $this->FontStd = 'dejavusans'; $this->FontFix = 'freemono'; break; case 2: // This font is more chinese friendly -- by uian2000@gmail.com $this->FontStd = 'droidsansfallback'; $this->FontFix = 'droidsansfallback'; break; } if (is_null($r->ToCurrency)) { $this->Currency = '€'; } else { $this->Currency = $r->ToCurrency; } // defines a constant that overrides printing if not empty @define('PRINTLANG', $r->ToPrintLang); safe_free_result($Rs); if (file_exists($CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-ToLeft.jpg')) { $this->ToPaths['ToLeft'] = $CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-ToLeft.jpg'; } if (file_exists($CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-ToRight.jpg')) { $this->ToPaths['ToRight'] = $CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-ToRight.jpg'; } if (file_exists($CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-ToBottom.jpg')) { $this->ToPaths['ToBottom'] = $CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-ToBottom.jpg'; } } $Ses = StrSafe_DB($_SESSION['TourId']); $Select = "\r\n\t\t\t\tSELECT ti.*, it.*,IF(ItJudge!=0,'CatJudge',IF(ItDoS!=0,'CatDos',IF(ItJury!=0,'CatJury','CatOC'))) AS `Category`\r\n\t\t\t\tFROM TournamentInvolved AS ti LEFT JOIN InvolvedType AS it ON ti.TiType=it.ItId\r\n\t\t\t\tWHERE ti.TiTournament={$Ses} AND it.ItId IS NOT NULL\r\n\t\t\t\tORDER BY IF(ItJudge!=0,1,IF(ItDoS!=0,2,IF(ItJury!=0,3,4))) ASC, IF(ItJudge!=0,ItJudge,IF(ItDoS!=0,ItDoS,IF(ItJury!=0,ItJury,ItOC))) ASC,ti.TiName ASC\r\n\t\t\t"; $Rs = safe_r_sql($Select); $CurCategory = ''; if (safe_num_rows($Rs) > 0) { while ($MyRow = safe_fetch($Rs)) { if ($CurCategory != $MyRow->Category) { $this->StaffCategories[get_text($MyRow->Category, 'Tournament')] = array(); $CurCategory = $MyRow->Category; $tmp = array(); } $this->StaffCategories[get_text($MyRow->Category, 'Tournament')][] = $MyRow->TiName; } foreach ($this->StaffCategories as $cat => $members) { $this->StaffCategories[$cat] = implode(', ', $members); } } } parent::__construct($Portrait ? 'P' : 'L', 'mm', $this->PageSize); $this->setJPEGQuality(100); $this->AliasNbPages(); $this->SetSubject($DocTitolo); $this->Titolo = $DocTitolo; $this->SetDefaultColor(); $this->SetMargins(IanseoPdf::sideMargin, IanseoPdf::topMargin + 3.0 * count($this->StaffCategories), IanseoPdf::sideMargin); $this->SetAutoPageBreak(true, ($this->ToPaths['ToBottom'] ? IanseoPdf::footerImageH : 0) + IanseoPdf::bottomMargin); $this->SetAuthor('http://www.ianseo.net'); $this->SetCreator('Software Design by Ianseo'); $this->SetTitle('IANSEO - Integrated Result System - Version ' . ProgramVersion . (defined('ProgramBuild') ? ' (' . ProgramBuild . ')' : '') . ' - Release ' . ProgramRelease); $this->SetFont($this->FontStd, '', 8); $this->SetLineWidth(0.1); $this->pushMargins(); }
function DrawScore3D($TopX, $TopY, $Width, $Height, $NumEnd, $Data = array(), $OnlyLeftScore = false, $Target = '') { global $CFG; if (!$Target) { $Target = array(11, 10, 8, 5); } //PARAMETRI CALCOLATI $TopOffset = 30; $BottomImage = 0; $TargetNo = !empty($Data["startTarget"]) ? intval($Data["startTarget"]) : 1; if ($TargetNo > 2 * $NumEnd) { $TargetNo = ($TargetNo - 1) % (2 * $NumEnd) + 1; } //HEADER LOGO SX & Dx $TmpLeft = 0; $TmpRight = 0; if ($this->PrintLogo && $this->PrintDrawing) { if (file_exists($IM = $CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-ToLeft.jpg')) { $im = getimagesize($IM); $this->Image($IM, $TopX, $TopY, 0, $TopOffset / 2); $TmpLeft = 1 + $im[0] * ($TopOffset / 2) / $im[1]; } if (file_exists($IM = $CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-ToRight.jpg')) { $im = getimagesize($IM); $TmpRight = $im[0] * 15 / $im[1]; $this->Image($IM, $TopX + $Width - $TmpRight, $TopY, 0, 15); $TmpRight++; } //IMMAGINE DEGLI SPONSOR if (empty($_REQUEST['QRCode']) and file_exists($IM = $CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-ToBottom.jpg')) { $BottomImage = 7.5; $im = getimagesize($IM); $imgW = $Width; $imgH = $imgW * $im[1] / $im[0]; if ($imgH > $BottomImage) { $imgH = $BottomImage; $imgW = $imgH * $im[0] / $im[1]; } $this->Image($IM, $TopX + ($Width - $imgW) / 2, $TopY + $Height - $imgH, $imgW, $imgH); } } $CellW = ($Width - 5) / 2 / (count($Target) + 4); $CellH = ($Height - 41 - $BottomImage) / ($NumEnd + 2); // CODICE A BARRE $BCode = 0; if ($this->PrintBarcode and !empty($Data['EnCode'])) { $BCode = 60; $this->SetXY(10 + $Width - $TmpRight - $BCode, $TopY); $this->SetFont('barcode', '', 28); $this->Cell($BCode - 5, $CellH, mb_convert_encoding('*' . $Data['EnCode'] . '-' . $Data['Div'] . '-' . $Data['Cls'], "UTF-8", "cp1252") . "*", 0, 0, 'C', 0); } //TESTATA GARA if ($this->PrintHeader) { $this->SetColors(false); $this->SetFont($this->FontStd, 'B', 9); $this->SetXY($TopX + $TmpLeft, $TopY); $this->MultiCell($Width - $TmpLeft - $TmpRight - $BCode, 4, $this->Name, 0, 'L', 0); $this->SetFont($this->FontStd, '', 7); $this->SetXY($TopX + $TmpLeft, $this->GetY()); if ($this->GetStringWidth($this->Where . ", " . TournamentDate2String($this->WhenF, $this->WhenT)) >= $Width - $TmpLeft - $TmpRight) { $this->MultiCell($Width - $TmpLeft - $TmpRight - $BCode, 4, $this->Where, 0, 'L', 0); $this->SetXY($TopX + $TmpLeft, $this->GetY()); $this->MultiCell($Width - $TmpLeft - $TmpRight - $BCode, 4, TournamentDate2String($this->WhenF, $this->WhenT), 0, 'L', 0); } else { $this->MultiCell($Width - $TmpLeft - $TmpRight - $BCode, 4, $this->Where . ", " . TournamentDate2String($this->WhenF, $this->WhenT), 0, 'L', 0); } } //DATI ATLETA $this->SetXY($TopX + 0.2 * $CellW, $TopY + $TopOffset * 7 / 12); $this->SetFont($this->FontStd, '', 8); $this->SetColors(false); $this->Cell($this->GetStringWidth(get_text('Archer') . ": "), $TopOffset / 6, get_text('Archer') . ": ", 'B', 0, 'L', 0); $this->SetFont($this->FontStd, 'B', 8); $this->SetColors(true); $this->Cell($Width - 1.9 * $CellW - $this->GetStringWidth(get_text('Archer') . ": "), $TopOffset / 6, array_key_exists("Ath", $Data) ? $Data["Ath"] : ' ', 'B', 0, 'L', 0); $this->SetXY($TopX + 0.2 * $CellW, $TopY + $TopOffset * 19 / 24); $this->SetFont($this->FontStd, '', 8); $this->SetColors(false); $this->Cell($this->GetStringWidth(get_text('Country') . ": "), $TopOffset / 6, get_text('Country') . ": ", 'B', 0, 'L', 0); $this->SetFont($this->FontStd, 'B', 8); $this->SetColors(true); $CellTmpWidth = $Width - 1.9 * $CellW - $this->GetStringWidth(get_text('Country') . ": "); if (array_key_exists("Noc", $Data)) { $str = $Data['CoCode'] . ' -'; $strW = $this->GetStringWidth($str); $this->Cell($strW, $TopOffset / 6, $str, 'B', 0, 'L', 0); $this->Cell($CellTmpWidth - $strW, $TopOffset / 6, $Data['CoName'], 'B', 0, 'L', 0); } else { $this->Cell($CellTmpWidth, $TopOffset / 6, ' ', 'B', 0, 'L', 0); } //PAGLIONE $this->SetXY($TopX + $Width - 1.4 * $CellW, $TopY + $TopOffset * 13 / 24); $this->SetFont($this->FontStd, 'B', 20); $this->SetColors(true); $HeaderTarget = ' '; if (array_key_exists("tNo", $Data)) { $HeaderTarget = trim($Data["tNo"], '0'); if ($TargetNo != intval($Data["startTarget"])) { $HeaderTarget = $TargetNo . substr($Data["tNo"], -1, 1) . '-' . $this->Indices[ceil($Data["startTarget"] / (2 * $NumEnd)) - 2]; } } $this->Cell(1.4 * $CellW, $TopOffset * 7 / 24, $HeaderTarget, 0, 0, 'R', 1); $this->SetXY($TopX + $Width - 1.4 * $CellW, $TopY + $TopOffset * 10 / 12); $this->SetFont($this->FontStd, 'B', 10); $this->SetColors(true); $this->Cell(1.4 * $CellW, $TopOffset * 2 / 12, array_key_exists("Cat", $Data) ? $Data["Cat"] : ' ', 'T', 0, 'C', 1); //####SCORE 1 ####//// //HEADER DELLO SCORE 1 $this->SetXY($TopX, $TopY + $TopOffset); $this->SetFont($this->FontStd, 'I', 8); $this->SetFillColor(0xf8, 0xf8, 0xf8); $this->SetColors(true, true); $this->Cell(0.8 * $CellW, $CellH, array_key_exists("Dist", $Data) ? $Data["Dist"] : ' ', 0, 0, 'C', array_key_exists("Dist", $Data) ? 1 : 0); $this->SetFillColor(0xff, 0xff, 0xff); if ($this->PrintDrawing) { $this->SetFillColor(0xe8, 0xe8, 0xe8); } // $this->SetFont($this->FontStd,'',6); // $this->Cell(0.9*$CellW,$CellH,($this->PrintDrawing ? get_text('Target') : ''),1,0,'C',1); $this->SetFont($this->FontStd, 'B', 10); $this->SetColors(false); $this->Cell(0.9 * (count($Target) + 1) * $CellW, $CellH, get_text('Arrow'), 1, 0, 'C', 1); $this->SetFont($this->FontStd, 'B', 8); $this->Cell(1.4 * $CellW, $CellH, get_text('TotalShort', 'Tournament'), 1, 0, 'C', 1); $this->Cell(0.7 * $CellW, $CellH, $this->prnGolds, 1, 0, 'C', 1); $this->Cell(0.7 * $CellW, $CellH, $this->prnXNine, 1, 1, 'C', 1); //RIGHE DELLO SCORE 1 for ($i = 1; $i <= $NumEnd; $i++) { $this->SetFont($this->FontStd, 'B', 10); $this->SetXY($TopX, $TopY + $TopOffset + $CellH * $i); $this->Cell(0.8 * $CellW, $CellH, $TargetNo, 1, 0, 'C', 1); $this->SetFont($this->FontStd, '', 10); // $this->Cell(0.9*$CellW,$CellH,'',1,0,'C',0); foreach ($Target as $point) { $this->Cell(0.9 * $CellW, $CellH, $point, 1, 0, 'C', 0); } $this->Cell(0.9 * $CellW, $CellH, 'M', 1, 0, 'C', 0); $this->Cell(1.4 * $CellW, $CellH, '', 1, 0, 'C', 0); $this->Cell(0.7 * $CellW, $CellH, '', 1, 0, 'C', 0); $this->Cell(0.7 * $CellW, $CellH, '', 1, 0, 'C', 0); if (++$TargetNo > ($OnlyLeftScore ? $NumEnd : 2 * $NumEnd)) { $TargetNo = 1; } } /* //TOTALE DELLO SCORE 1 $this->SetXY($TopX, $TopY+$TopOffset+$CellH*($NumEnd+1)); $this->SetFont($this->FontStd,'B',10); $this->Cell(6.2*$CellW,$CellH, (get_text('Total1','Tournament') . " "),0,0,'R',0); $this->Cell(1.4*$CellW,$CellH,'',1,0,'C',0); $this->Cell(0.7*$CellW,$CellH,'',1,0,'C',0); $this->Cell(0.7*$CellW,$CellH,'',1,0,'C',0); */ //#### SCORE 2 ####//// //HEADER DELLO SCORE 2 $this->SetXY($TopX + ($Width - 5) / 2 + 5, $TopY + $TopOffset); $this->SetFont($this->FontStd, 'I', 8); $this->SetFillColor(0xf8, 0xf8, 0xf8); $this->SetColors(true, true); $this->Cell(0.8 * $CellW, $CellH, array_key_exists("Dist", $Data) ? $Data["Dist"] : ' ', 0, 0, 'C', array_key_exists("Dist", $Data) ? 1 : 0); $this->SetFillColor(0xff, 0xff, 0xff); if ($this->PrintDrawing) { $this->SetFillColor(0xe8, 0xe8, 0xe8); } // $this->SetFont($this->FontStd,'',6); // $this->Cell(0.9*$CellW,$CellH,($this->PrintDrawing ? get_text('Target') : ''),1,0,'C',1); $this->SetFont($this->FontStd, 'B', 10); $this->SetColors(false); $this->Cell(0.9 * (count($Target) + 1) * $CellW, $CellH, get_text('Arrow'), 1, 0, 'C', 1); $this->SetFont($this->FontStd, 'B', 8); $this->Cell(1.4 * $CellW, $CellH, get_text('TotalShort', 'Tournament'), 1, 0, 'C', 1); $this->Cell(0.7 * $CellW, $CellH, $this->prnGolds, 1, 0, 'C', 1); $this->Cell(0.7 * $CellW, $CellH, $this->prnXNine, 1, 1, 'C', 1); //RIGHE DELLO SCORE 2 for ($i = 1; $i <= $NumEnd; $i++) { $this->SetFont($this->FontStd, 'B', 10); $this->SetXY($TopX + ($Width - 5) / 2 + 5, $TopY + $TopOffset + $CellH * $i); $this->Cell(0.8 * $CellW, $CellH, $TargetNo, 1, 0, 'C', 1); $this->SetFont($this->FontStd, '', 10); // $this->Cell(0.9*$CellW,$CellH,'',1,0,'C',0); foreach ($Target as $point) { $this->Cell(0.9 * $CellW, $CellH, $point, 1, 0, 'C', 0); } $this->Cell(0.9 * $CellW, $CellH, 'M', 1, 0, 'C', 0); $this->Cell(1.4 * $CellW, $CellH, '', 1, 0, 'C', 0); $this->Cell(0.7 * $CellW, $CellH, '', 1, 0, 'C', 0); $this->Cell(0.7 * $CellW, $CellH, '', 1, 0, 'C', 0); if (++$TargetNo > ($OnlyLeftScore ? $NumEnd : 2 * $NumEnd)) { $TargetNo = 1; } } /* //TOTALE DELLO SCORE 2 $this->SetXY($TopX+($Width-5)/2+5, $TopY+$TopOffset+$CellH*($NumEnd+1)); $this->SetFont($this->FontStd,'B',10); $this->Cell(6.2*$CellW,$CellH, (get_text('Total2','Tournament') . " "),0,0,'R',0); $this->Cell(1.4*$CellW,$CellH,'',1,0,'C',0); $this->Cell(0.7*$CellW,$CellH,'',1,0,'C',0); $this->Cell(0.7*$CellW,$CellH,'',1,0,'C',0); */ //TOTALE GENERALE $OldLine = $this->GetLineWidth(); $this->SetLineWidth(0.5); $this->SetXY($TopX + ($Width - 5) / 2 + 5, $TopY + $TopOffset + $CellH * ($NumEnd + 1) + 1); $this->SetFont($this->FontStd, 'B', 10); $this->Cell((0.9 * count($Target) + 1.7) * $CellW, $CellH, get_text('Total') . " ", 0, 0, 'R', 0); $this->Cell(1.4 * $CellW, $CellH, '', 1, 0, 'C', 0); $this->Cell(0.7 * $CellW, $CellH, '', 1, 0, 'C', 0); $this->Cell(0.7 * $CellW, $CellH, '', 1, 1, 'C', 0); $this->SetLineWidth(0.2); //Se solo score di SINISTRA if ($OnlyLeftScore) { $this->SetLineWidth(0.5); $this->Line($TopX + ($Width - 5) / 2 + 5, $TopY + $TopOffset, $TopX + $Width, $TopY + $TopOffset + $CellH * ($NumEnd + 2)); $this->SetLineWidth(0.2); } //FIRME $this->SetFont($this->FontFix, 'BI', 6); $this->Cell(4, 3, '', 0, 0, 'C', 0); $this->Cell($Width / 2 - 7, 3, get_text('Archer'), 'B', 0, 'L', 0); $this->Cell(6, 3, '', 0, 0, 'C', 0); $this->Cell($Width / 2 - 7, 3, get_text('Scorer'), 'B', 1, 'L', 0); $this->Cell(4, 3, '', 0, 1, 'C', 0); $this->Cell(4, 3, '', 0, 0, 'C', 0); $this->Cell($Width - 8, 3, get_text('JudgeNotes'), 'B', 0, 'L', 0); $this->SetLineWidth($OldLine); //$this->Rect($TopX, $TopY, $Width, $Height); }
// Image Left if ($pdf->ToPaths['ToLeft']) { $pdf->Image($pdf->ToPaths['ToLeft'], $PosX + 2, $PosY + 2, 0, $ImgLHeight); } // Image Right if ($pdf->ToPaths['ToRight']) { $pdf->Image($pdf->ToPaths['ToRight'], $PosX + $AccW - $ImgRWidth - 2, $PosY + 2, 0, $ImgRHeight); } // Competition $pdf->SetXY($PosX + $ImgLWidth + 4, $PosY + 2); $pdf->SetFont('', 'B', 12); $pdf->Cell($AccW - $ImgLWidth - $ImgRWidth - 8, 7, $pdf->Name, 0, 0, 'C', 0); $pdf->SetXY($PosX + $ImgLWidth + 4, $PosY + 9); //Luogo $pdf->SetFont('', '', 7); $pdf->Cell($AccW - $ImgLWidth - $ImgRWidth - 8, 5, $pdf->Where . ", " . TournamentDate2String($pdf->WhenF, $pdf->WhenT), 0, 0, 'C', 0); // Category $pdf->SetFont('', 'BI', 16); //SE atleta --> Classe e Divisione $pdf->SetXY($PosX + 2, $PosY + 19); $pdf->Cell($AccW - 4, 0, get_text($MyRow->DivDescription, '', '', true), 0, 0, 'C', 0); $pdf->SetXY($PosX + 2, $PosY + 27); $pdf->Cell($AccW - 4, 0, get_text($MyRow->ClDescription, '', '', true), 0, 0, 'C', 0); $pdf->SetFont('', 'B', 20); //Cognome e Nome $pdf->SetXY($PosX + 2, $PosY + 39); $pdf->Cell($AccW - 4, 0, $MyRow->FirstName . ' ' . $MyRow->Name, 0, 0, 'C', 0); $pdf->SetDefaultColor(); // if($IncludePhoto and !is_null($MyRow->PhPhoto)) //FOTO dell'accredito se Presente // { // $im = imagecreatefromstring(base64_decode($MyRow->PhPhoto));
function getStartList($ORIS = '', $Event = '', $Elim = false) { $Data = new StdClass(); $Data->Code = 'C51A'; $Data->Order = $Elim ? '0' : '1'; $Data->Description = 'Start List by Target'; $Data->Header = array("Target", "Name", "NOC", "Country", "Date of Birth"); $Data->HeaderWidth = array(15, 50, 15, 50, 60); $Data->Phase = 'Qualification Round'; $Data->Continue = get_text('Continue'); $Data->TournamentDate2String = TournamentDate2String($_SESSION['TourWhenFrom'], $_SESSION['TourWhenTo']); $Data->Data = array(); $Data->Data['Fields'] = array("SesName" => get_text('SessionDescr', 'Tournament'), "EvCode" => get_text('EvCode'), "DivDescription" => get_text('Division'), "ClDescription" => get_text('Class'), "Bib" => get_text('Code', 'Tournament'), "Athlete" => get_text('Name', 'Tournament'), "Session" => get_text('Session'), "TargetNo" => get_text('Target'), "NationCode" => get_text('Country'), "Nation" => get_text('Nation'), "EventCode" => get_text('EvCode'), "EventName" => get_text('Event'), "DOB" => get_text('DOB', 'Tournament'), "SesAth4Target" => get_text('Ath4Target', 'Tournament'), "ClassCode" => get_text('Class'), "DivCode" => get_text('Division'), "AgeClass" => get_text('AgeCl'), "SubClass" => get_text('SubClass', 'Tournament'), "Status" => get_text('Status', 'Tournament'), "IC" => 'IC', "TC" => 'TC', "IF" => 'IF', "TF" => 'TF', "TM" => 'TM', "NationCode2" => get_text('Country'), "Nation2" => get_text('Nation'), "NationCode3" => get_text('Country'), "Nation3" => get_text('Nation'), "EnSubTeam" => 'EnSubTeam', "TargetFace" => get_text('TargetType'), "Poule" => get_text('Poule', 'Tournament')); if ($ORIS) { $Data->Data['Fields']['TargetNo'] = 'Target'; $Data->Data['Fields']['Athlete'] = 'Name'; $Data->Data['Fields']['NationCode'] = 'NOC'; $Data->Data['Fields']['Nation'] = 'Country'; $Data->Data['Fields']['EventName'] = 'Category'; if ($Elim and $Event) { $Data->Description .= ' Round ' . $Event; } } else { $Data->Data['Fields']['Athlete'] = get_text('Athlete'); $Data->HideCols = GetParameter("IntEvent"); $Data->BisTarget = false; $Data->NumEnd = 0; $RsTour = safe_r_sql("SELECT (ToElabTeam!=0) as BisTarget, ToNumEnds AS TtNumEnds " . "FROM Tournament " . "WHERE ToId=" . StrSafe_DB($_SESSION['TourId'])); if ($r = safe_fetch($RsTour)) { $Data->BisTarget = $r->BisTarget; $Data->NumEnd = $r->TtNumEnds; } $Data->Description = get_text('StartlistSession', 'Tournament'); } $MyQuery = getStartListQuery($ORIS, $Event, $Elim); //echo $MyQuery;exit; $Rs = safe_r_sql($MyQuery); while ($MyRow = safe_fetch($Rs)) { $MyRow->EventName = get_text($MyRow->EventName, '', '', true); if (!$Elim) { $MyRow->DivDescription = get_text($MyRow->DivDescription, '', '', true); $MyRow->ClDescription = get_text($MyRow->ClDescription, '', '', true); } else { if ($MyRow->SesName != '') { $MyRow->SesName = $MyRow->SesName . ' (' . get_text('Eliminations_' . ($MyRow->Session + 1)) . ')'; } else { $MyRow->SesName = get_text('Eliminations_' . ($MyRow->Session + 1)); } } $Data->Data['Items'][] = $MyRow; } return $Data; }