X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fdb%2Fprinters_db.inc;h=28c98a56b4b5d56c190d7634e76daca481fb2f64;hb=f3a1386748cd9250419b5ad03b95c56af2bb5f92;hp=572dca5e2b28eba5b8fc0ddc61911777cded1cda;hpb=54d84ff9a67620ab38c676cdbcf87853632724f0;p=fa-stable.git diff --git a/admin/db/printers_db.inc b/admin/db/printers_db.inc index 572dca5e..28c98a56 100644 --- a/admin/db/printers_db.inc +++ b/admin/db/printers_db.inc @@ -41,6 +41,11 @@ function get_printer($id) return db_fetch($result); } +function delete_printer($id) +{ + $sql="DELETE FROM ".TB_PREF."printers WHERE id=".db_escape($id); + db_query($sql,"could not delete printer definition"); +} //============================================================================ // printer profiles functions // @@ -52,7 +57,7 @@ function update_printer_profile($name, $dest) ."(profile, report, printer) VALUES (" .db_escape($name)."," .db_escape($rep)."," - .db_escape($printer).")"; + .db_escape($printer ? $printer: null, true).")"; } else { $sql = "DELETE FROM ".TB_PREF."print_profiles WHERE (" ."report=" . db_escape($rep) @@ -71,7 +76,7 @@ function update_printer_profile($name, $dest) function get_report_printer($profile, $report) { $sql = "SELECT printer FROM ".TB_PREF."print_profiles WHERE " - ."profile=".db_escape($profile)." AND report=".db_escape($report); + ."profile=".db_escape($profile)." AND report="; $result = db_query($sql.db_escape($report), 'report printer lookup failed'); @@ -101,4 +106,3 @@ function get_print_profile($name) return db_query($sql,"could not get printing profile"); } -?> \ No newline at end of file