$pdf->SetDefaultColor(); $PosX = $cntPass % 2 == 0 ? 5 : $pdf->getPageWidth() / 2 + 5; $PosY = $cntPass % 6 < 2 ? 5 : ($cntPass % 6 < 4 ? $pdf->getPageHeight() / 3 + 5 : $pdf->getPageHeight() * 2 / 3 + 5); $AccColor = array(255, 255, 255); if (!is_null($MyRow->AcColor)) { $AccColor = array(base_convert(substr($MyRow->AcColor, 0, 2), 16, 10), base_convert(substr($MyRow->AcColor, 2, 2), 16, 10), base_convert(substr($MyRow->AcColor, 4, 2), 16, 10)); } //Every 4 Accreditation I change page if ($cntPass % 6 == 0) { $pdf->AddPage(); } //PRIMA Area dell'accredito: Logo SX e Nome/Country + sfondo colore - Altezza 6/20 (ne restano 14/20)) $pdf->SetXY($PosX, $PosY); $pdf->SetFont('', 'B', 12); $pdf->Cell($AccW, $AccH * 0.05, $pdf->Name, 0, 0, 'C', 0); $pdf->Rect($PosX, $PosY + $AccH * 0.05, $AccW, $AccH * 0.2, 'F', array(), $AccColor); $tmpX = $PosX + 2; if (!is_null($ImgSxSize)) { //Immagine Sinistra if ($ImgSxSize[0] / $ImgSxSize[1] <= ($AccW * 0.4 - 4) / ($AccH * 0.2 - 4)) { //Immagine troppo larga $pdf->Image($pdf->ToPaths['ToLeft'], $tmpX, $PosY + $AccH * 0.05 + 2, 0, $AccH * 0.2 - 4); } else { $pdf->Image($pdf->ToPaths['ToLeft'], $tmpX, $PosY + $AccH * 0.05 + ($AccW * 0.4 - 4) / $ImgSxSize[0] * $ImgSxSize[1] / 2 / $pdf->getScaleFactor(), $AccW * 0.4 - 4, 0); } $tmpX = $pdf->getImageRBX() + 2; } if ($MyRow->AcTitleReverse) { $pdf->SetTextColor(255); } $pdf->SetFont('', 'B', 16);
$pdf->Line(105, 2, 105, 5); $pdf->Line(105, 146.5, 105, 150.5); $pdf->Line(105, 292, 105, 295); } $myPosX = $PosX[$i % 4]; $myPosY = $PosY[$i % 4]; //$pdf->SetFillColor($ColorArray[$MyRow->Session-1][0],$ColorArray[$MyRow->Session-1][1],$ColorArray[$MyRow->Session-1][2]); // solo per batumi if (!is_null($MyRow->AcColor)) { $pdf->SetFillColor(base_convert(substr($MyRow->AcColor, 0, 2), 16, 10), base_convert(substr($MyRow->AcColor, 2, 2), 16, 10), base_convert(substr($MyRow->AcColor, 4, 2), 16, 10)); } else { $pdf->SetFillColor(255, 255, 255); } $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));
// $pdf->Image($CFG->DOCUMENT_PATH . 'Common/Images/AcMeal.png', $PosX+($AccW*0.2475)+6, $PosY+($AccH*0.81), $AccW*0.0675, 0, 'png'); // [AcTransport] => 3 // [AcAccomodation] => 1 // [AcMeal] => 1 // if($MyRow->AcAccomodation != 0) // $pdf->Image($CFG->DOCUMENT_PATH . 'Common/Images/AcAccomodation.png', $PosX+($AccW*0.165)+4, $PosY+($AccH*0.81), $AccW*0.0825, 0, 'png'); // if($MyRow->AcMeal != 0) // $pdf->Image($CFG->DOCUMENT_PATH . 'Common/Images/AcMeal.png', $PosX+($AccW*0.2475)+6, $PosY+($AccH*0.81), $AccW*0.0675, 0, 'png'); // [AcTransport] => 3 // [AcAccomodation] => 1 // [AcMeal] => 1 case 'Flag': if (file_exists($im = $CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-Fl-' . $MyRow->NationCode . '.jpg')) { $pdf->Image($im, $ElX, $ElY, $Element->Options['W'], $Element->Options['H']); $pdf->SetDrawColor(128); $pdf->Rect($ElX, $ElY, $Element->Options['W'], $Element->Options['H']); $pdf->SetDrawColor(0); } break; case 'ColoredArea': $Text = explode("\n", $Element->IceContent); $Element->Options['H'] = $Element->Options['H'] / count($Text); case 'CompName': if (!isset($Text)) { $Text = array($_SESSION['TourName']); } case 'CompDetails': if (!isset($Text)) { $Text = array($_SESSION['TourWhere'] . ' - ' . TournamentDate2StringShort($_SESSION['TourWhenFrom'], $_SESSION['TourWhenTo'])); } case 'AthCode':
$MyQuery .= "AND SUBSTRING(AtTargetNo,1,1) = " . StrSafe_DB($_REQUEST["Session"]) . " "; } //$MyQuery .= "AND AtTargetNo IN ('145B','145D','146D','149D','151C','152A') "; $MyQuery .= "ORDER BY AtTargetNo, CoCode, Name, CoName, FirstName "; $Rs = safe_r_sql($MyQuery); if ($Rs) { $Etichetta = 0; while ($MyRow = safe_fetch($Rs)) { if ($Etichetta == 0) { $pdf->AddPage(); } //Cerchia Etichetta //$pdf->Rect((($Etichetta % 3) * $lblW),(intval($Etichetta / 3) * $lblH),$lblW,$lblH,"D"); //Status if ($MyRow->Status > 1) { $pdf->Rect($Etichetta % 3 * $lblW + 4, intval($Etichetta / 3) * $lblH + 4, $lblW - 8, $lblH - 10 * $lblSp, "FD"); } //Piazzola, Turno & Classe.Divisione $pdf->SetXY($Etichetta % 3 * $lblW + 5, intval($Etichetta / 3) * $lblH + 2 * $lblSp); $pdf->SetFont($pdf->FontStd, 'B', 20); $pdf->Cell(15, 8, $MyRow->TargetNo, 0, 0, 'L', 0); $pdf->SetFont($pdf->FontStd, 'B', 12); $pdf->SetXY($pdf->GetX(), intval($Etichetta / 3) * $lblH + 3 * $lblSp); $pdf->Cell(25, 6, get_text('Session') . ": " . $MyRow->Session, 0, 0, 'C', 0); $pdf->Cell($lblW - 50, 6, $MyRow->DivCode . ' ' . $MyRow->ClassCode, 0, 0, 'R', 0); //Arciere & Società $pdf->SetXY($Etichetta % 3 * $lblW + 5, intval($Etichetta / 3) * $lblH + 6 * $lblSp); $pdf->SetFont($pdf->FontStd, 'B', 12); $pdf->Cell($lblW - 10, 6, $MyRow->FirstName . ' ' . $MyRow->Name, 0, 0, 'L', 0); $pdf->SetXY($Etichetta % 3 * $lblW + 5, intval($Etichetta / 3) * $lblH + 9 * $lblSp); $pdf->SetFont($pdf->FontStd, '', 10);
$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)); // $tmpImgW = ((((($AccH*0.3)-4)/imagesy($im))*imagesx($im))); // $pdf->Image('@'.base64_decode($MyRow->PhPhoto), $PosX + $AccW - 2 - $tmpImgW, $PosY+($AccH*0.3)+ 2, 0, ($AccH*0.3) - 4,'','','',false,300,'',false,false,1); // imagedestroy($im); // } // Nation Picture if (file_exists($tmp = $CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-Fl-svg-' . $MyRow->NationCode . '.svg')) { $pdf->ImageSVG($tmp, $PosX + 2, $PosY + $AccH - $FlagHeight - 2, 0, $FlagHeight, '', '', '', 1); } elseif (file_exists($tmp = $CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-Fl-' . $MyRow->NationCode . '.jpg')) { $pdf->Image($tmp, $PosX + 2, $PosY + $AccH - $FlagHeight - 2, 0, $FlagHeight, '', '', '', 1); } $pdf->SetXY($PosX + 2 + $FlagHeight / 2 * 3, $PosY + $AccH - $FlagHeight - 2); //Country $pdf->SetFont('', 'B', 25); //Cognome e Nome $pdf->Cell($AccW - 2 - $FlagHeight / 2 * 3, $FlagHeight, $MyRow->Nation, 0, 0, 'C', 0); //RETTANGOLO CHE CONTIENE L'ACCREDITO $pdf->Rect($PosX, $PosY, $AccW, $AccH); $cntPass++; } safe_free_result($Rs); $pdf->Output();