function render($rpt) { $lay = new Lay(); $lay->container('Lines', array('margin-top' => '0.25in', 'margin-bottom' => '0.25in', 'margin-left' => '0.40625in', 'margin-right' => '0.46875in', 'x-spacing' => '0.09375in')); $lay->container('Columns'); list(, $skip) = $this->p->getFirst('skip'); for ($i = 0; $i < $skip; $i++) { $lay->container('Column', array('height' => '0.75in', 'width' => '1in')); $lay->close(); } while ($row = $rpt->each()) { $lay->container('Column', array('height' => '0.75in', 'width' => '1in', 'y-align' => 'center')); $lay->container('TextLine', array('x-align' => 'center')); $lay->pushFont('Code39JK', 12); $lay->text('*' . strtoupper($row['barcode_nmbr']) . '*'); $lay->popFont(); $lay->close(); $lay->container('TextLine', array('margin-top' => -3, 'x-align' => 'center')); $lay->pushFont('Code39JK', 12); $lay->text('*' . strtoupper($row['barcode_nmbr']) . '*'); $lay->popFont(); $lay->close(); $lay->container('TextLine', array('x-align' => 'center')); $lay->pushFont('Courier', 10); $lay->text(strtoupper($row['barcode_nmbr'])); $lay->popFont(); $lay->close(); $lay->close(); } $lay->close(); $lay->close(); $lay->close(); }
function render($rpt) { $cols = $rpt->columns(); $colspacing = 0.125; $total = 0; $totalspacing = 0; for ($i = 0; $i < count($cols); $i++) { if (isset($cols[$i]['hidden'])) { continue; } if (!isset($cols[$i]['width'])) { $cols[$i]['width'] = 1; } $total += $cols[$i]['width']; $totalspacing += $colspacing; } $totalspacing -= $colspacing; if ($total <= 0) { Fatal::internalError('Total width of columns must be positive'); } # We have 7.5in, distribute it weighted by width $unit = (7.5 - $totalspacing) / $total; $lay = new Lay(); $lay->container('Columns', array('margin-left' => '0.5in', 'margin-right' => '0.5in', 'margin-top' => '0.5in', 'margin-bottom' => '0.5in')); if ($rpt->title()) { $lay->pushFont('Times-Bold', 18); $lay->container('TextLine', array('x-align' => 'center')); $lay->text($rpt->title()); $lay->close(); $lay->popFont(); } $lay->pushFont('Times-Italic', 12); $lay->container('Line', array('x-spacing' => $colspacing . 'in')); foreach ($cols as $col) { if (isset($col['hidden'])) { continue; } $lay->container('TextLine', array('width' => $unit * $col['width'] . 'in', 'underline' => 1)); $lay->text($col['title']); $lay->close(); } $lay->close(); $lay->popFont(); while ($row = $rpt->each()) { $lay->container('Line', array('x-spacing' => $colspacing . 'in')); foreach ($cols as $col) { if (isset($col['hidden'])) { continue; } $lay->container('TextLine', array('width' => $unit * $col['width'] . 'in')); $lay->text($row[$col['name']]); $lay->close(); } $lay->close(); } $lay->close(); $lay->close(); }
function render($rpt) { $lay = new Lay('A4'); $lay->container('Columns', array('margin-top' => '12.5mm', 'margin-bottom' => '12.4mm', 'margin-left' => '32.5mm', 'margin-right' => '32.5mm')); list(, $skip) = $this->p->getFirst('skip'); for ($i = 0; $i < $skip; $i++) { $lay->container('Line', array('height' => '17mm', 'width' => '144.8mm')); $lay->close(); } while ($row = $rpt->each()) { $lay->container('Line', array('height' => '17mm', 'width' => '144.8mm')); $lay->container('Column', array('width' => '12mm')); $lay->close(); $lay->container('Column', array('width' => '20mm', 'y-align' => 'center')); $lay->pushFont('Helvetica-Bold', 11); $lay->text($row['callno']); $lay->popFont(); $lay->close(); $lay->container('Column', array('width' => '64mm', 'y-spacing' => '-0.3mm', 'y-align' => 'center')); $lay->container('TextLine', array('x-align' => 'center', 'height' => '8.5mm')); $lay->pushFont('Code39JK', 36); $lay->text('*' . strtoupper($row['barcode_nmbr']) . '*'); $lay->popFont(); $lay->close(); $lay->container('TextLine', array('x-align' => 'center')); $lay->pushFont('Courier', 10); $lay->text(strtoupper($row['barcode_nmbr'])); $lay->popFont(); $lay->close(); $lay->close(); $lay->container('Column', array('width' => '48mm', 'y-align' => 'center')); $lay->pushFont('Helvetica', 9); $lay->container('TextLine'); if (strlen($row['author']) > 30) { $row['author'] = substr($row['author'], 0, 30) . "..."; } $lay->text($row['author']); $lay->close(); $lay->container('TextLine'); if (strlen($row['title']) > 30) { $row['title'] = substr($row['title'], 0, 30) . "..."; } $lay->text($row['title']); $lay->close(); $lay->container('TextLine'); $lay->text($row['collection']); $lay->close(); $lay->popFont(); $lay->close(); $lay->close(); } $lay->close(); $lay->close(); }
function render($rpt) { $lay = new Lay(); $lay->container('Columns', array('margin-top' => '0.0in', 'margin-bottom' => '0.0in', 'margin-left' => '4.32in', 'margin-right' => '0.83in')); $lay->container('Lines'); $lay->container('Columns'); list(, $skip) = $this->p->getFirst('skip'); for ($i = 0; $i < $skip; $i++) { $lay->container('Column', array('height' => '3.66in', 'width' => '3.25in')); $lay->close(); } while ($row = $rpt->each()) { $lay->container('Column', array('height' => '3.66in', 'width' => '3.25in', 'margin-top' => '0.83in', 'margin-bottom' => '0.83in', 'margin-left' => '0.14in', 'margin-right' => '0.14in')); $lay->container('Column', array('height' => '1.22in', 'y-align' => 'top')); $lay->container('TextLine'); $lay->pushFont('Times-Bold', 10); $lay->text(OBIB_LIBRARY_NAME); $lay->popFont(); $lay->close(); $lay->container('Column', array('margin-left' => '0.07in', 'width' => '1.88in', 'y-align' => 'center')); $lay->pushFont('Helvetica', 10); $lay->container('TextLines'); $lay->text($row['name']); $lay->close(); $lay->container('TextLines'); $lay->text($row['classification'] . " " . $row['school_grade']); $lay->close(); $lay->popFont(); $lay->close(); $lay->close(); $lay->container('Column', array('height' => '0.5in', 'y-align' => 'top')); $lay->container('TextLine', array('margin-left' => '0.25in')); $lay->pushFont('Courier', 10); $lay->text(strtoupper($row['barcode_nmbr'])); $lay->popFont(); $lay->close(); // Do not decrease left margin for barcode, scanner needs quiet zone $lay->container('TextLine', array('height' => '0.33in', 'margin-left' => '0.25in')); $lay->pushFont('Code39JK', 36); $lay->text('*' . strtoupper($row['barcode_nmbr']) . '*'); $lay->popFont(); $lay->close(); $lay->close(); $lay->close(); } $lay->close(); $lay->close(); $lay->close(); $lay->close(); }
function render($rpt) { $lay = new Lay(); $lay->container('Lines', array('margin-top' => '0.5in', 'margin-bottom' => '0.5in', 'margin-left' => '0.0', 'margin-right' => '0.0in')); $lay->container('Columns'); list(, $skip) = $this->p->getFirst('skip'); for ($i = 0; $i < $skip; $i++) { $lay->container('Column', array('height' => '1in', 'width' => '2.8333in')); $lay->close(); } while ($row = $rpt->each()) { $lay->container('Column', array('height' => '1in', 'width' => '2.8333in', 'margin-left' => '0.3in', 'margin-right' => '0.3in', 'y-align' => 'center')); $lay->pushFont('Helvetica', 10); $lay->container('TextLine'); $lay->text($row['name']); $lay->close(); foreach (explode("\n", $row['address']) as $l) { $lay->container('TextLine'); $lay->text($l); $lay->close(); } $lay->popFont(); $lay->close(); } $lay->close(); $lay->close(); $lay->close(); }
function render($rpt) { $lay = new Lay('A4'); $lay->container('Columns', array('margin-top' => '12mm', 'margin-bottom' => '12mm', 'margin-left' => '32.5mm', 'margin-right' => '32.5mm')); list(, $skip) = $this->p->getFirst('skip'); for ($i = 0; $i < $skip; $i++) { $lay->container('Line', array('height' => '16.9mm', 'width' => '145mm')); $lay->close(); } while ($row = $rpt->each()) { $lay->container('Line', array('height' => '16.9mm', 'width' => '145mm')); $lay->container('Column', array('width' => '29mm', 'y-align' => 'center')); $lay->pushFont('Garuda-Bold', 11); $lay->text($row['callno']); $lay->popFont(); $lay->close(); $lay->container('Column', array('width' => '58mm', 'y-spacing' => '1mm', 'y-align' => 'center')); $lay->container('TextLine', array('x-align' => 'center')); $lay->pushFont('Free3of9', 20); $lay->text('*' . strtoupper($row['barcode_nmbr']) . '*'); $lay->popFont(); $lay->close(); $lay->container('TextLine', array('x-align' => 'center')); $lay->pushFont('Garuda', 10); $lay->text(strtoupper($row['barcode_nmbr'])); $lay->popFont(); $lay->close(); $lay->close(); $lay->container('Column', array('width' => '58mm', 'y-align' => 'center')); $lay->pushFont('Garuda', 9); $lay->container('TextLine'); $lay->text($row['author']); $lay->close(); $lay->container('TextLine'); $lay->text($row['title']); $lay->close(); $lay->container('TextLine'); $lay->text($row['collection']); $lay->close(); $lay->popFont(); $lay->close(); $lay->close(); } $lay->close(); $lay->close(); }
function render($rpt) { $lay = new Lay(); $lay->container('Lines', array('margin-top' => '0.5in', 'margin-bottom' => '0.5in', 'margin-left' => '0.0', 'margin-right' => '0.0in')); $lay->container('Columns'); list(, $skip) = $this->p->getFirst('skip'); for ($i = 0; $i < $skip; $i++) { $lay->container('Column', array('height' => '1in', 'width' => '2.8333in')); $lay->close(); } while ($row = $rpt->each()) { $lay->container('Column', array('height' => '1in', 'width' => '2.8333in', 'y-align' => 'center')); $lay->container('TextLine', array('x-align' => 'center')); $lay->pushFont('Times-Roman', 10); if (strlen($row['title']) > 30) { $row['title'] = substr($row['title'], 0, 30) . "..."; } $lay->text($row['title']); $lay->popFont(); $lay->close(); $lay->container('TextLine', array('x-align' => 'center')); $lay->pushFont('Code39JK', 24); $lay->text('*' . strtoupper($row['barcode_nmbr']) . '*'); $lay->popFont(); $lay->close(); $lay->container('TextLine', array('x-align' => 'center')); $lay->pushFont('Courier', 10); $lay->text(strtoupper($row['barcode_nmbr'])); $lay->popFont(); $lay->close(); $lay->close(); $lay->container('TextLine', array('x-align' => 'center')); $lay->pushFont('Courier', 10); $lay->text(strtoupper($row['barcode_nmbr'])); $lay->popFont(); $lay->close(); } $lay->close(); $lay->close(); $lay->close(); }
function render($rpt) { $commands = array(array('%CHECKOUT%', "To check items out for a single member, scan this code, then a member code, then any number of item barcodes.\n**NOTE: Rescan this code before checking items out for a different member."), array('%CHECKIN%', "To check items in, scan this code, then any number of item barcodes.")); $lay = new Lay(); $lay->container('Columns', array('margin-top' => '1in', 'margin-bottom' => '1in', 'margin-left' => '1in', 'margin-right' => '1in', 'y-spacing' => 36)); $lay->pushFont('Times-Roman', 24); $lay->container('TextLine', array('x-align' => 'center')); $lay->text('Offline Circulation Command Codes'); $lay->close(); $lay->popFont(); $lay->container('Lines'); foreach ($commands as $cmd) { $lay->container('Column', array('width' => '3in')); $lay->element('spacer', array('height' => 4)); $lay->container('TextLine', array('x-align' => 'center')); $lay->pushFont('Code39JK', 24); $lay->text('*' . $cmd[0] . '*'); $lay->popFont(); $lay->close(); $lay->container('TextLine', array('x-align' => 'center')); $lay->pushFont('Courier', 10); $lay->text($cmd[0]); $lay->popFont(); $lay->close(); $lay->close(); $lay->container('Column', array('y-spacing' => 9)); foreach (explode("\n", $cmd[1]) as $p) { $lay->container('Column'); $lay->container('TextLines'); $lay->text($p); $lay->close(); $lay->close(); } $lay->close(); } $lay->close(); $lay->close(); $lay->close(); }
function render($rpt) { $lay = new Lay('Letter'); // Page margins: $lay->container('Columns', array('margin-top' => '12mm', 'margin-bottom' => '12mm', 'margin-left' => '9mm', 'margin-right' => '9mm')); $lay->container('Lines'); $lay->container('Columns'); list(, $skip) = $this->p->getFirst('skip'); for ($i = 0; $i < $skip; $i++) { $lay->container('Column', array('height' => '51.0mm', 'width' => '97.0mm')); $lay->close(); } while ($row = $rpt->each()) { // Total width and heigth for set of 3 sublabels $lay->container('Lines', array('height' => '51.0mm', 'width' => '97.0mm')); $lay->container('Columns'); // Label 1 (spine): $lay->container('Column', array('x-align' => 'center', 'y-align' => 'center', 'width' => '22.5mm', 'height' => '37.5mm', 'margin-left' => '3mm')); $lay->pushFont('Helvetica-Bold', 11); $lay->text($row['callno']); $lay->popFont(); $lay->close(); // Label 2: $lay->container('Column', array('width' => '70.5mm', 'height' => '25.4mm', 'margin-top' => '2.5mm', 'margin-bottom' => '2.5mm', 'margin-left' => '6.5mm', 'margin-right' => '2.5mm', 'y-align' => 'center')); $lay->pushFont('Helvetica', 9); $lay->container('TextLine'); if (strlen($row['author']) > 45) { $row['title'] = substr($row['author'], 0, 40) . "..."; } $lay->text($row['author']); $lay->close(); $lay->container('TextLine'); if (strlen($row['title']) > 45) { $row['title'] = substr($row['title'], 0, 40) . "..."; } $lay->text($row['title']); $lay->close(); $lay->popFont(); $lay->close(); // Label 3: $lay->container('Column', array('width' => '70.5mm', 'height' => '25.4mm', 'margin-top' => '2.5mm', 'margin-bottom' => '2.5mm', 'margin-left' => '2.5mm', 'margin-right' => '2.5mm', 'y-align' => 'center')); $lay->pushFont('Helvetica', 9); $lay->container('TextLine'); //$lay->text('Please return to:'); $lay->close(); $lay->container('TextLine'); $lay->text(OBIB_LIBRARY_NAME); $lay->close(); $lay->container('TextLine'); $lay->text('...'); $lay->close(); $lay->container('TextLine'); $lay->text('...'); $lay->close(); $lay->popFont(); $lay->container('TextLine', array('x-align' => 'center', 'height' => '8.5mm')); $lay->pushFont('Code39JK', 36); $lay->text('*' . strtoupper($row['barcode_nmbr']) . '*'); $lay->popFont(); $lay->close(); $lay->container('TextLine', array('x-align' => 'center')); $lay->pushFont('Courier', 10); $lay->text(strtoupper($row['barcode_nmbr'])); $lay->popFont(); $lay->close(); $lay->close(); $lay->close(); $lay->close(); } $lay->close(); $lay->close(); $lay->close(); $lay->close(); }
function render($rpt) { list($rpt, $errs) = $rpt->variant_el(array('order_by' => 'member')); if (!empty($errs)) { Fatal::internalError('Unexpected report error'); } $mbrQ = new MemberQuery(); $lay = new Lay(); $lay->pushFont('Helvetica', 10); $lay->container('Columns', array('margin-left' => '1in', 'margin-right' => '1in', 'margin-top' => '1in', 'margin-bottom' => '1in')); $mbr = NULL; $oldmbr = NULL; while ($row = $rpt->each()) { if ($row['mbrid'] != $oldmbr) { if ($oldmbr !== NULL) { $lay->close(); $lay->container('Columns', array('margin-left' => '1in', 'margin-right' => '1in', 'margin-top' => '1in', 'margin-bottom' => '1in')); } $mbr = $mbrQ->get($row['mbrid']); $oldmbr = $row['mbrid']; $lay->container('Column', array('margin-left' => '3.25in')); $lay->container('TextLine'); $lay->text(date('m/d/Y')); $lay->close(); $lay->element('Spacer', array('height' => 14)); $lines = array(OBIB_LIBRARY_NAME, '101 1st Street', 'Busytown, IA 11111-2222', 'phone: ' . OBIB_LIBRARY_PHONE, 'hours: ' . OBIB_LIBRARY_HOURS); foreach ($lines as $l) { $lay->container('TextLine'); $lay->text($l); $lay->close(); } $lay->close(); $lay->element('Spacer', array('height' => 14)); $lay->container('TextLine'); $lay->text($mbr->getFirstName() . ' ' . $mbr->getLastName()); $lay->close(); foreach (explode("\n", $mbr->getAddress()) as $l) { $lay->container('TextLine'); $lay->text($l); $lay->close(); } $lay->element('Spacer', array('height' => 14)); $lay->container('TextLine'); $lay->text('Dear ' . $mbr->getFirstName() . ' ' . $mbr->getLastName() . ':'); $lay->close(); $lay->element('Spacer', array('height' => 9)); $lay->container('Paragraph'); $lay->container('TextLines'); $lay->text('Our records show that the following library items ' . 'are checked out under your name and are past due. Please ' . 'return them as soon as possible and pay any late fees due.'); $lay->close(); $lay->close(); $lay->element('Spacer', array('height' => 28)); $lay->container('TextLine'); $lay->text('Sincerely,'); $lay->close(); $lay->element('Spacer', array('height' => 14)); $lay->container('TextLine'); $lay->text('The library staff at ' . OBIB_LIBRARY_NAME); $lay->close(); $lay->element('Spacer', array('height' => 14)); $lay->pushFont('Times-Italic', 12); $lay->container('Line'); $lay->container('TextLine', array('width' => '1.5in', 'underline' => 1)); $lay->text('Title'); $lay->close(); $lay->container('TextLine', array('width' => '1.5in', 'underline' => 1)); $lay->text('Author'); $lay->close(); $lay->container('TextLine', array('width' => '1in', 'underline' => 1)); $lay->text('Due Date'); $lay->close(); $lay->container('TextLine', array('width' => '0.75in', 'underline' => 1)); $lay->text('Days Late'); $lay->close(); $lay->close(); $lay->popFont(); } $lay->container('Line'); $lay->container('TextLine', array('width' => '1.5in')); $lay->text($row['title']); $lay->close(); $lay->container('TextLine', array('width' => '1.5in')); $lay->text($row['author']); $lay->close(); $lay->container('TextLine', array('width' => '1in')); $lay->text(date('m/d/y', strtotime($row['due_back_dt']))); $lay->close(); $lay->container('TextLine', array('width' => '0.75in')); $lay->text($row['days_late']); $lay->close(); $lay->close(); } $lay->close(); $lay->popFont(); $lay->close(); }