One Hat Cyber Team
Your IP :
216.73.216.240
Server IP :
162.240.106.28
Server :
Linux server.ganesand.com 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64
Server Software :
Apache
PHP Version :
7.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
thoa
/
public_html
/
fpdf
/
View File Name :
invoice2.php
<?php require('fpdf.php'); define('EURO', chr(128) ); define('EURO_VAL', 6.55957 ); class VariableStream { private $varname; private $position; function stream_open($path, $mode, $options, &$opened_path) { $url = parse_url($path); $this->varname = $url['host']; if(!isset($GLOBALS[$this->varname])) { trigger_error('Global variable '.$this->varname.' does not exist', E_USER_WARNING); return false; } $this->position = 0; return true; } function stream_read($count) { $ret = substr($GLOBALS[$this->varname], $this->position, $count); $this->position += strlen($ret); return $ret; } function stream_eof() { return $this->position >= strlen($GLOBALS[$this->varname]); } function stream_tell() { return $this->position; } function stream_seek($offset, $whence) { if($whence==SEEK_SET) { $this->position = $offset; return true; } return false; } function stream_stat() { return array(); } } // Xavier Nicolay 2004 // Version 1.02 ////////////////////////////////////// // Public functions // ////////////////////////////////////// // function sizeOfText( $texte, $larg ) // function addSociete( $nom, $adresse ) // function fact_dev( $libelle, $num ) // function addDevis( $numdev ) // function addFacture( $numfact ) // function addDate( $date ) // function addClient( $ref ) // function addPageNumber( $page ) // function addClientAdresse( $adresse ) // function addReglement( $mode ) // function addEcheance( $date ) // function addNumTVA($tva) // function addReference($ref) // function addCols( $tab ) // function addLineFormat( $tab ) // function lineVert( $tab ) // function addLine( $ligne, $tab ) // function addRemarque($remarque) // function addCadreTVAs() // function addCadreEurosFrancs() // function addTVAs( $params, $tab_tva, $invoice ) // function temporaire( $texte ) class PDF_Invoice extends FPDF { // private variables var $colonnes; var $format; var $angle=0; // private functions function RoundedRect($x, $y, $w, $h, $r, $style = '') { $k = $this->k; $hp = $this->h; if($style=='F') $op='f'; elseif($style=='FD' || $style=='DF') $op='B'; else $op='S'; $MyArc = 4/3 * (sqrt(2) - 1); $this->_out(sprintf('%.2F %.2F m',($x+$r)*$k,($hp-$y)*$k )); $xc = $x+$w-$r ; $yc = $y+$r; $this->_out(sprintf('%.2F %.2F l', $xc*$k,($hp-$y)*$k )); $this->_Arc($xc + $r*$MyArc, $yc - $r, $xc + $r, $yc - $r*$MyArc, $xc + $r, $yc); $xc = $x+$w-$r ; $yc = $y+$h-$r; $this->_out(sprintf('%.2F %.2F l',($x+$w)*$k,($hp-$yc)*$k)); $this->_Arc($xc + $r, $yc + $r*$MyArc, $xc + $r*$MyArc, $yc + $r, $xc, $yc + $r); $xc = $x+$r ; $yc = $y+$h-$r; $this->_out(sprintf('%.2F %.2F l',$xc*$k,($hp-($y+$h))*$k)); $this->_Arc($xc - $r*$MyArc, $yc + $r, $xc - $r, $yc + $r*$MyArc, $xc - $r, $yc); $xc = $x+$r ; $yc = $y+$r; $this->_out(sprintf('%.2F %.2F l',($x)*$k,($hp-$yc)*$k )); $this->_Arc($xc - $r, $yc - $r*$MyArc, $xc - $r*$MyArc, $yc - $r, $xc, $yc - $r); $this->_out($op); } function _Arc($x1, $y1, $x2, $y2, $x3, $y3) { $h = $this->h; $this->_out(sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $x1*$this->k, ($h-$y1)*$this->k, $x2*$this->k, ($h-$y2)*$this->k, $x3*$this->k, ($h-$y3)*$this->k)); } function Rotate($angle, $x=-1, $y=-1) { if($x==-1) $x=$this->x; if($y==-1) $y=$this->y; if($this->angle!=0) $this->_out('Q'); $this->angle=$angle; if($angle!=0) { $angle*=M_PI/180; $c=cos($angle); $s=sin($angle); $cx=$x*$this->k; $cy=($this->h-$y)*$this->k; $this->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm',$c,$s,-$s,$c,$cx,$cy,-$cx,-$cy)); } } function _endpage() { if($this->angle!=0) { $this->angle=0; $this->_out('Q'); } parent::_endpage(); } // public functions function sizeOfText( $texte, $largeur ) { $index = 0; $nb_lines = 0; $loop = TRUE; while ( $loop ) { $pos = strpos($texte, "\n"); if (!$pos) { $loop = FALSE; $ligne = $texte; } else { $ligne = substr( $texte, $index, $pos); $texte = substr( $texte, $pos+1 ); } $length = floor( $this->GetStringWidth( $ligne ) ); $res = 1 + floor( $length / $largeur) ; $nb_lines += $res; } return $nb_lines; } // Company function addSocietebill2( $nom ) { $x1 = 125; $y1 = 100; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','',20); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietebill1( $nom ) { $x1 = 192; $y1 = 80; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','',40); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietebill( $nom ) { $x1 = 140; $y1 = 50; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',70); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); $this->Rect(0, 0, 384, 30,'F','',$this->SetFillColor(255,255,0)); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietebillex( $nom ) { $x1 = 38; $y1 = 16; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',18); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); $this->Rect(0, 0, 100, 65,'F','',$this->SetFillColor(255,255,0)); /* $this->Rect(0, 0, 100, 12,'F','',$this->SetFillColor(255,255,0)); */ $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addzamwater( $nom ) { $x1 = 25; $y1 = 180; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',210); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); /* $this->Rect(0, 30, 100, 30,'F','',$this->SetFillColor(255,255,0)); */ /* $this->Rect(0, 0, 100, 12,'F','',$this->SetFillColor(255,255,0)); */ $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addzamwater3( $nom ) { $x1 = 25; $y1 = 180; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',185); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); /* $this->Rect(0, 30, 100, 30,'F','',$this->SetFillColor(255,255,0)); */ /* $this->Rect(0, 0, 100, 12,'F','',$this->SetFillColor(255,255,0)); */ $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addzamwater4( $nom ) { $x1 = 115; $y1 = 265; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',160); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); /* $this->Rect(0, 0, 100, 12,'F','',$this->SetFillColor(255,255,0)); */ $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addzamwater2( $nom ) { $x1 = 90; $y1 = 265; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',160); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); /* $this->Rect(0, 0, 100, 12,'F','',$this->SetFillColor(255,255,0)); */ $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addzamwater1( $nom ) { $x1 = 10; $y1 = 120; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',18); $this->SetTextColor(51, 202, 255); $length = $this->GetStringWidth( $nom ); /* $this->Rect(0, 0, 100, 12,'F','',$this->SetFillColor(255,255,0)); */ $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietemak( $nom ) { $x1 = 8; $y1 = 16; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',9); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); /* $this->Rect(0, 0, 100, 12,'F','',$this->SetFillColor(255,255,0)); */ $this->Cell( $length, 2, $nom); } function addSocietemaknam( $nom ) { $x1 = 8; $y1 = 21; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Rect(0, 0, 100, 12,'F','',$this->SetFillColor(255,255,0)); $this->Cell( $length, 2, $nom); } function addSocietemaknam1( $nom ) { $x1 = 38; $y1 = 21; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemaknam2( $nom ) { $x1 = 35; $y1 = 21; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemakadd( $nom ) { $x1 = 8; $y1 = 25; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemakadd1( $nom ) { $x1 = 38; $y1 = 24; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->MultiCell($length, 4, wordwrap($nom,35,"\n") ); } function addSocietemakadd2( $nom ) { $x1 = 35; $y1 = 25; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemakph( $nom ) { $x1 = 8; $y1 = 37; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',7); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemakph1( $nom ) { $x1 = 38; $y1 = 37; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemakph2( $nom ) { $x1 = 35; $y1 = 37; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemad( $nom ) { $x1 = 8; $y1 = 43; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',9); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemadnam( $nom ) { $x1 = 8; $y1 = 48; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemadnam1( $nom ) { $x1 = 38; $y1 = 48; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemadnam2( $nom ) { $x1 = 35; $y1 = 48; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemadadd( $nom ) { $x1 = 8; $y1 = 52; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemadadd1( $nom ) { $x1 = 38; $y1 = 51; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',7); $length = $this->GetStringWidth( $nom ); $this->MultiCell($length, 3, wordwrap($nom,45,"\n") ); } function addSocietemadadd2( $nom ) { $x1 = 35; $y1 = 52; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemadph( $nom ) { $x1 = 8; $y1 = 61; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',7); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemadph1( $nom ) { $x1 = 38; $y1 = 61; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemadph2( $nom ) { $x1 = 35; $y1 = 61; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteaz( $nom ) { $x1 = 8; $y1 = 67; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',9); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteaznam( $nom ) { $x1 = 8; $y1 = 72; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteaznam1( $nom ) { $x1 = 38; $y1 = 72; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteaznam2( $nom ) { $x1 = 35; $y1 = 72; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteazadd( $nom ) { $x1 = 8; $y1 = 76; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteazadd1( $nom ) { $x1 = 38; $y1 = 75; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',7); $length = $this->GetStringWidth( $nom ); $this->MultiCell($length, 3, wordwrap($nom,45,"\n") ); } function addSocieteazadd2( $nom ) { $x1 = 35; $y1 = 76; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteazph( $nom ) { $x1 = 8; $y1 = 85; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',7); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteazph1( $nom ) { $x1 = 38; $y1 = 85; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteazph2( $nom ) { $x1 = 35; $y1 = 85; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemu( $nom ) { $x1 = 8; $y1 = 91; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',9); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemunam( $nom ) { $x1 = 8; $y1 = 95; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemunam1( $nom ) { $x1 = 38; $y1 = 95; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemunam2( $nom ) { $x1 = 35; $y1 = 95; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemuadd( $nom ) { $x1 = 8; $y1 = 99; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemuadd1( $nom ) { $x1 = 38; $y1 = 98; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',7); $length = $this->GetStringWidth( $nom ); $this->MultiCell($length, 3, wordwrap($nom,45,"\n") ); } function addSocietemuadd2( $nom ) { $x1 = 35; $y1 = 98; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemuph( $nom ) { $x1 = 8; $y1 = 108; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',7); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemuph1( $nom ) { $x1 = 38; $y1 = 108; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemuph2( $nom ) { $x1 = 35; $y1 = 108; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteval( $nom ) { $x1 = 8; $y1 = 123; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',9); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteval1( $nom ) { $x1 = 8; $y1 = 127; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',9); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteauth( $nom ) { $x1 = 58; $y1 = 128; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',9); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteoff( $nom ) { $x1 = 8; $y1 = 134; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','',6); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteoff1( $nom ) { $x1 = 8; $y1 = 138; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','',6); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietename( $nom ) { $x1 = 10; $y1 = 80; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietename3( $nom ) { $x1 = 40; $y1 = 390; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',60); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietename1( $nom ) { $x1 = 42; $y1 = 78; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); if($length > 50) { $this->MultiCell($length, 6, wordwrap($nom,15,"\n") ); } else { $this->Cell( $length, 6, $nom); } } function addSocietename4( $nom ) { $length = $this->GetStringWidth( $nom ); if($length > 40) { $x1 = 180; $y1 = 378; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',60); $this->SetTextColor(14, 29, 164); $this->MultiCell(300, 30, wordwrap($nom,14,"\n") ); } else { $x1 = 180; $y1 = 390; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',60); $this->SetTextColor(14, 29, 164); $this->Cell( $length, 6, $nom); } } function addSocietepp( $nom ) { $x1 = 10; $y1 = 95; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietepp1( $nom ) { $x1 = 42; $y1 = 95; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietepp3( $nom ) { $x1 = 40; $y1 = 540; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',60); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietepp4( $nom ) { $x1 = 180; $y1 = 540; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',60); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietewap( $nom ) { $x1 = 40; $y1 = 480; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',60); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietewap1( $nom ) { $x1 = 180; $y1 = 480; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',60); $this->SetTextColor(14, 29, 164); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocieteap( $nom ) { $x1 = 10; $y1 = 103; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocieteap1( $nom ) { $x1 = 42; $y1 = 103; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietemak2( $nom ) { $x1 = 10; $y1 = 105; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietemak1( $nom ) { $x1 = 63; $y1 = 105; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocieteap3( $nom ) { $x1 = 40; $y1 = 600; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',60); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocieteap4( $nom ) { $x1 = 180; $y1 = 600; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',60); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocieteap5( $nom ) { $x1 = 40; $y1 = 600; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',70); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocieteap6( $nom ) { $x1 = 180; $y1 = 600; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',70); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocieteper( $nom ) { $x1 = 10; $y1 = 111; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteper1( $nom ) { $x1 = 42; $y1 = 111; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemad2( $nom ) { $x1 = 10; $y1 = 115; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietemad1( $nom ) { $x1 = 63; $y1 = 115; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteyr( $nom ) { $x1 = 10; $y1 = 127; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteyr1( $nom ) { $x1 = 42; $y1 = 127; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteazi( $nom ) { $x1 = 10; $y1 = 125; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocieteazi1( $nom ) { $x1 = 63; $y1 = 125; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSocietepack( $nom ) { $x1 = 38; $y1 = 860; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',50); $this->SetTextColor(50,205,50); $length = $this->GetStringWidth( $nom ); //Coordonnées de la société $lignes = $this->sizeOfText( $nom, $length) ; $this->Cell($length, 6, $nom); } function addSocietesau( $nom ) { $x1 = 40; $y1 = 900; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',32); $length = $this->GetStringWidth( $nom ); //Coordonnées de la société $lignes = $this->sizeOfText( $nom, $length) ; $this->Cell($length, 6, $nom); } function addSocietemail( $nom ) { $x1 = 7; $y1 = 144; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',6.5); $this->SetTextColor(14, 29, 164); $this->Rect(0, 146, 100, 15,'F','',$this->SetFillColor(255,255,0)); $length = $this->GetStringWidth( $nom ); //Coordonnées de la société $lignes = $this->sizeOfText( $nom, $length) ; $this->Cell($length, 6, $nom); } function addSocietemail1( $nom ) { $x1 = 80; $y1 = 940; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',60); $this->SetTextColor(14, 29, 164); $this->Rect(0, 930, 384, 60,'F','',$this->SetFillColor(255,255,0)); $length = $this->GetStringWidth( $nom ); //Coordonnées de la société $lignes = $this->sizeOfText( $nom, $length) ; $this->Cell($length, 6, $nom); } function CellFit($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $scale=false, $force=true) { //Get string width $str_width=$this->GetStringWidth($txt); //Calculate ratio to fit cell if($w==0) $w = $this->w-$this->rMargin-$this->x; $ratio = ($w-$this->cMargin*2)/$str_width; $fit = ($ratio < 1 || ($ratio > 1 && $force)); if ($fit) { if ($scale) { //Calculate horizontal scaling $horiz_scale=$ratio*100.0; //Set horizontal scaling $this->_out(sprintf('BT %.2F Tz ET',$horiz_scale)); } else { //Calculate character spacing in points $char_space=($w-$this->cMargin*2-$str_width)/max($this->MBGetStringLength($txt)-1,1)*$this->k; //Set character spacing $this->_out(sprintf('BT %.2F Tc ET',$char_space)); } //Override user alignment (since text will fill up cell) $align=''; } //Pass on to Cell method $this->Cell($w,$h,$txt,$border,$ln,$align,$fill,$link); //Reset character spacing/horizontal scaling if ($fit) $this->_out('BT '.($scale ? '100 Tz' : '0 Tc').' ET'); } function CellFitSpace($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='') { $this->CellFit($w,$h,$txt,$border,$ln,$align,$fill,$link,false,false); } function CellFitSpaceForce($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='') { //Same as calling CellFit directly $this->CellFit($w,$h,$txt,$border,$ln,$align,$fill,$link,false,true); } //Patch to also work with CJK double-byte text function MBGetStringLength($s) { if($this->CurrentFont['type']=='Type0') { $len = 0; $nbbytes = strlen($s); for ($i = 0; $i < $nbbytes; $i++) { if (ord($s[$i])<128) $len++; else { $len++; $i++; } } return $len; } else return strlen($s); } function addSocieteser( $nom ) { $x1 = 10; $y1 = 119; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','',12); $length = $this->GetStringWidth( $nom ); $this->Cell($length, 2, $nom);; } function addSocieteser1( $nom ) { $x1 = 36; $y1 = 119; $nom = ' : '.$nom; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',14); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); } function addSociete( $nom, $adresse ) { $x1 = 10; $y1 = 38; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',12); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSociete1( $nom, $adresse ) { $x1 = 110; $y1 = 38; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',10); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',9); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 5, wordwrap($adresse,50,"\n") ); } function addSocietesgst( $nom) { $x1 = 130; $y1 = 79; //Positionnement en bas $this->SetXY( $x1, $y1 ); /* $this->SetTextColor(29, 230, 62); */ $this->SetFont('Arial','',9); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1 + 30, $y1 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $this->Cell($length, 2, $adresse); } function addSocietesgst1( $nom) { $x1 = 17; $y1 = 140; //Positionnement en bas $this->SetXY( $x1, $y1 ); /* $this->SetTextColor(29, 230, 62); */ $this->SetFont('Arial','',9); $length = $this->GetStringWidth( $nom ); $this->MultiCell($length, 5, wordwrap($nom,120,"\n") ); /* $this->Cell( $length, 2, $nom); */ $this->SetXY( $x1 + 30, $y1 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $this->Cell($length, 2, $adresse); } /* function Header() { //Put the watermark $this->SetFont('Arial','B',50); $this->SetTextColor(203,203,203); $this->RotatedText(67,192,'Sha Haj Service',45); } */ function RotatedText($x, $y, $txt, $angle) { //Text rotated around its origin $this->Rotate($angle,$x,$y); $this->Text($x,$y,$txt); $this->Rotate(0); } function addSocietes1( $nom ) { $x1 = 10; $y1 = 253; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1 + 30, $y1 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $this->Cell($length, 2, $adresse); } function addSocietes2( $nom) { $x1 = 67; $y1 = 253; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1 + 30, $y1 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $this->Cell($length, 2, $adresse); } function addSocietes3( $nom) { $x1 = 114; $y1 = 253; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1 + 30, $y1 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $this->Cell($length, 2, $adresse); } function invno( $nom) { $x1 = 175; $y1 = 190; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','',8); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1 + 30, $y1 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $this->Cell($length, 2, $adresse); } function addSociete3( $nom, $adresse ) { $x1 = 10; $y1 = 180; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',12); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',9); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSociete4( $nom, $adresse ) { $x1 = 10; $y1 = 235; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',12); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',9); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addSocietesnew( $nom ) { $x1 = 10; $y1 = 268; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','',9); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1 + 30, $y1 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $this->Cell($length, 2, $adresse); } // Label and number of invoice/estimate function fact_dev( $libelle, $num ) { $r1 = $this->w - 80; $r2 = $r1 + 68; $y1 = 6; $y2 = $y1 + 2; $mid = ($r1 + $r2 ) / 2; $texte = $libelle . " EN " . EURO . " N° : " . $num; $szfont = 12; $loop = 0; while ( $loop == 0 ) { $this->SetFont( "Arial", "B", $szfont ); $sz = $this->GetStringWidth( $texte ); if ( ($r1+$sz) > $r2 ) $szfont --; else $loop ++; } $this->SetLineWidth(0.1); $this->SetFillColor(192); $this->RoundedRect($r1, $y1, ($r2 - $r1), $y2, 2.5, 'DF'); $this->SetXY( $r1+1, $y1+2); $this->Cell($r2-$r1 -1,5, $texte, 0, 0, "C" ); } // Estimate function addDevis( $numdev ) { $string = sprintf("DEV%04d",$numdev); $this->fact_dev( "Devis", $string ); } // Invoice function addFacture( $numfact ) { $string = sprintf("FA%04d",$numfact); $this->fact_dev( "Facture", $string ); } function addDate( $date ) { $r1 = $this->w - 77; $r2 = $r1 + 35; $y1 = 17; $y2 = $y1 ; $mid = $y1 + ($y2 / 2); $this->RoundedRect($r1, $y1, ($r2 - $r1), $y2, 3.5, 'D'); $this->Line( $r1, $mid, $r2, $mid); $this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1+3 ); $this->SetFont( "Arial", "B", 10); $this->Cell(10,5, "DATE / TIME", 0, 0, "C"); $this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1+9 ); $this->SetFont( "Arial", "", 10); $this->Cell(10,5,$date, 0,0, "C"); } function addDate1( $date ) { $r1 = $this->w - 77; $r2 = $r1 + 35; $y1 = 17; $y2 = $y1 ; $mid = $y1 + ($y2 / 2); $this->RoundedRect($r1, $y1, ($r2 - $r1), $y2, 3.5, 'D'); $this->Line( $r1, $mid, $r2, $mid); $this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1+3 ); $this->SetFont( "Arial", "B", 10); $this->Cell(10,5, "DATE", 0, 0, "C"); $this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1+9 ); $this->SetFont( "Arial", "", 10); $this->Cell(10,5,$date, 0,0, "C"); } function addtitle( $nom ) { $x1 = 90; $y1 = 10; //Positionnement en bas $this->SetXY( $x1, $y1 ); $this->SetFont('Arial','B',18); $length = $this->GetStringWidth( $nom ); $this->Cell( $length, 2, $nom); $this->SetXY( $x1, $y1 + 4 ); $this->SetFont('Arial','',10); $length = $this->GetStringWidth( $adresse ); //Coordonnées de la société $lignes = $this->sizeOfText( $adresse, $length) ; $this->MultiCell($length, 4, $adresse); } function addClient1( $ref ) { $r1 = $this->w - 38; $r2 = $r1 + 28; $y1 = 17; $y2 = $y1; $mid = $y1 + ($y2 / 2); $this->RoundedRect($r1, $y1, ($r2 - $r1), $y2, 3.5, 'D'); $this->Line( $r1, $mid, $r2, $mid); $this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1+3 ); $this->SetFont( "Arial", "B", 10); $this->Cell(10,5, "INVOICE NO", 0, 0, "C"); $this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1 + 9 ); $this->SetFont( "Arial", "", 10); $this->Cell(10,5,$ref, 0,0, "C"); } function addClient( $ref ) { $r1 = $this->w - 38; $r2 = $r1 + 28; $y1 = 17; $y2 = $y1; $mid = $y1 + ($y2 / 2); $this->RoundedRect($r1, $y1, ($r2 - $r1), $y2, 3.5, 'D'); $this->Line( $r1, $mid, $r2, $mid); $this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1+3 ); $this->SetFont( "Arial", "B", 10); $this->Cell(10,5, "APP. NO", 0, 0, "C"); $this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1 + 9 ); $this->SetFont( "Arial", "", 10); $this->Cell(10,5,$ref, 0,0, "C"); } function addref( $refno ) { $r1 = $this->w - 123; $r2 = $r1 + 42; $y1 = 17; $y2 = $y1; $mid = $y1 + ($y2 / 2); $this->RoundedRect($r1, $y1, ($r2 - $r1), $y2, 3.5, 'D'); $this->Line( $r1, $mid, $r2, $mid); $this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1+3 ); $this->SetFont( "Arial", "B", 10); $this->Cell(10,5, "TAX INVOICE / RECEIPT", 0, 0, "C"); $this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1 + 9 ); $this->SetFont( "Arial", "", 10); $this->Cell(10,5,$refno, 0,0, "C"); } function addPageNumber( $page ) { $r1 = $this->w - 80; $r2 = $r1 + 19; $y1 = 17; $y2 = $y1; $mid = $y1 + ($y2 / 2); $this->RoundedRect($r1, $y1, ($r2 - $r1), $y2, 3.5, 'D'); $this->Line( $r1, $mid, $r2, $mid); $this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1+3 ); $this->SetFont( "Arial", "B", 10); $this->Cell(10,5, "PAGE", 0, 0, "C"); $this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1 + 9 ); $this->SetFont( "Arial", "", 10); $this->Cell(10,5,$page, 0,0, "C"); } // Client address function addClientAdresse( $adresse ) { $r1 = $this->w - 80; $r2 = $r1 + 68; $y1 = 40; $this->SetFont('Arial','B',10); $this->SetXY( $r1, $y1); $this->MultiCell( 60, 4, $adresse); } // Mode of payment function addReglement( $mode ) { $r1 = 10; $r2 = $r1 + 60; $y1 = 80; $y2 = $y1+10; $mid = $y1 + (($y2-$y1) / 2); $this->RoundedRect($r1, $y1, ($r2 - $r1), ($y2-$y1), 2.5, 'D'); $this->Line( $r1, $mid, $r2, $mid); $this->SetXY( $r1 + ($r2-$r1)/2 -5 , $y1+1 ); $this->SetFont( "Arial", "B", 10); $this->Cell(10,4, "Preferred Payment Method", 0, 0, "C"); $this->SetXY( $r1 + ($r2-$r1)/2 -5 , $y1 + 5 ); $this->SetFont( "Arial", "", 10); $this->Cell(10,5,$mode, 0,0, "C"); } // Expiry date function addEcheance( $date ) { $r1 = 80; $r2 = $r1 + 40; $y1 = 80; $y2 = $y1+10; $mid = $y1 + (($y2-$y1) / 2); $this->RoundedRect($r1, $y1, ($r2 - $r1), ($y2-$y1), 2.5, 'D'); $this->Line( $r1, $mid, $r2, $mid); $this->SetXY( $r1 + ($r2 - $r1)/2 - 5 , $y1+1 ); $this->SetFont( "Arial", "B", 10); $this->Cell(10,4, "Bank Name", 0, 0, "C"); $this->SetXY( $r1 + ($r2-$r1)/2 - 5 , $y1 + 5 ); $this->SetFont( "Arial", "", 10); $this->Cell(10,5,$date, 0,0, "C"); } function addEcheance1( $date1 ) { $r1 = 80; $r2 = $r1 + 40; $y1 = 80; $y2 = $y1+10; $mid = $y1 + (($y2-$y1) / 2); $this->RoundedRect($r1, $y1, ($r2 - $r1), ($y2-$y1), 2.5, 'D'); $this->Line( $r1, $mid, $r2, $mid); $this->SetXY( $r1 + ($r2 - $r1)/2 - 5 , $y1+1 ); $this->SetFont( "Arial", "B", 10); $this->Cell(10,4, "Date", 0, 0, "C"); $this->SetXY( $r1 + ($r2-$r1)/2 - 5 , $y1 + 5 ); $this->SetFont( "Arial", "", 10); $this->Cell(10,5,$date, 0,0, "C"); } // VAT number function addNumTVA($tva) { $this->SetFont( "Arial", "B", 10); $r1 = $this->w - 80; $r2 = $r1 + 70; $y1 = 80; $y2 = $y1+10; $mid = $y1 + (($y2-$y1) / 2); $this->RoundedRect($r1, $y1, ($r2 - $r1), ($y2-$y1), 2.5, 'D'); $this->Line( $r1, $mid, $r2, $mid); $this->SetXY( $r1 + 16 , $y1+1 ); $this->Cell(60, 4, "Number", '', '', "C"); $this->SetFont( "Arial", "", 10); $this->SetXY( $r1 + 16 , $y1+5 ); $this->Cell(60, 5, $tva, '', '', "C"); } function addReference($ref) { $this->SetFont( "Arial", "", 10); $length = $this->GetStringWidth( "Références : " . $ref ); $r1 = 10; $r2 = $r1 + $length; $y1 = 92; $y2 = $y1+5; $this->SetXY( $r1 , $y1 ); $this->Cell($length,4, "Références : " . $ref); } function addCols( $tab ) { global $colonnes; $r1 = 10; $r2 = $this->w - ($r1 * 2) ; $y1 = 150; $y2 = $this->h - 130 - $y1; $this->SetLineWidth(0.1); $this->SetXY( $r1, $y1 ); $this->Rect( $r1, $y1, $r2, $y2, "D"); $this->Line( $r1, $y1+6, $r1+$r2, $y1+6); $colX = $r1; $colonnes = $tab; while ( list( $lib, $pos ) = each ($tab) ) { $this->SetXY( $colX, $y1+2 ); $this->Cell( $pos, 1, $lib, 0, 0, "C"); $colX += $pos; $this->Line( $colX, $y1, $colX, $y1+$y2); } } function addCols1( $tab ) { global $colonnes; $r1 = 10; $r2 = $this->w - ($r1 * 2) ; $y1 = 85; $y2 = $this->h - 160 - $y1; $this->SetLineWidth(0.1); $this->SetXY( $r1, $y1 ); $this->Rect( $r1, $y1, $r2, $y2, "D"); $this->Line( $r1, $y1+6, $r1+$r2, $y1+6); $colX = $r1; $colonnes = $tab; while ( list( $lib, $pos ) = each ($tab) ) { $this->SetXY( $colX, $y1+2 ); $this->Cell( $pos, 1, $lib, 0, 0, "C"); $colX += $pos; $this->Line( $colX, $y1, $colX, $y1+$y2); } } function addLineFormat( $tab ) { global $format, $colonnes; while ( list( $lib, $pos ) = each ($colonnes) ) { if ( isset( $tab["$lib"] ) ) $format[ $lib ] = $tab["$lib"]; } } function lineVert( $tab ) { global $colonnes; reset( $colonnes ); $maxSize=0; while ( list( $lib, $pos ) = each ($colonnes) ) { $texte = $tab[ $lib ]; $longCell = $pos -2; $size = $this->sizeOfText( $texte, $longCell ); if ($size > $maxSize) $maxSize = $size; } return $maxSize; } // add a line to the invoice/estimate /* $ligne = array( "REFERENCE" => $prod["ref"], "DESIGNATION" => $libelle, "QUANTITE" => sprintf( "%.2F", $prod["qte"]) , "P.U. HT" => sprintf( "%.2F", $prod["px_unit"]), "MONTANT H.T." => sprintf ( "%.2F", $prod["qte"] * $prod["px_unit"]) , "TVA" => $prod["tva"] ); */ function addLine( $ligne, $tab ) { global $colonnes, $format; $ordonnee = 10; $maxSize = $ligne; reset( $colonnes ); while ( list( $lib, $pos ) = each ($colonnes) ) { $longCell = $pos -2; $texte = $tab[ $lib ]; $length = $this->GetStringWidth( $texte ); $tailleTexte = $this->sizeOfText( $texte, $length ); $formText = $format[ $lib ]; $this->SetXY( $ordonnee, $ligne-1); $this->MultiCell( $longCell, 4 , $texte, 0, $formText); if ( $maxSize < ($this->GetY() ) ) $maxSize = $this->GetY() ; $ordonnee += $pos; } return ( $maxSize - $ligne ); } function addRemarque($remarque) { $this->SetFont( "Arial", "", 10); $length = $this->GetStringWidth( "Remarque : " . $remarque ); $r1 = 10; $r2 = $r1 + $length; $y1 = $this->h - 45.5; $y2 = $y1+5; $this->SetXY( $r1 , $y1 ); $this->Cell($length,4, "Remarque : " . $remarque); } function addCadreTVAs() { $this->SetFont( "Arial", "B", 8); $r1 = 10; $r2 = $r1 + 120; $y1 = $this->h - 40; $y2 = $y1+20; $this->RoundedRect($r1, $y1, ($r2 - $r1), ($y2-$y1), 2.5, 'D'); $this->Line( $r1, $y1+4, $r2, $y1+4); $this->Line( $r1+5, $y1+4, $r1+5, $y2); // avant BASES HT $this->Line( $r1+27, $y1, $r1+27, $y2); // avant REMISE $this->Line( $r1+43, $y1, $r1+43, $y2); // avant MT TVA $this->Line( $r1+63, $y1, $r1+63, $y2); // avant % TVA $this->Line( $r1+75, $y1, $r1+75, $y2); // avant PORT $this->Line( $r1+91, $y1, $r1+91, $y2); // avant TOTAUX $this->SetXY( $r1+9, $y1); $this->Cell(10,4, "BASES HT"); $this->SetX( $r1+29 ); $this->Cell(10,4, "REMISE"); $this->SetX( $r1+48 ); $this->Cell(10,4, "MT TVA"); $this->SetX( $r1+63 ); $this->Cell(10,4, "% TVA"); $this->SetX( $r1+78 ); $this->Cell(10,4, "PORT"); $this->SetX( $r1+100 ); $this->Cell(10,4, "TOTAUX"); $this->SetFont( "Arial", "B", 6); $this->SetXY( $r1+93, $y2 - 8 ); $this->Cell(6,0, "H.T. :"); $this->SetXY( $r1+93, $y2 - 3 ); $this->Cell(6,0, "T.V.A. :"); } function addCadreEurosFrancs() { $r1 = $this->w - 70; $r2 = $r1 + 60; $y1 = $this->h - 40; $y2 = $y1+20; $this->RoundedRect($r1, $y1, ($r2 - $r1), ($y2-$y1), 2.5, 'D'); $this->Line( $r1+20, $y1, $r1+20, $y2); // avant EUROS $this->Line( $r1+20, $y1+4, $r2, $y1+4); // Sous Euros & Francs $this->Line( $r1+38, $y1, $r1+38, $y2); // Entre Euros & Francs $this->SetFont( "Arial", "B", 8); $this->SetXY( $r1+22, $y1 ); $this->Cell(15,4, "EUROS", 0, 0, "C"); $this->SetFont( "Arial", "", 8); $this->SetXY( $r1+42, $y1 ); $this->Cell(15,4, "FRANCS", 0, 0, "C"); $this->SetFont( "Arial", "B", 6); $this->SetXY( $r1, $y1+5 ); $this->Cell(20,4, "TOTAL TTC", 0, 0, "C"); $this->SetXY( $r1, $y1+10 ); $this->Cell(20,4, "ACOMPTE", 0, 0, "C"); $this->SetXY( $r1, $y1+15 ); $this->Cell(20,4, "NET A PAYER", 0, 0, "C"); } // remplit les cadres TVA / Totaux et la remarque // params = array( "RemiseGlobale" => [0|1], // "remise_tva" => [1|2...], // {la remise s'applique sur ce code TVA} // "remise" => value, // {montant de la remise} // "remise_percent" => percent, // {pourcentage de remise sur ce montant de TVA} // "FraisPort" => [0|1], // "portTTC" => value, // montant des frais de ports TTC // // par defaut la TVA = 19.6 % // "portHT" => value, // montant des frais de ports HT // "portTVA" => tva_value, // valeur de la TVA a appliquer sur le montant HT // "AccompteExige" => [0|1], // "accompte" => value // montant de l'acompte (TTC) // "accompte_percent" => percent // pourcentage d'acompte (TTC) // "Remarque" => "texte" // texte // tab_tva = array( "1" => 19.6, // "2" => 5.5, ... ); // invoice = array( "px_unit" => value, // "qte" => qte, // "tva" => code_tva ); function addTVAs( $params, $tab_tva, $invoice ) { $this->SetFont('Arial','',8); reset ($invoice); $px = array(); while ( list( $k, $prod) = each( $invoice ) ) { $tva = $prod["tva"]; @ $px[$tva] += $prod["qte"] * $prod["px_unit"]; } $prix = array(); $totalHT = 0; $totalTTC = 0; $totalTVA = 0; $y = 261; reset ($px); natsort( $px ); while ( list($code_tva, $articleHT) = each( $px ) ) { $tva = $tab_tva[$code_tva]; $this->SetXY(17, $y); $this->Cell( 19,4, sprintf("%0.2F", $articleHT),'', '','R' ); if ( $params["RemiseGlobale"]==1 ) { if ( $params["remise_tva"] == $code_tva ) { $this->SetXY( 37.5, $y ); if ($params["remise"] > 0 ) { if ( is_int( $params["remise"] ) ) $l_remise = $param["remise"]; else $l_remise = sprintf ("%0.2F", $params["remise"]); $this->Cell( 14.5,4, $l_remise, '', '', 'R' ); $articleHT -= $params["remise"]; } else if ( $params["remise_percent"] > 0 ) { $rp = $params["remise_percent"]; if ( $rp > 1 ) $rp /= 100; $rabais = $articleHT * $rp; $articleHT -= $rabais; if ( is_int($rabais) ) $l_remise = $rabais; else $l_remise = sprintf ("%0.2F", $rabais); $this->Cell( 14.5,4, $l_remise, '', '', 'R' ); } else $this->Cell( 14.5,4, "ErrorRem", '', '', 'R' ); } } $totalHT += $articleHT; $totalTTC += $articleHT * ( 1 + $tva/100 ); $tmp_tva = $articleHT * $tva/100; $a_tva[ $code_tva ] = $tmp_tva; $totalTVA += $tmp_tva; $this->SetXY(11, $y); $this->Cell( 5,4, $code_tva); $this->SetXY(53, $y); $this->Cell( 19,4, sprintf("%0.2F",$tmp_tva),'', '' ,'R'); $this->SetXY(74, $y); $this->Cell( 10,4, sprintf("%0.2F",$tva) ,'', '', 'R'); $y+=4; } if ( $params["FraisPort"] == 1 ) { if ( $params["portTTC"] > 0 ) { $pTTC = sprintf("%0.2F", $params["portTTC"]); $pHT = sprintf("%0.2F", $pTTC / 1.196); $pTVA = sprintf("%0.2F", $pHT * 0.196); $this->SetFont('Arial','',6); $this->SetXY(85, 261 ); $this->Cell( 6 ,4, "HT : ", '', '', ''); $this->SetXY(92, 261 ); $this->Cell( 9 ,4, $pHT, '', '', 'R'); $this->SetXY(85, 265 ); $this->Cell( 6 ,4, "TVA : ", '', '', ''); $this->SetXY(92, 265 ); $this->Cell( 9 ,4, $pTVA, '', '', 'R'); $this->SetXY(85, 269 ); $this->Cell( 6 ,4, "TTC : ", '', '', ''); $this->SetXY(92, 269 ); $this->Cell( 9 ,4, $pTTC, '', '', 'R'); $this->SetFont('Arial','',8); $totalHT += $pHT; $totalTVA += $pTVA; $totalTTC += $pTTC; } else if ( $params["portHT"] > 0 ) { $pHT = sprintf("%0.2F", $params["portHT"]); $pTVA = sprintf("%0.2F", $params["portTVA"] * $pHT / 100 ); $pTTC = sprintf("%0.2F", $pHT + $pTVA); $this->SetFont('Arial','',6); $this->SetXY(85, 261 ); $this->Cell( 6 ,4, "HT : ", '', '', ''); $this->SetXY(92, 261 ); $this->Cell( 9 ,4, $pHT, '', '', 'R'); $this->SetXY(85, 265 ); $this->Cell( 6 ,4, "TVA : ", '', '', ''); $this->SetXY(92, 265 ); $this->Cell( 9 ,4, $pTVA, '', '', 'R'); $this->SetXY(85, 269 ); $this->Cell( 6 ,4, "TTC : ", '', '', ''); $this->SetXY(92, 269 ); $this->Cell( 9 ,4, $pTTC, '', '', 'R'); $this->SetFont('Arial','',8); $totalHT += $pHT; $totalTVA += $pTVA; $totalTTC += $pTTC; } } $this->SetXY(114,266.4); $this->Cell(15,4, sprintf("%0.2F", $totalHT), '', '', 'R' ); $this->SetXY(114,271.4); $this->Cell(15,4, sprintf("%0.2F", $totalTVA), '', '', 'R' ); $params["totalHT"] = $totalHT; $params["TVA"] = $totalTVA; $accompteTTC=0; if ( $params["AccompteExige"] == 1 ) { if ( $params["accompte"] > 0 ) { $accompteTTC=sprintf ("%.2F", $params["accompte"]); if ( strlen ($params["Remarque"]) == 0 ) $this->addRemarque( "Accompte de $accompteTTC Euros exigé à la commande."); else $this->addRemarque( $params["Remarque"] ); } else if ( $params["accompte_percent"] > 0 ) { $percent = $params["accompte_percent"]; if ( $percent > 1 ) $percent /= 100; $accompteTTC=sprintf("%.2F", $totalTTC * $percent); $percent100 = $percent * 100; if ( strlen ($params["Remarque"]) == 0 ) $this->addRemarque( "Accompte de $percent100 % (soit $accompteTTC Euros) exigé à la commande." ); else $this->addRemarque( $params["Remarque"] ); } else $this->addRemarque( "Drôle d'acompte !!! " . $params["Remarque"]); } else { if ( strlen ($params["Remarque"]) > 0 ) $this->addRemarque( $params["Remarque"] ); } $re = $this->w - 50; $rf = $this->w - 29; $y1 = $this->h - 40; $this->SetFont( "Arial", "", 8); $this->SetXY( $re, $y1+5 ); $this->Cell( 17,4, sprintf("%0.2F", $totalTTC), '', '', 'R'); $this->SetXY( $re, $y1+10 ); $this->Cell( 17,4, sprintf("%0.2F", $accompteTTC), '', '', 'R'); $this->SetXY( $re, $y1+14.8 ); $this->Cell( 17,4, sprintf("%0.2F", $totalTTC - $accompteTTC), '', '', 'R'); $this->SetXY( $rf, $y1+5 ); $this->Cell( 17,4, sprintf("%0.2F", $totalTTC * EURO_VAL), '', '', 'R'); $this->SetXY( $rf, $y1+10 ); $this->Cell( 17,4, sprintf("%0.2F", $accompteTTC * EURO_VAL), '', '', 'R'); $this->SetXY( $rf, $y1+14.8 ); $this->Cell( 17,4, sprintf("%0.2F", ($totalTTC - $accompteTTC) * EURO_VAL), '', '', 'R'); } // add a watermark (temporary estimate, DUPLICATA...) // call this method first function temporaire( $texte ) { $this->SetFont('Arial','B',50); $this->SetTextColor(203,203,203); $this->Rotate(45,55,190); $this->Text(55,190,$texte); $this->Rotate(0); $this->SetTextColor(0,0,0); } function __construct($orientation='P', $unit='mm', $format='A4') { parent::__construct($orientation, $unit, $format); // Register var stream protocol stream_wrapper_register('var', 'VariableStream'); } function MemImage($data, $x=null, $y=null, $w=0, $h=0, $link='') { // Display the image contained in $data $v = 'img'.md5($data); $GLOBALS[$v] = $data; $a = getimagesize('var://'.$v); if(!$a) $this->Error('Invalid image data'); $type = substr(strstr($a['mime'],'/'),1); $this->SetLineWidth( 1 ); $this->Image('var://'.$v, $x, $y, $w, $h, $type, $link, '', false, 300, '', false, false, 1, false, false, false); unset($GLOBALS[$v]); } function GDImage($im, $x=null, $y=null, $w=0, $h=0, $link='') { // Display the GD image associated with $im ob_start(); imagepng($im); $data = ob_get_clean(); $this->MemImage($data, $x, $y, $w, $h, $link); } function Code39($xpos, $ypos, $code, $baseline=0.5, $height=5){ $wide = $baseline; $narrow = $baseline / 3 ; $gap = $narrow; $barChar['0'] = 'nnnwwnwnn'; $barChar['1'] = 'wnnwnnnnw'; $barChar['2'] = 'nnwwnnnnw'; $barChar['3'] = 'wnwwnnnnn'; $barChar['4'] = 'nnnwwnnnw'; $barChar['5'] = 'wnnwwnnnn'; $barChar['6'] = 'nnwwwnnnn'; $barChar['7'] = 'nnnwnnwnw'; $barChar['8'] = 'wnnwnnwnn'; $barChar['9'] = 'nnwwnnwnn'; $barChar['A'] = 'wnnnnwnnw'; $barChar['B'] = 'nnwnnwnnw'; $barChar['C'] = 'wnwnnwnnn'; $barChar['D'] = 'nnnnwwnnw'; $barChar['E'] = 'wnnnwwnnn'; $barChar['F'] = 'nnwnwwnnn'; $barChar['G'] = 'nnnnnwwnw'; $barChar['H'] = 'wnnnnwwnn'; $barChar['I'] = 'nnwnnwwnn'; $barChar['J'] = 'nnnnwwwnn'; $barChar['K'] = 'wnnnnnnww'; $barChar['L'] = 'nnwnnnnww'; $barChar['M'] = 'wnwnnnnwn'; $barChar['N'] = 'nnnnwnnww'; $barChar['O'] = 'wnnnwnnwn'; $barChar['P'] = 'nnwnwnnwn'; $barChar['Q'] = 'nnnnnnwww'; $barChar['R'] = 'wnnnnnwwn'; $barChar['S'] = 'nnwnnnwwn'; $barChar['T'] = 'nnnnwnwwn'; $barChar['U'] = 'wwnnnnnnw'; $barChar['V'] = 'nwwnnnnnw'; $barChar['W'] = 'wwwnnnnnn'; $barChar['X'] = 'nwnnwnnnw'; $barChar['Y'] = 'wwnnwnnnn'; $barChar['Z'] = 'nwwnwnnnn'; $barChar['-'] = 'nwnnnnwnw'; $barChar['.'] = 'wwnnnnwnn'; $barChar[' '] = 'nwwnnnwnn'; $barChar['*'] = 'nwnnwnwnn'; $barChar['$'] = 'nwnwnwnnn'; $barChar['/'] = 'nwnwnnnwn'; $barChar['+'] = 'nwnnnwnwn'; $barChar['%'] = 'nnnwnwnwn'; $this->SetFont('Arial','',10); $this->Text($xpos, $ypos + $height + 4, $code); $this->SetFillColor(0); $code = '*'.strtoupper($code).'*'; for($i=0; $i<strlen($code); $i++){ $char = $code[$i]; if(!isset($barChar[$char])){ $this->Error('Invalid character in barcode: '.$char); } $seq = $barChar[$char]; for($bar=0; $bar<9; $bar++){ if($seq[$bar] == 'n'){ $lineWidth = $narrow; }else{ $lineWidth = $wide; } if($bar % 2 == 0){ $this->Rect($xpos, $ypos, $lineWidth, $height, 'F'); } $xpos += $lineWidth; } $xpos += $gap; } } function bar($code) { $this->SetFont('Arial','',10); $this->Code39(40,17,"$code",1,10); $this->SetXY(10,1); $this->Cell(5,'A set: "'.$code.'"'); } function bar1($code) { $this->SetFont('Arial','',10); $this->Rotate(90,79,74); $this->Code39(79,74,"$code",1,10); $this->Rotate(0); $this->SetXY(1,10); $this->Cell(5,'A set: "'.$code.'"'); } } ?>