Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $initr=$this->record;
- $r=($initr % 30);
- // Barcode style used for all regular barcodes
- $barstyle = array (
- 'border' => false,
- 'text' => false, // if true prints text below the barcode
- 'font' => 'helvetica', // font name for text
- 'fontsize' => 2, // font size for text
- );
- // Barcode style to highlight the culprit barcode (record 30) in yellow
- $barstyle2 = array (
- 'border' => false,
- 'text' => false, // if true prints text below the barcode
- 'font' => 'helvetica', // font name for text
- 'fontsize' => 2, // font size for text
- 'bgcolor' => array(255,255,128)
- );
- // Row 1 holding each record's X & Y coordinates
- if ($r == 1) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 2) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 3) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '.58', '', 0.15, 0.015, $barstyle, '');}
- // Row 2 holding each record's X & Y coordinates
- elseif ($r == 4) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '1.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 5) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '1.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 6) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '1.58', '', 0.15, 0.015, $barstyle, '');}
- // Row 3 holding each record's X & Y coordinates
- elseif ($r == 7) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '2.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 8) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '2.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 9) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '2.58', '', 0.15, 0.015, $barstyle, '');}
- // Row 4 holding each record's X & Y coordinates
- elseif ($r == 10) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '3.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 11) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '3.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 12) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '3.58', '', 0.15, 0.015, $barstyle, '');}
- // Row 5 holding each record's X & Y coordinates
- elseif ($r == 13) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '4.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 14) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '4.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 15) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '4.58', '', 0.15, 0.015, $barstyle, '');}
- // Row 6 holding each record's X & Y coordinates
- elseif ($r == 16) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '5.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 17) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '5.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 18) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '5.58', '', 0.15, 0.015, $barstyle, '');}
- // Row 7 holding each record's X & Y coordinates
- elseif ($r == 19) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '6.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 20) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '6.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 21) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '6.58', '', 0.15, 0.015, $barstyle, '');}
- // Row 8 holding each record's X & Y coordinates
- elseif ($r == 22) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '7.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 23) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '7.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 24) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '7.58', '', 0.15, 0.015, $barstyle, '');}
- // Row 9 holding each record's X & Y coordinates
- elseif ($r == 25) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '8.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 26) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '8.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 27) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '8.58', '', 0.15, 0.015, $barstyle, '');}
- // Row 10 holding each record's X & Y coordinates
- elseif ($r == 28) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '9.58', '', 0.15, 0.015, $barstyle, '');}
- elseif ($r == 29) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '9.58', '', 0.15, 0.015, $barstyle, '');}
- else {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '9.58', '', 0.15, 0.015, $barstyle2, '');}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement