mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Use elseif instead of else if (#8417)
This commit is contained in:
committed by
Neil Lathwood
parent
10237ea097
commit
8cc8eb8dd2
@ -1274,7 +1274,7 @@ function list_bills()
|
||||
$sql .= ' AND `bill_id` IN (SELECT `bill_id` FROM `bill_perms` WHERE `user_id` = ?)';
|
||||
$param[] = $_SESSION['user_id'];
|
||||
}
|
||||
|
||||
|
||||
if ($period === 'previous') {
|
||||
$select = "SELECT bills.bill_name, bills.bill_notes, bill_history.*, bill_history.traf_total as total_data, bill_history.traf_in as total_data_in, bill_history.traf_out as total_data_out ";
|
||||
$query = 'FROM `bills`
|
||||
@ -1331,7 +1331,7 @@ function get_bill_graph()
|
||||
if (!is_admin() && !is_read()) {
|
||||
check_bill_permission($bill_id);
|
||||
}
|
||||
|
||||
|
||||
if ($graph_type == 'monthly') {
|
||||
$graph_type = 'historicmonthly';
|
||||
}
|
||||
@ -1364,10 +1364,10 @@ function get_bill_graphdata()
|
||||
$reducefactor = $_GET['reducefactor'];
|
||||
|
||||
$graph_data = getBillingBitsGraphData($bill_id, $from, $to, $reducefactor);
|
||||
} else if ($graph_type == 'monthly') {
|
||||
} elseif ($graph_type == 'monthly') {
|
||||
$graph_data = getHistoricTransferGraphData($bill_id);
|
||||
}
|
||||
|
||||
|
||||
if (!isset($graph_data)) {
|
||||
api_error(400, "Unsupported graph type $graph_type");
|
||||
} else {
|
||||
@ -1397,7 +1397,7 @@ function get_bill_history()
|
||||
function get_bill_history_graph()
|
||||
{
|
||||
global $config;
|
||||
|
||||
|
||||
$app = \Slim\Slim::getInstance();
|
||||
$router = $app->router()->getCurrentRoute()->getParams();
|
||||
$bill_id = mres($router['bill_id']);
|
||||
@ -1407,7 +1407,7 @@ function get_bill_history_graph()
|
||||
if (!is_admin() && !is_read()) {
|
||||
check_bill_permission($bill_id);
|
||||
}
|
||||
|
||||
|
||||
$vars = array();
|
||||
|
||||
switch ($graph_type) {
|
||||
@ -1415,13 +1415,13 @@ function get_bill_history_graph()
|
||||
$graph_type = 'historicbits';
|
||||
$vars['reducefactor'] = $_GET['reducefactor'];
|
||||
break;
|
||||
|
||||
|
||||
case 'day':
|
||||
case 'hour':
|
||||
$vars['imgtype'] = $graph_type;
|
||||
$graph_type = 'historictransfer';
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
api_error(400, "Unknown Graph Type $graph_type");
|
||||
break;
|
||||
@ -1451,7 +1451,7 @@ function get_bill_history_graphdata()
|
||||
if (!is_admin() && !is_read()) {
|
||||
check_bill_permission($bill_id);
|
||||
}
|
||||
|
||||
|
||||
switch ($graph_type) {
|
||||
case 'bits':
|
||||
$reducefactor = $_GET['reducefactor'];
|
||||
@ -1463,7 +1463,7 @@ function get_bill_history_graphdata()
|
||||
$graph_data = getBillingBandwidthGraphData($bill_id, $bill_hist_id, null, null, $graph_type);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (!isset($graph_data)) {
|
||||
api_error(400, "Unsupported graph type $graph_type");
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user