} $defaults = array("url_form_action" => $TPL["url_alloc_transactionList"], "form_name" => "transactionList_filter", "applyFilter" => $applyFilter, "tfID" => $tfID, "startDate" => $startDate, "endDate" => $endDate, "monthDate" => $monthDate); if ($download) { $_FORM = transaction::load_form_data($defaults); $rtn = transaction::get_list($_FORM); $totals = $rtn["totals"]; $rows = $rtn["rows"]; $csv = transaction::arr_to_csv($rows); header('Content-Type: application/octet-stream'); header("Content-Length: " . strlen($csv)); header('Content-Disposition: attachment; filename="' . date("Ymd_His") . '.csv"'); echo $csv; exit; } // Check perm of requested tf $tf = new tf(); $tf->set_id($tfID); $tf->select(); $TPL["tfID"] = $tfID; $_FORM = transaction::load_form_data($defaults); $rtn = transaction::get_list($_FORM); $TPL["totals"] = $rtn["totals"]; $TPL["transactionListRows"] = $rtn["rows"]; // Total balance $TPL["balance"] = $tf->get_balance(); // Total balance pending $TPL["pending_amount"] = $tf->get_balance(array("status" => "pending")); // Page and header title $TPL["title"] = "Statement for tagged fund: " . $tf->get_value("tfName"); $TPL["main_alloc_title"] = "TF: " . $tf->get_value("tfName") . " - " . APPLICATION_NAME; include_template("templates/transactionListM.tpl");