} $reportInst->append(" <date>" . $toolInst->getTime("Y-m-d") . "</date>"); } echo "</table>"; $reportId = ""; if (tool::securePost('action') == "save") { $reportInst->subject = tool::securePost('subject'); $reportInst->projectId = tool::securePost('filterprojectid'); // F**k, the german law says: // every bill must have a consecutive id :-/ // So, we first create the report without xml. // after that we store the database id in the xml // code and update the report $_xml = $reportInst->xml; // backup of current xml code $reportId = $reportInst->insert(); //insert the report $reportInst->append(" <id>" . $reportId . "</id>"); // append id $reportInst->append("</report>"); $reportInst->update(); } else { // don't forget the closing tag $reportInst->append("</report>"); } if (tool::securePost('action') == "view") { $reportId = tool::securePost('viewreport'); } if ($reportId != "") { $template = tool::securePost('templateview'); if (tool::securePost('action') == "save") {