From 632cc2f299accf89ff88a2f42727833529862d41 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Tue, 21 Sep 2010 15:30:26 +0000 Subject: [PATCH] enable deletion of bill git-svn-id: http://www.observium.org/svn/observer/trunk@1713 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/bill/actions.inc.php | 40 +++++++++++++++++++++++++++++++++ html/pages/bill/delete.inc.php | 23 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 html/pages/bill/actions.inc.php create mode 100644 html/pages/bill/delete.inc.php diff --git a/html/pages/bill/actions.inc.php b/html/pages/bill/actions.inc.php new file mode 100644 index 000000000..d457d6b2b --- /dev/null +++ b/html/pages/bill/actions.inc.php @@ -0,0 +1,40 @@ +Bill Deleted. Redirecting to Bills list."); + + echo(""); + +} + + +if($_POST['action'] == "add_bill_port") { mysql_query("INSERT INTO `bill_ports` (`bill_id`, `port_id`) VALUES ('".mres($_POST['bill_id'])."','".mres($_POST['interface_id'])."')"); } +if($_POST['action'] == "delete_bill_port") { mysql_query("DELETE FROM `bill_ports` WHERE `bill_id` = '".mres($bill_id)."' AND `port_id` = '".mres($_POST['interface_id'])."'"); } +if($_POST['action'] == "update_bill") { + mysql_query("UPDATE `bills` SET `bill_name` = '".mres($_POST['bill_name'])."', + `bill_day` = '".mres($_POST['bill_day'])."', + `bill_gb` = '".mres($_POST['bill_gb'])."', + `bill_cdr` = '".mres($_POST['bill_cdr'])."', + `bill_type` = '".mres($_POST['bill_type'])."' + WHERE `bill_id` = '".mres($bill_id)."'"); + + if(mysql_affected_rows()) + { + echo("
Bill Properties Updated
"); + } + +} + +?> diff --git a/html/pages/bill/delete.inc.php b/html/pages/bill/delete.inc.php new file mode 100644 index 000000000..919d2e975 --- /dev/null +++ b/html/pages/bill/delete.inc.php @@ -0,0 +1,23 @@ +Delete Bill + +

Are you sure you want to delete his bill?

+ +
+ +
+ + Confirm: + +
+ +
+ + + +"); + +?>