$pdf->Cell(25, $summaryIntervalY, $totalAmountStr, 0, 1, "R"); $curY = $pdf->GetY(); $curY = $pdf->GetY(); if ($curY > $bottom_border1) { $pdf->AddPage(); if ($letterhead == "none") { // Leave blank space at top on all pages for pre-printed letterhead $curY = 20 + $summaryIntervalY * 3 + 25; $pdf->SetY($curY); } else { $curY = 20; $pdf->SetY(20); } } $pdf->SetFont('Times', '', 10); $pdf->FinishPage($curY, $prev_fam_ID, $prev_fam_Name, $prev_fam_Address1, $prev_fam_Address2, $prev_fam_City, $prev_fam_State, $prev_fam_Zip, $prev_fam_Country); } // Start Page for New Family if ($fam_ID != $currentFamilyID) { $curY = $pdf->StartNewPage($fam_ID, $fam_Name, $fam_Address1, $fam_Address2, $fam_City, $fam_State, $fam_Zip, $fam_Country, $iYear, $fam_envelope); $summaryDateX = $pdf->leftX; $summaryCheckNoX = 40; $summaryMethodX = 60; $summaryFundX = 85; $summaryMemoX = 110; $summaryAmountX = 160; $summaryIntervalY = 4; $curY += 2 * $summaryIntervalY; $pdf->SetFont('Times', 'B', 10); $pdf->SetXY($summaryDateX, $curY); $pdf->Cell(20, $summaryIntervalY, 'Date');
ksort($totalFund); reset($totalFund); while ($FundTotal = current($totalFund)) { if (strlen(key($totalFund) > 22)) { $sfun_Name = substr(key($totalFund), 0, 21) . "..."; } else { $sfun_Name = key($totalFund); } $pdf->SetXY(20, $curY); $pdf->Cell(45, $summaryIntervalY, $sfun_Name); $pdf->Cell(25, $summaryIntervalY, number_format($FundTotal, 2, '.', ','), 0, 0, "R"); $curY += $summaryIntervalY; $page = $pdf->PageBreak($page); next($totalFund); } $pdf->FinishPage($page); $pdf->Output("DepositReport-" . date("Ymd-Gis") . ".pdf", "D"); // Output a text file // ################## } elseif ($output == "csv") { // Settings $delimiter = ","; $eol = "\r\n"; // Build headings row eregi("SELECT (.*) FROM ", $sSQL, $result); $headings = explode(",", $result[1]); $buffer = ""; foreach ($headings as $heading) { $buffer .= trim($heading) . $delimiter; } // Remove trailing delimiter and add eol