Example #1
0
 $q = safe_r_sql("select ToPrintPaper from Tournament where ToId='{$_SESSION['TourId']}'");
 if ($r = safe_fetch($q) and $r->ToPrintPaper == '1') {
     $format = array(215.9, 279.4);
 }
 if ($BadgePerPage == '4B7') {
     $format = array(166, 244);
 }
 if ($BadgePerPage != 4) {
     $format[1] = $format[1] / 2;
 }
 if ($BadgePerPage == 1) {
     $format[0] = $format[0] / 2;
 }
 //debug_svela($MyQuery, true);
 //debug_svela($pdf, true);
 $tmp = $pdf->addPage($BadgePerPage == 2 ? 'L' : 'P', $format);
 $pdf->SetAutoPageBreak(false);
 $pdf->setPrintHeader(false);
 $pdf->setPrintFooter(false);
 $cntPass = 0;
 $ImgSxSize = NULL;
 $ImgDxSize = NULL;
 $ImgLowSize = NULL;
 if (!empty($pdf->ToPaths['ToLeft'])) {
     $ImgSxSize = getimagesize($pdf->ToPaths['ToLeft']);
 }
 if (!empty($pdf->ToPaths['ToRight'])) {
     $ImgDxSize = getimagesize($pdf->ToPaths['ToRight']);
 }
 if (!empty($pdf->ToPaths['ToBottom'])) {
     $ImgLowSize = getimagesize($pdf->ToPaths['ToBottom']);
Example #2
0
while ($r = safe_fetch($q)) {
    $r->Options = unserialize($r->IceOptions);
    if (!empty($r->Options['Font'])) {
        $r->Options['FontFamily'] = $pdf->addTTFfont(K_PATH_FONTS . $r->Options['Font'] . '.ttf');
        $r->Options['FontStyle'] = (substr($r->Options['Font'], -2, 1) == 'b' ? 'B' : '') . (substr($r->Options['Font'], -1, 1) == 'i' ? 'I' : '');
    }
    if ($r->IceType == 'Accomodation') {
        // calculate the final dimentions regard the space we have....
        $OrgAcScaleFactor = ($r->Options['H'] - 4) / $AcHeight;
    }
    $Elements[] = $r;
}
while ($MyRow = safe_fetch($Rs)) {
    $pdf->SetDefaultColor();
    if ($cntPass == 0) {
        $tmp = $pdf->addPage();
    }
    $StartX = $Badges[$cntPass][0];
    $StartY = $Badges[$cntPass][1];
    if ($BackGround->IcBackground and file_exists($Back = $CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-Accreditation.jpg')) {
        // 		unset($BackGround->IcBackground);
        // 		debug_svela($BackGround);
        $ElX = $StartX + $BackGround->Options['IdBgX'];
        $ElY = $StartY + $BackGround->Options['IdBgY'];
        $pdf->Image($Back, $ElX, $ElY, $BackGround->Options['IdBgW'], $BackGround->Options['IdBgH']);
    }
    foreach ($Elements as $Element) {
        unset($Text);
        $ElX = $StartX + $Element->Options['X'];
        $ElY = $StartY + $Element->Options['Y'];
        switch ($Element->IceType) {