mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
some formatting cleanups, introduce some more FIXMEs to look at, plus replace mysql_fetch_array by mysql_fetch_assoc, for great justice
git-svn-id: http://www.observium.org/svn/observer/trunk@2029 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
if ($_POST['action'] == "delete_bill" && $_POST['confirm'] == "confirm") {
|
||||
|
||||
if ($_POST['action'] == "delete_bill" && $_POST['confirm'] == "confirm")
|
||||
{
|
||||
$port_query = mysql_query("SELECT * FROM `bill_ports` WHERE `bill_id` = '$bill_id'");
|
||||
while ($port_data = mysql_fetch_array($port_query)) {
|
||||
while ($port_data = mysql_fetch_assoc($port_query))
|
||||
{
|
||||
mysql_query("DELETE FROM `port_in_measurements` WHERE `port_id` = '".mres($port_data['bill_id'])."'");
|
||||
mysql_query("DELETE FROM `port_out_measurements` WHERE `port_id` = '".mres($port_data['bill_id'])."'");
|
||||
}
|
||||
@@ -16,13 +17,12 @@ if ($_POST['action'] == "delete_bill" && $_POST['confirm'] == "confirm") {
|
||||
echo("<div class=infobox>Bill Deleted. Redirecting to Bills list.</div>");
|
||||
|
||||
echo("<meta http-equiv='Refresh' content=\"2; url='bills/'\">");
|
||||
|
||||
}
|
||||
|
||||
|
||||
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") {
|
||||
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'])."',
|
||||
@@ -32,9 +32,8 @@ if ($_POST['action'] == "update_bill") {
|
||||
|
||||
if (mysql_affected_rows())
|
||||
{
|
||||
echo("<div class=infobox>Bill Properties Updated</div>");
|
||||
print_message("Bill Properties Updated");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
Reference in New Issue
Block a user