require_once dirname(dirname(__FILE__)) . '/config.php'; require_once 'Common/pdf/LabelPDF.inc.php'; require_once 'CommonCard.php'; $Rs = safe_r_sql($MyQuery); if (!safe_num_rows($Rs)) { include 'Common/Templates/head-popup.php'; echo '<table height="' . ($_SESSION['WINHEIGHT'] - 50) . '" width="100%"><tr><td>'; echo '<div align="center">' . get_text('BadgeNoData', 'Tournament') . ''; echo '<br/><br/><input type="button" onclick="window.close();" value="' . get_text('Close') . '">'; echo '</td></tr></table>'; include 'Common/Templates/tail-popup.php'; die; } $pdf = new LabelPDF(); $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']); }
} $MyQuery .= "ORDER BY QuSession, FirstName, Name, TargetNo "; //print $MyQuery;exit; //print '<br><br>'.$MyQuery;exit; $PosX = array(6, 111, 6, 111); $PosY = array(6, 6, 155, 155); //echo $MyQuery; $Rs = safe_r_sql($MyQuery); if (safe_num_rows($Rs) > 0) { $pdf = new LabelPDF(); // 'P','mm','A4'); $pdf->AliasNbPages(); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); $pdf->SetMargins(6, 6, 6); $pdf->SetAutoPageBreak(false, 15); $pdf->SetTextColor(0x0, 0x0, 0x0); $i = 0; while ($MyRow = safe_fetch($Rs)) { $pdf->SetFont($pdf->FontStd, 'B', 18); if ($i % 4 == 0) { $pdf->AddPage(); //Crop Mark $pdf->Line(2, 148.5, 5, 148.5); $pdf->Line(103, 148.5, 107, 148.5); $pdf->Line(205, 148.5, 208, 148.5); $pdf->Line(105, 2, 105, 5); $pdf->Line(105, 146.5, 105, 150.5); $pdf->Line(105, 292, 105, 295); } $myPosX = $PosX[$i % 4];