$to = date2sql($to_date);
$sql = "INSERT INTO ".TB_PREF."fiscal_year (begin, end, closed)
- VALUES (".db_escape($from).",".db_escape($to).", $closed)";
+ VALUES (".db_escape($from).",".db_escape($to).", ".db_escape($closed).")";
db_query($sql, "could not add fiscal year");
}
function update_fiscalyear($id, $closed)
{
- $sql = "UPDATE ".TB_PREF."fiscal_year SET closed=$closed
+ $sql = "UPDATE ".TB_PREF."fiscal_year SET closed=".db_escape($closed)."
WHERE id=".db_escape($id);
db_query($sql, "could not update fiscal year");
{
$year = get_company_pref('f_year');
- $sql = "SELECT * FROM ".TB_PREF."fiscal_year WHERE id=$year";
+ $sql = "SELECT * FROM ".TB_PREF."fiscal_year WHERE id=".db_escape($year);
$result = db_query($sql, "could not get current fiscal year");
return $myrow[0];
}
+function get_company_extensions($id = -1) {
+ global $path_to_root;
+
+ $file = $path_to_root.($id == -1 ? '' : '/company/'.$id).'/installed_extensions.php';
+ $installed_extensions = array();
+ if (is_file($file)) {
+ include($file);
+ }
+ return $installed_extensions;
+}
+
?>
\ No newline at end of file