<?php

        $companyCol = $this->endLine - 220;
        $titleCol = $this->leftMargin + 100;

        $start_row = $this->row = $this->pageHeight - $this->topMargin;

        $this->SetDrawColor(128, 128, 128);
        $this->Line($this->row + 5, 1);

        $this->NewLine();
        		
        $logo = company_path() . "/images/" . $this->company['coy_logo'];
	if ($this->company['coy_logo'] != '' && file_exists($logo))
	{
            $this->AddImage($logo, 295, $this->row - 30, 0, 43);
	}

        $this->fontSize += 4;
        $this->Font('bold');
        $this->Text($this->leftMargin, $this->title, $companyCol);
        $this->Text($companyCol, $this->company['coy_name']);
        $this->Font();
        $this->fontSize -= 4;
        $this->NewLine();
        
        $contact_nos = '';
        if (@$this->company['phone'])
        {
            $contact_nos = "(Phone) ".$this->company['phone'];       
        }

        if (@$this->company['fax'])
        {
            $contact_nos .= ", (Fax) ".$this->company['fax'];
        }
        $this->Text($companyCol, $contact_nos);
        $this->NewLine();
        
        $contact_info = '';
        if (@$this->company['email'])
        {
            $contact_info = $this->company['email'].", ";
        }

        $contact_info .= $this->company['website'];

        $this->Text($companyCol, $contact_info);
        

         $this->NewLine();
        
        $str = _("Page") . ' ' . $this->pageNumber;
        $this->Text($this->endLine - 38, $str);
        
        
                
        $this->row = $start_row - ($this->lineHeight);
        
        

         $this->NewLine();
        
             
        $str = _("Period") . ':';
        $this->Text($this->leftMargin, $str, $titleCol);
        $period_text = $this->params[0]['from']."     To ".$this->params[0]['to'];
        $this->Text($this->leftMargin + 80, $period_text);
        $this->NewLine();
        
        $str = $this->params[1]['text'] . ':';
        $this->Text($this->leftMargin, $str, $titleCol);
        $trans_type = $this->params[1]['trans_type'];
        $this->Text($this->leftMargin + 80, $trans_type);
        $this->NewLine();
          
        $str = _("Printed On") . ':';
        $this->Text($this->leftMargin, $str, $titleCol); 
        $this->Text($this->leftMargin + 80, Today() . '   ' . Now()); 
        $this->NewLine();
        
//        $this->NewLine();
        $str = _("Printed By") . ':';
        $this->Text($this->leftMargin, $str, $titleCol); 
        $this->Text($this->leftMargin + 80, $this->user);
//        if($this->row > 730)
//            $this->row = 730;            
//                     

        
        $this->Line($this->row - 5, 1);


  
//        if($this->row > 700)
//            $this->row = 700;
        
        $this->NewLine(1);
        $this->row = $this->row - 5;
        
        $this->Font('bold');
        if ($this->headers != null)
        {
                $count = count($this->headers);
                for ($i = 0; $i < $count; $i++){
                        $this->TextCol($i, $i + 1,	$this->headers[$i]);
                }
//                $this->NewLine();
        }
        $this->Font('');
        $this->Line($this->row - 5, 1);
        $this->NewLine(2);
        

        $this->Font();

        
        $this->Font();

	
?>
