From cc1c7cb8f7f3dda6664fd34616168c41c12a014f Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Fri, 17 Jun 2011 13:19:53 +1000 Subject: [PATCH] fixed page numbers --- vendors/pdfdoc.php | 74 +++------------------------------------------- 1 file changed, 4 insertions(+), 70 deletions(-) diff --git a/vendors/pdfdoc.php b/vendors/pdfdoc.php index 34d09a8c..aeddf26f 100644 --- a/vendors/pdfdoc.php +++ b/vendors/pdfdoc.php @@ -92,74 +92,7 @@ ENDHTML; } - /** - * For Quotes and (hopefully) Invoices. Identifies who the document is for, date, reference number, etc. - * - * DEPRECIATED. Use DetailsBoxHTML() - */ - function DetailsBox($docTypeFullName, $companyName, $emailTo, $attention, $fromName, $fromEmail, $enquiryNumber, $your_reference, $issuedate) { - - $this->SetTextColor(0); //Black Text - - $boxYstart = 45; - $boxXstart = 10; - $firstColWidth = 40; - $secondColWidth = 70; - $thirdColWidth = 30; - $fourthColWidth = -10; - - $pageNo = $this->PageNoFormatted(); - - $this->SetXY($boxXstart, 55); - - $heightNeeded = $this->getNumLines($companyName, $secondColWidth); - - - $lineHeight = 6.40997; //Size of a single line of text. If the company name is more, multiply this by the number of lines it needs. - - - - - $this->MultiCell($firstColWidth, 0, "$docTypeFullName TO:", 'LTR', 'L', 0, 0); - $this->MultiCell($secondColWidth, 0, $companyName, 'LTR', 'L', false, 0, null, null, true,0,false,true,0,'T',true); - - - $fromString = <<{$fromName} -ENDSTRING; - - $this->MultiCell($thirdColWidth, 0, "FROM:", 'LT', 'L', 0, 0); - $this->MultiCell($fourthColWidth, 0, $fromString, 'TR','L', 0, 1, null, null, true, 0, true); //Start a new line after this. - - - $this->MultiCell($firstColWidth, 0, "EMAIL TO:", 'LR', 'L', 0, 0); - $this->MultiCell($secondColWidth, 0, "$emailTo", 'LR','L', 0, 0, null, null, true, 0, true); - $this->MultiCell($thirdColWidth, 0, "CMC REF#:", 'L', 'L', 0, 0); - $this->MultiCell($fourthColWidth, 0, $enquiryNumber, 'R', 'L', 0, 1); //Start a new line after thi - - $this->MultiCell($firstColWidth, 0, "ATTENTION:", 'LRB', 'L', 0, 0); - $this->MultiCell($secondColWidth, 0, $attention, 'LRB', 'L', 0, 0); - $this->MultiCell($thirdColWidth, 0, "PAGE: ", 'LB', 'L', 0, 0); - $this->MultiCell($fourthColWidth, 0, "$pageNo of {nb} ", 'BR', 'L', 0, 1); - - $todayPHPdate = strtotime($issuedate); - - $todaysDateString = date('l, j F Y', $todayPHPdate); - $this->MultiCell($firstColWidth + $secondColWidth, 0, "DATE: $todaysDateString", 'LRB', 'L', 0, 0); - $this->MultiCell($thirdColWidth, 0, "YOUR REF: ", 'LB', 'L', 0, 0); - - - $this->MultiCell($fourthColWidth, 0, $your_reference, 'BR', 'L', 0, 1); - $this->SetFontSize(7); - - //Kinda lame that I cant seem to wrap this text nicer. But Whatever. - $this->MultiCell(0, 0, 'The information in this document is confidential and may be privileged. If you are not the indended recipient then access, disclosure, copying or other dissemination of the contents of t his message is unauthorised and may be unlawful. Please inform the sender immediately if you are not the intended addressee.', - '', 'L', false, 1 - ); - - $this->writeHTMLCell(0, 0, null, null, '

', 0, 1, false,true, 'C', false); - } - + /** * For Quotes and (hopefully) Invoices. Identifies who the document is for, date, reference number, etc. */ @@ -234,7 +167,8 @@ ENDTABLE; //$this->Image(K_PATH_IMAGES.'cmclogosmall.jpg', 10, 10, 15, 13.6, null, 'http://www.cmctechnologies.com.au', null, false, null, 'L'); $this->SetFontSize(10); $pageNo = $this->PageNoFormatted(); - + $totalCount = $this->getAliasNbPages(); + //$currentX = $this->GetX(); @@ -244,7 +178,7 @@ ENDTABLE; //$this->MultiCell(100, 13.6,"CONTINUES", 0,'C', false, 10, 60); - $this->MultiCell(0,13.6, "PAGE $pageNo OF {nb}", '', 'R', false, 0, 10,5); + $this->MultiCell(0,13.6, "PAGE $pageNo OF $totalCount", '', 'R', false, 0, 10,5); //$this->MultiCell($w, $h, $txt, $border, $align, $fill, $ln, $x, $y, $reseth, $stretch, $ishtml) //$this->Image($file, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi)