<?php

    class MYPDF extends TCPDF {

        //Page header
        public function Header() {
            if(isset($_GET['pad'])){
                $this->Image('logo.png',165,10,0, 15, 'PNG', 'http://www.optimalbd.com');
            }
            //            $style = array('width' => 0.5, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'phase' => 0, 'color' => array(0,205,50));
        }
        // Page footer
        public function Footer() {

            if(isset($_GET['pad'])){
                // margini del footer
                $this->SetY(-15);
                // Set font
                $this->SetFont('helvetica', 'I', 8);
                // Page number
                $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'R', 0, '', 0, false, 'T', 'M');
                $st=260;
                $fs=7;
                $this->Line(5,$st,203,$st,array('dash'=>1));
                $this->CreateTextBox('Corporate Office :',-10,$st,80,10,6,'B');
                $this->CreateTextBox('House # 74 & 75, Block # c, Road #6, Banani, Dhaka-1213, Bangladesh, PABX: 8828377, 9883094, 8812244, 9891548, 8814559, 8817023, Fax: 880-2-8823691, P.O.Box: 9096, E-mail: info@ubsbd.com.bd, do@ubsbd.com.bd',8,$st,80,10,5);
                $st+=3;
                $this->CreateTextBox('IDB Bhaban Branch :',-10,$st,80,10,6,'B');
                $this->CreateTextBox('Phone: 9143770, Cell: 01755579779, E-mail: idb@ubsbd.com.bd,',11,$st,80,10,5);
                $this->CreateTextBox('Multiplan Branch :',63,$st,80,10,6,'B');
                $this->CreateTextBox('Phone: 880-2-9613917, Cell 01733-037349, E-mail: ubspc@ubsbd.com.bd',82,$st,80,10,5);
                $st+=3;
                $this->CreateTextBox('Uttara Branch :',-10,$st,80,10,6,'B');
                $this->CreateTextBox('Phone: 880-2-8951693, Cell: 01730-044408, E-mail: uttara@ubsbd.com.bd,',6,$st,80,10,5);
                $this->CreateTextBox('Stadium Branch-1 :',66,$st,80,10,6,'B');
                $this->CreateTextBox('Phone: 9564986, 9571319, Cell: 01711-549433, E-mail: ussstadium@yahoo.com',86,$st,80,10,5);
                $st+=3;
                $this->CreateTextBox('Stadium Branch-2 :',-10,$st,80,10,6,'B');
                $this->CreateTextBox('Phone: 9557008, Cell: 01730044417, E-mail: ussstadium@yahoo,',10,$st,80,10,5);
                $this->CreateTextBox('Chittagong Branch :',62,$st,80,10,6,'B');
                $this->CreateTextBox('Phone: 725540, 2517007, Fax: 880-31-725540, Mobile: 01730-044413, E-mail: ctg@ubsbd.com.bd',83,$st,80,10,5);
                $st+=3;
                $this->CreateTextBox('CCC Branch :',-10,$st,80,10,6,'B');
                $this->CreateTextBox('Phone: 031-2514245, Cell: 01755579778, E-mail: ccc@ubsbd.com.bd,',5,$st,80,10,5);
                $this->CreateTextBox('Sylhet Branch :',62,$st,80,10,6,'B');
                $this->CreateTextBox('Tel & fax: 821-710364, Cell: 01730044407, E-mail: syl@ubsbd.com.bd',78,$st,80,10,5);
                $st+=7;
                $this->SetTextColor(255,43,43); 
                $this->CreateTextBox('www.ubsbd.com.bd ',65,$st,0,10,10,'B');
            }
        }

        public function CreateTextBox($textval, $x = 0, $y, $width = 0, $height = 10, $fontsize = 8, $fontstyle = '', $align = 'L') {
            $this->SetXY($x+20, $y); // 20 = margin left
            $this->SetFont(PDF_FONT_NAME_MAIN, $fontstyle, $fontsize);
            $this->Cell($width, $height, $textval, 0, false, $align);
        }

    }
?>
