$MarBottom = $_REQUEST['sticker_Bot']; $StickRows = $_REQUEST['sticker_Y']; $StickCols = $_REQUEST['sticker_X']; $ColIntMargin = $_REQUEST['sticker_InterCols']; $RowIntMargin = $_REQUEST['sticker_InterRows']; $PaperHeight = $_REQUEST['sticker_PageHeight']; $PaperWidth = $_REQUEST['sticker_PageWidth']; $pdf = new LabelPDF(); if ($IncludePicture) { include_once 'Common/CheckPictures.php'; CheckPictures('', true, false, true); // cancella le foto più vecchie di 1 giorno // prints all the pictures in the size specified... $MySQL = "select" . " PhEnId, concat(CoCode, ' (', EnCode, '-', EnFirstName, ')') code " . "from" . " Photos" . " inner join Entries on EnId=PhEnId " . " inner join Countries on EnCountry=CoId " . " left join Qualifications on EnId=QuId " . "where" . " EnTournament={$_SESSION['TourId']} " . (isset($_REQUEST["Session"]) && is_numeric($_REQUEST["Session"]) ? " AND SUBSTRING(QuTargetNo,1,1) = " . StrSafe_DB($_REQUEST["Session"]) . " " : '') . " and PhPhoto>'' order by code"; $q = safe_r_sql($MySQL); $pdf->addpage(); $NumCols = floor(($PaperWidth - 2 * $MarLeftRight) / max(1, $StickCols)); $HGap = ($PaperWidth - 2 * $MarLeftRight - $NumCols * $StickCols) / ($NumCols - 1); $NumRows = floor(($PaperHeight - $MarTop - $MarTop) / max(1, $StickRows + 3)); $VGap = ($PaperHeight - $MarTop - $MarTop - $NumRows * ($StickRows + 3)) / ($NumRows - 1); $X = $MarLeftRight; $Y = $MarTop; $pdf->SetFontSize(7); error_reporting(E_ALL); while ($r = safe_fetch($q)) { if (!is_file($file = $CFG->DOCUMENT_PATH . 'TV/Photos/' . $_SESSION['TourCodeSafe'] . '-En-' . $r->PhEnId . '.jpg')) { continue; } $pdf->Image($file, $X, $Y, $StickCols, $StickRows, 'JPG', '', '', true, 300, '', false, false, 1, true); $pdf->setXY($X, $Y + $StickRows); $pdf->cell($StickCols, 3, $r->code, '', '', 'C', '', '', 1);