Headlines
Loading...
sourcode aplikasi CRUD dan PDF berbasis php dan mysqli

sourcode aplikasi CRUD dan PDF berbasis php dan mysqli

hay kawan seperti biasanya saya berbagi project sederhana mungkin buat pelajaran aja, atau kawan-kawan disini bisa ngembangi lagi agar lebih bagus,, yang penting ada kemaun ajasi

berikut script sederhana nya
  1. public function getBarcodeSVGcode($w=2, $h=30, $color='black') {
  2.         // replace table for special characters
  3.         $repstr = array("\0" => '', '&' => '&amp;', '<' => '&lt;', '>' => '&gt;');
  4.         $svg = '<'.'?'.'xml version="1.0" standalone="no"'.'?'.'>'."\n";
  5.         $svg .= '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'."\n";
  6.         $svg .= '<svg width="'.round(($this->barcode_array['maxw'] * $w), 3).'" height="'.$h.'" version="1.1" xmlns="http://www.w3.org/2000/svg">'."\n";
  7.         $svg .= "\t".'<desc>'.strtr($this->barcode_array['code'], $repstr).'</desc>'."\n";
  8.         $svg .= "\t".'<g id="bars" fill="'.$color.'" stroke="none">'."\n";
  9.         // print bars
  10.         $x = 0;
  11.         foreach ($this->barcode_array['bcode'] as $k => $v) {
  12.             $b= round(($v['w'] * $w), 3);
  13.             $b= round(($v['h'] * $h / $this->barcode_array['maxh']), 3);
  14.             if ($v['t']) {
  15.                 $y = round(($v['p'] * $h / $this->barcode_array['maxh']), 3);
  16.                 // draw a vertical bar
  17.                 $svg .= "\t\t".'<rect x="'.$x.'" y="'.$y.'" width="'.$bw.'" height="'.$bh.'" />'."\n";
  18.             }
  19.             $x += $bw;
  20.         }
  21.         $svg .= "\t".'</g>'."\n";
  22.         $svg .= '</svg>'."\n";
  23.         return $svg;
  24.     }
Demonya bisa dilihat


LINK 

0 Comments: