$pdf->Write(8, $fun_name); $amountStr = sprintf("%.2f", $fundTotal[$fun_name]); $pdf->PrintRightJustified($curX + $summaryMethodX, $curY, $amountStr); $curY += $summaryIntervalY; } } if ($fundTotal['UNDESIGNATED']) { $pdf->SetXY($curX, $curY); $pdf->Write(8, gettext("UNDESIGNATED")); $amountStr = sprintf("%.2f", $fundTotal['UNDESIGNATED']); $pdf->PrintRightJustified($curX + $summaryMethodX, $curY, $amountStr); $curY += $summaryIntervalY; } } if ($iPDFOutputType == 1) { $pdf->Output("Deposit-" . $iDepositSlipID . ".pdf", true); } else { $pdf->Output(); } // Create CVS 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;
$pdf->PrintRightJustified($curX + $summaryMethodX, $curY, $amountStr); $curY += $summaryIntervalY; } } if ($fundTotal['UNDESIGNATED']) { $pdf->SetXY($curX, $curY); $pdf->Write(8, gettext("UNDESIGNATED")); $amountStr = sprintf("%.2f", $fundTotal['UNDESIGNATED']); $pdf->PrintRightJustified($curX + $summaryMethodX, $curY, $amountStr); $curY += $summaryIntervalY; } } header('Pragma: public'); // Needed for IE when using a shared SSL certificate if ($iPDFOutputType == 1) { $pdf->Output("Deposit-" . $iDepositSlipID . ".pdf", "D"); } else { $pdf->Output(); } // Create CVS File // *************** } elseif ($output == "csv") { // Settings $delimiter = ","; $eol = "\r\n"; // Build headings row preg_match("/SELECT (.*) FROM /i", $sSQL, $result); $headings = explode(",", $result[1]); $buffer = ""; foreach ($headings as $heading) { $buffer .= trim($heading) . $delimiter;
$pdf = new PDF_AccessReport(); // Read in report settings from database $rsConfig = mysql_query("SELECT cfg_name, IFNULL(cfg_value, cfg_default) AS value FROM config_cfg WHERE cfg_section='ChurchInfoReport'"); if ($rsConfig) { while (list($cfg_name, $cfg_value) = mysql_fetch_row($rsConfig)) { $pdf->{$cfg_name} = $cfg_value; } } // Fetch a new table consisting of first and last name from the // person_per table and last login from the user_usr table. $sSQL = "SELECT person_per.per_FirstName, person_per.per_LastName, user_usr.usr_LastLogin FROM person_per INNER JOIN user_usr ON person_per.per_ID = user_usr.usr_per_ID ORDER BY usr_LastLogin DESC"; $rsRecords = RunQuery($sSQL); while ($aRow = mysql_fetch_array($rsRecords)) { $OutStr = ''; extract($aRow); $OutStr = $pdf->sGetUserString($aRow); // Count the number of lines in the output string if (strlen($OutStr)) { $numlines = substr_count($OutStr, "\n"); } else { $numlines = 0; } $pdf->Add_Record($OutStr, $numlines); } header('Pragma: public'); // Needed for IE when using a shared SSL certificate if ($iPDFOutputType == 1) { $pdf->Output('Directory-' . date("Ymd-Gis") . '.pdf', "D"); } else { $pdf->Output(); }