"Bonpos", "fileprefix" => "bonpos_", "csvfilename" => "lines.csv", "fct" => "bonpos"), array("header" => "Bonpos_Ust", "fileprefix" => "bonposust_", "csvfilename" => "lines_vat.csv", "fct" => "bonposust"), array("header" => "Bonpos_Preisfindung", "fileprefix" => "bonpospreis_", "csvfilename" => "itemamounts.csv", "fct" => "bonpospreisfindung"), array("header" => "Bonkopf", "fileprefix" => "bonkopf_", "csvfilename" => "transactions.csv", "fct" => "bonkopf"), array("header" => "Bonkop_Ust", "fileprefix" => "bonkopfust_", "csvfilename" => "transactions_vat.csv", "fct" => "bonkopfust"), array("header" => "Bonkopf_AbrKreis", "fileprefix" => "bonkopfabrkreis_", "csvfilename" => "allocation_groups.csv", "fct" => "bonkopfabrkreis"), array("header" => "Bonkopf_Zahlarten", "fileprefix" => "bonkopfzahlarten_", "csvfilename" => "datapayment.csv", "fct" => "bonkopfzahlarten"), array("header" => "Bon_Referenzen", "fileprefix" => "bonrefs_", "csvfilename" => "references.csv", "fct" => "bonreferenzen"), array("header" => "TSE_Transaktionen", "fileprefix" => "tsetrans_", "csvfilename" => "transactions_tse.csv", "fct" => "tsetransactions"), array("header" => "Stamm_Abschluss", "fileprefix" => "stammabschluss_", "csvfilename" => "cashpointclosing.csv", "fct" => "stammabschluss"), array("header" => "Stamm_Orte", "fileprefix" => "stammorte_", "csvfilename" => "location.csv", "fct" => "stammorte"), array("header" => "Stamm_Kassen", "fileprefix" => "stammkassen_", "csvfilename" => "cashregister.csv", "fct" => "stammkassen"), array("header" => "Stamm_Terminals", "fileprefix" => "stammterminals_", "csvfilename" => "slaves.csv", "fct" => "stammterminals"), array("header" => "Stamm_Agenturen", "fileprefix" => "stammagenturen_", "csvfilename" => "ps.csv", "fct" => "stammagenturen"), array("header" => "Stamm_USt", "fileprefix" => "stammust_", "csvfilename" => "vat.csv", "fct" => "stammust"), array("header" => "Stamm_TSE", "fileprefix" => "stammtse_", "csvfilename" => "tse.csv", "fct" => "stammtse"), array("header" => "Z_GV_Typ", "fileprefix" => "zgvtyp_", "csvfilename" => "businesscases.csv", "fct" => "zgvtyp"), array("header" => "Z_Zahlart", "fileprefix" => "zzahlart_", "csvfilename" => "payment.csv", "fct" => "zzahlart"), array("header" => "Z_WAEHRUNGEN", "fileprefix" => "zcurrencies_", "csvfilename" => "cash_per_currency.csv", "fct" => "zwaehrungen") ); $arrayToZip = array(); if (!$dohtml) { foreach($csvtables as $aCsvtable) { $tempFileName = tempnam($tmpdir,$aCsvtable["fileprefix"]); $arrayToZip[] = array("tmpfilename" => $tempFileName,"csvfilename" => $aCsvtable["csvfilename"]); $fct = $aCsvtable["fct"]; $params = [$pdo, $tempFileName]; call_user_func_array(["Dsfinvk", $fct], $params); } $zipfile = tempnam($tmpdir,"zip"); $zip = new ZipArchive(); if ($zip->open($zipfile, ZipArchive::CREATE)!==TRUE) { exit("cannot open <$zipfile>\n"); } foreach($arrayToZip as $aCsvtable) { $zip->addFile($aCsvtable["tmpfilename"],$aCsvtable["csvfilename"]); } $zip->close(); foreach($arrayToZip as $aCsvtable) { unlink($aCsvtable["tmpfilename"]); } header('Content-Description: File Transfer'); header('Content-Type: application/zip'); header('Content-Disposition: attachment; filename="dsfinvk-export.zip"'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($zipfile)); readfile($zipfile); unlink($zipfile); } else { echo self::getPage(); //echo "
" . $tablecontent . ""; echo "