Advertisement
webmw

Untitled

Jan 28th, 2013
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.91 KB | None | 0 0
  1. <?php
  2. $initr=$this->record;
  3. $r=($initr % 30);
  4.  
  5. // Barcode style used for all regular barcodes
  6. $barstyle = array (
  7.     'border' => false,
  8.     'text' => false, // if true prints text below the barcode
  9.     'font' => 'helvetica', // font name for text
  10.     'fontsize' => 2, // font size for text
  11.     );
  12.  
  13. // Barcode style to highlight the culprit barcode (record 30) in yellow
  14. $barstyle2 = array (
  15.     'border' => false,
  16.     'text' => false, // if true prints text below the barcode
  17.     'font' => 'helvetica', // font name for text
  18.     'fontsize' => 2, // font size for text
  19. 'bgcolor' => array(255,255,128)
  20.     );
  21.  
  22. // Row 1 holding each record's X & Y coordinates
  23.  
  24. if ($r == 1) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '.58', '', 0.15, 0.015, $barstyle, '');}
  25. elseif ($r == 2) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '.58', '', 0.15, 0.015, $barstyle, '');}
  26. elseif ($r == 3) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '.58', '', 0.15, 0.015, $barstyle, '');}
  27.  
  28. // Row 2 holding each record's X & Y coordinates
  29.  
  30. elseif ($r == 4) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '1.58', '', 0.15, 0.015, $barstyle, '');}
  31. elseif ($r == 5) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '1.58', '', 0.15, 0.015, $barstyle, '');}
  32. elseif ($r == 6) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '1.58', '', 0.15, 0.015, $barstyle, '');}
  33.  
  34. // Row 3 holding each record's X & Y coordinates
  35.  
  36. elseif ($r == 7) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '2.58', '', 0.15, 0.015, $barstyle, '');}
  37. elseif ($r == 8) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '2.58', '', 0.15, 0.015, $barstyle, '');}
  38. elseif ($r == 9) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '2.58', '', 0.15, 0.015, $barstyle, '');}
  39.  
  40. // Row 4 holding each record's X & Y coordinates
  41.  
  42. elseif ($r == 10) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '3.58', '', 0.15, 0.015, $barstyle, '');}
  43. elseif ($r == 11) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '3.58', '', 0.15, 0.015, $barstyle, '');}
  44. elseif ($r == 12) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '3.58', '', 0.15, 0.015, $barstyle, '');}
  45.  
  46. // Row 5 holding each record's X & Y coordinates
  47.  
  48. elseif ($r == 13) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '4.58', '', 0.15, 0.015, $barstyle, '');}
  49. elseif ($r == 14) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '4.58', '', 0.15, 0.015, $barstyle, '');}
  50. elseif ($r == 15) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '4.58', '', 0.15, 0.015, $barstyle, '');}
  51.  
  52. // Row 6 holding each record's X & Y coordinates
  53.  
  54. elseif ($r == 16) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '5.58', '', 0.15, 0.015, $barstyle, '');}
  55. elseif ($r == 17) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '5.58', '', 0.15, 0.015, $barstyle, '');}
  56. elseif ($r == 18) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '5.58', '', 0.15, 0.015, $barstyle, '');}
  57.  
  58. // Row 7 holding each record's X & Y coordinates
  59.  
  60. elseif ($r == 19) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '6.58', '', 0.15, 0.015, $barstyle, '');}
  61. elseif ($r == 20) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '6.58', '', 0.15, 0.015, $barstyle, '');}
  62. elseif ($r == 21) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '6.58', '', 0.15, 0.015, $barstyle, '');}
  63.  
  64. // Row 8 holding each record's X & Y coordinates
  65.  
  66. elseif ($r == 22) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '7.58', '', 0.15, 0.015, $barstyle, '');}
  67. elseif ($r == 23) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '7.58', '', 0.15, 0.015, $barstyle, '');}
  68. elseif ($r == 24) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '7.58', '', 0.15, 0.015, $barstyle, '');}
  69.  
  70. // Row 9 holding each record's X & Y coordinates
  71.  
  72. elseif ($r == 25) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '8.58', '', 0.15, 0.015, $barstyle, '');}
  73. elseif ($r == 26) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '8.58', '', 0.15, 0.015, $barstyle, '');}
  74. elseif ($r == 27) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '8.58', '', 0.15, 0.015, $barstyle, '');}
  75.  
  76. // Row 10 holding each record's X & Y coordinates
  77.  
  78. elseif ($r == 28) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', .24, '9.58', '', 0.15, 0.015, $barstyle, '');}
  79. elseif ($r == 29) {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 3, '9.58', '', 0.15, 0.015, $barstyle, '');}
  80. else {$content=$view->pdf->write1DBarcode('01234567094987654321-'.str_replace("-","",$content), 'IMB', 5.75, '9.58', '', 0.15, 0.015, $barstyle2, '');}
  81. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement