<?php

if($this->pageNumber > 0)
{
        $companyCol = $this->endLine - 170;
        $titleCol = $this->leftMargin + 100;

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

        $this->SetDrawColor(128, 128, 128);
        
        $this->Font('bold');
        $this->NewLine();
        $str = _("Page") . ' ' . $this->pageNumber;
        $this->Text($this->endLine - 30, $str);
        
//        $this->NewLine();
        $this->fontSize += 4; 
        $this->Text($this->leftMargin + 350, "EMPLOYEES' TRUST FUND BOARD");
        $this->fontSize -= 4; 
        $this->NewLine(6);
        $this->Text($this->leftMargin + 475, 'TOTAL GROSS WAGES AND CONTRIBUTION');
        $this->NewLine(2);
                     $current_lvl = $this->row;   
                    $this->TextWrapLines(210, 240,	$this->params[0],'center');
                    $this->row =$current_lvl;
                     $this->TextWrapLines(270, 355,	$this->params[1],'center');
                     $this->row =$current_lvl;
                     $this->TextWrapLines(360, 410,	$this->params[2],'center');
                     $this->row =$current_lvl;
                     $this->TextWrapLines(430, 500,	$this->params[3],'center');
                     $this->row =$current_lvl;
                     $this->TextWrapLines(510, 580,	$this->params[4],'center');
                     $this->row =$current_lvl;
                     $this->TextWrapLines(550, 750,	$this->params[5],'center');
                   
                
//        $b1x1 = $this->leftMargin;
//        $b1x2 = $this->leftMargin + 200;
//        $b1y1 = $this->row;
//        $b1y2 = $this->row - 100;
//        
//        $this->SetLineWidth(2);
//        $this->LineTo($b1x1, $b1y1, $b1x2, $b1y1);
//        $this->LineTo($b1x2, $b1y1, $b1x2, $b1y2);
//        $this->LineTo($b1x1, $b1y2, $b1x2, $b1y2);
//        $this->LineTo($b1x1, $b1y1, $b1x1, $b1y2);
//        
//        $b2x1 = $this->leftMargin + 270;
//        $b2x2 = $this->leftMargin + 500;
//        $b2y1 = $this->row;
//        $b2y2 = $this->row - 15;
//        
//        $this->SetLineWidth(2);
//        $this->LineTo($b2x1, $b2y1, $b2x2, $b2y1);
//        $this->LineTo($b2x2, $b2y1, $b2x2, $b2y2);
//        $this->LineTo($b2x1, $b2y2, $b2x2, $b2y2);
//        $this->LineTo($b2x1, $b2y1, $b2x1, $b2y2);
        
        $this->SetLineWidth(0);
        
        $this->NewLine();
        
        

//        $this->Text($this->leftMargin+5, $this->company['coy_name']);
//        $this->NewLine();
//        $this->TextWrapLines($this->rightMargin+15, $this->rightMargin + 200, $this->company['postal_address']);
//        
//        $this->row = $this->row - 1 * $this->lineHeight;
//
//        $contact_nos = '';
//        if (@$this->company['phone'])
//        {
//            $contact_nos = "Telephone: ".$this->company['phone'];       
//        }
//
//        $this->Text($this->leftMargin+5, $contact_nos);
        $this->NewLine();
        
        
        //2nd column
//        $col2_text_start = $b2x1 + 10;
        $col3_text_start = 30;
        $this->row = $start_row - 2 * $this->lineHeight;
        $this->NewLine();
        $this->fontSize += 3; 
        $this->Text($col3_text_start, "FORM II RETURN");
        $this->fontSize -= 3; 
        $this->NewLine(2);
        $this->NewLine(2);
        
//        $this->Text($col2_text_start, "E.P.F. Reg No:");
//        $this->Text($col3_text_start, $this->params['epf_reg_no']);
//        $this->NewLine();
//        $this->Text($col2_text_start, "Contributions for the Month:");
//        $this->Text($col3_text_start, $this->params['month']);
//        $this->NewLine();
//        $this->Text($col2_text_start, "Contributions:");
//        $this->Text($col3_text_start, $this->params['total_contribution']);
//        $this->NewLine();
//        $this->Text($col2_text_start, "Surcharges:");
//        $this->Text($col3_text_start, $this->params['surcharges']);
//        $this->NewLine();
//        $this->Text($col2_text_start, "Total Remittance:");
//        $this->Text($col3_text_start, $this->params['total_remitance']);
//        $this->NewLine();
//        $this->Text($col2_text_start, "Cheque No:");
//        $this->row = $this->row -3;
//        $this->Text($col3_text_start, $this->params['cheque_no']);
//        $this->row = $this->row +3;
//        $this->NewLine();
//        $this->Text($col2_text_start, "Bank & Branch:");
//        $this->Text($col3_text_start, $this->params['epf_payment_bank']);

  
        if($this->row > 638)
            $this->row = 638;
        
        $h0 = $this->cols[0]-5;
        $h1 = $this->cols[1]-5;
        $h2 = $this->cols[2]-5;
        $h3 = $this->cols[3]-5;
        $h4 = $this->cols[4]+5;
        $h5 = $this->cols[5]+5;
        $h6 = $this->cols[6]+5;
        $h7 = $this->cols[7]+5;
        $h8 = $this->cols[8]+5;
        $h9 = $this->cols[9]+5;
        $h10 = $this->cols[10]+5;
        $h11 = $this->cols[11]+5;
        $h12 = $this->cols[12]+5;
        $h13 = $this->cols[13]+5;
        $h14 = $this->cols[14]+5;
        $h15 = $this->cols[15]+5;
        $h16 = $this->cols[16]+5;

        
        $v1 = $this->row + $this->lineHeight * 1;
        //$v2 = $this->row - $this->lineHeight - 2;
        $v3 = $this->row - $this->lineHeight * 7;
        
        $v4 = $this->row - $this->lineHeight * 1;
        
        $v5 = $this->row - $this->lineHeight * 3 ;
        
        $this->LineTo($h0, $v1, $h5, $v1);
        $this->NewLine();
        //$this->Text($this->leftMargin+330, "Contributions");
        //$this->LineTo($h3, $v2, $h6, $v2);
        $this->NewLine();
        //$this->Font('italic');
        if ($this->headers2 != null)
        {
                $count = count($this->headers2);
                for ($i = 0; $i < $count; $i++)
                        $this->TextCol2($i, $i + 1,	$this->headers2[$i]);
                $this->NewLine();
        }
        $current_line = $this->row;
        $count = count($this->headers);
         $this->fontSize -= 2;   
        for ($i = 0; $i < 4; $i++){
               $this->row = $current_line + $this->lineHeight * 2;
                $this->TextColLines($i, $i + 1, $this->headers[$i],-3);
//               $rep->row = $current_line ;
        }
        $this->NewLine(2);
        for ($i = 4; $i < 16; $i++){
               $this->row = $current_line - $this->lineHeight * 2 ;
                $this->TextColLines($i, $i + 1, $this->headers[$i],2);
//               $rep->row = $current_line ;
        }
        $this->fontSize += 2; 
        $this->Font();
        $this->LineTo($h0, $v3, $h5, $v3);
        $this->LineTo($h4, $v4, $h16, $v4);
        $this->LineTo($h4, $v1, $h16, $v1);
        $this->LineTo($h4, $v3, $h16, $v3);
        $this->LineTo($h4, $v5, $h16, $v5);
        
        $this->LineTo($h0, $v1, $h0, $v3);
        $this->LineTo($h1, $v1, $h1, $v3);
        $this->LineTo($h2, $v1, $h2, $v3);
        $this->LineTo($h3, $v1, $h3, $v3);
        $this->LineTo($h4, $v1, $h4, $v3);
   //Draw vertical line  from bottom to middile     
        $this->LineTo($h5, $v3, $h5, $v5);
        $this->LineTo($h6, $v3, $h6, $v4);
        $this->LineTo($h7, $v3, $h7, $v5);
        $this->LineTo($h8, $v3, $h8, $v4);
        $this->LineTo($h9, $v3, $h9, $v5);
        $this->LineTo($h10, $v3, $h10, $v4);
        $this->LineTo($h11, $v3, $h11, $v5);
        $this->LineTo($h12, $v3, $h12, $v4);
        $this->LineTo($h13, $v3, $h13, $v5);
        $this->LineTo($h14, $v3, $h14, $v4);
        $this->LineTo($h15, $v3, $h15, $v5);
        $this->LineTo($h16, $v3, $h16, $v1);
        
        $this->Font();

        $this->NewLine();
}
 else{ // page number > 1
//            $this->row = 1000;
        $this->row = 1150;
        $this->Font('bold');
        $col3_text_start = 30;
        $this->NewLine();
        $str = _("Page") . ' ' . $this->pageNumber;
        $this->Text($this->endLine - 30, $str);
        $this->NewLine();
        $this->fontSize += 4; 
        $this->Text($this->leftMargin + 350, "EMPLOYEES' TRUST FUND BOARD");
        $this->fontSize -= 4; 
         $this->NewLine();
        $this->fontSize += 3; 
        $this->Text($col3_text_start, "FORM II RETURN");
        
        $this->fontSize -= 3; 
        $this->Font('');
           $this->NewLine(2);
//            $this->row = $iline5 - $this->lineHeight - 1;
            

            // Footer
//            $this->Font('italic');
            

            $this->Font();
            $temp = 1100;
            $this->row = $temp;
        }
	
?>
