mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
restructure/reindent/htmlfix html pages, remove dead code
git-svn-id: http://www.observium.org/svn/observer/trunk@1897 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
|
||||
<?php
|
||||
|
||||
if($_POST['addbill'] == "yes") {
|
||||
|
||||
if ($_POST['addbill'] == "yes")
|
||||
{
|
||||
$updated = '1';
|
||||
|
||||
$sql = "INSERT INTO `bills` (`bill_name`,`bill_type`,`bill_cdr`,`bill_day`,`bill_gb`, `bill_custid`, `bill_ref`, `bill_notes`)
|
||||
@@ -16,13 +15,12 @@ if($_POST['addbill'] == "yes") {
|
||||
|
||||
$message .= $message_break . "Bill ".mres($_POST['bill_name'])." added!";
|
||||
$message_break .= "<br />";
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo("<meta http-equiv='refresh' content='10000'>");
|
||||
|
||||
if($_GET['opta'] == "add") {
|
||||
if ($_GET['opta'] == "add")
|
||||
{
|
||||
|
||||
?>
|
||||
<div style='padding:10px;font-size:20px; font-weight: bold;'>Add Bill</div>
|
||||
@@ -74,12 +72,11 @@ if($_GET['opta'] == "add") {
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
print_optionbar_start('40');
|
||||
print_optionbar_start('40');
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<table cellpadding=7 cellspacing=0 class=devicetable width=100%>
|
||||
<form method='post' action=''>
|
||||
@@ -120,48 +117,51 @@ print_optionbar_start('40');
|
||||
|
||||
<?php
|
||||
|
||||
print_optionbar_end();
|
||||
print_optionbar_end();
|
||||
|
||||
$sql = "SELECT * FROM `bills` ORDER BY `bill_name`";
|
||||
$query = mysql_query($sql);
|
||||
echo("<table border=0 cellspacing=0 cellpadding=5 class=devicetable width=100%>");
|
||||
$i=1;
|
||||
while($bill = mysql_fetch_array($query)) {
|
||||
#echo("<pre>");
|
||||
#print_r($permissions);
|
||||
#echo("</pre>");
|
||||
if(bill_permitted($bill['bill_id'])) {
|
||||
unset($class);
|
||||
$day_data = getDates($bill['bill_day']);
|
||||
$datefrom = $day_data['0'];
|
||||
$dateto = $day_data['1'];
|
||||
$rate_data = getRates($bill['bill_id'],$datefrom,$dateto);
|
||||
$rate_95th = $rate_data['rate_95th'];
|
||||
$dir_95th = $rate_data['dir_95th'];
|
||||
$total_data = $rate_data['total_data'];
|
||||
$rate_average = $rate_data['rate_average'];
|
||||
while ($bill = mysql_fetch_array($query))
|
||||
{
|
||||
#echo("<pre>");
|
||||
#print_r($permissions);
|
||||
#echo("</pre>");
|
||||
if (bill_permitted($bill['bill_id']))
|
||||
{
|
||||
unset($class);
|
||||
$day_data = getDates($bill['bill_day']);
|
||||
$datefrom = $day_data['0'];
|
||||
$dateto = $day_data['1'];
|
||||
$rate_data = getRates($bill['bill_id'],$datefrom,$dateto);
|
||||
$rate_95th = $rate_data['rate_95th'];
|
||||
$dir_95th = $rate_data['dir_95th'];
|
||||
$total_data = $rate_data['total_data'];
|
||||
$rate_average = $rate_data['rate_average'];
|
||||
|
||||
if($bill['bill_type'] == "cdr") {
|
||||
$type = "CDR";
|
||||
$allowed = formatRates($bill['bill_cdr'] * 1000);
|
||||
$used = formatRates($rate_data['rate_95th'] * 1000);
|
||||
$percent = round(($rate_data['rate_95th'] / $bill['bill_cdr']) * 100,2);
|
||||
} elseif ($bill['bill_type'] == "quota") {
|
||||
$type = "Quota";
|
||||
$allowed = formatStorage($bill['bill_gb']* 1024 * 1024 * 1024);
|
||||
$used = formatStorage($rate_data['total_data'] * 1024 * 1024);
|
||||
$percent = round(($rate_data['total_data'] / ($bill['bill_gb'] * 1024)) * 100,2);
|
||||
}
|
||||
if ($bill['bill_type'] == "cdr")
|
||||
{
|
||||
$type = "CDR";
|
||||
$allowed = formatRates($bill['bill_cdr'] * 1000);
|
||||
$used = formatRates($rate_data['rate_95th'] * 1000);
|
||||
$percent = round(($rate_data['rate_95th'] / $bill['bill_cdr']) * 100,2);
|
||||
} elseif ($bill['bill_type'] == "quota") {
|
||||
$type = "Quota";
|
||||
$allowed = formatStorage($bill['bill_gb']* 1024 * 1024 * 1024);
|
||||
$used = formatStorage($rate_data['total_data'] * 1024 * 1024);
|
||||
$percent = round(($rate_data['total_data'] / ($bill['bill_gb'] * 1024)) * 100,2);
|
||||
}
|
||||
|
||||
if ($percent > 100) { $perc = "100"; } else { $perc = $percent; }
|
||||
if($perc > '90') { $left_background='c4323f'; $right_background='C96A73';
|
||||
} elseif($perc > '75') { $left_background='bf5d5b'; $right_background='d39392';
|
||||
} elseif($perc > '50') { $left_background='bf875b'; $right_background='d3ae92';
|
||||
} elseif($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3';
|
||||
} else { $left_background='9abf5b'; $right_background='bbd392'; }
|
||||
if ($percent > 100) { $perc = "100"; } else { $perc = $percent; }
|
||||
if ($perc > '90') { $left_background='c4323f'; $right_background='C96A73'; }
|
||||
elseif ($perc > '75') { $left_background='bf5d5b'; $right_background='d39392'; }
|
||||
elseif ($perc > '50') { $left_background='bf875b'; $right_background='d3ae92'; }
|
||||
elseif ($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3'; }
|
||||
else { $left_background='9abf5b'; $right_background='bbd392'; }
|
||||
|
||||
if(!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
echo("
|
||||
if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
echo("
|
||||
<tr bgcolor='$row_colour'>
|
||||
<td width='7'></td>
|
||||
<td width='250'><a href='".$config['base_url']."/bill/".$bill['bill_id']."/'><span style='font-weight: bold;' class=interface>".$bill['bill_name']."</span></a></td>
|
||||
@@ -173,12 +173,12 @@ print_optionbar_end();
|
||||
<td width=60><a href='".$config['base_url']."/bill/".$bill['bill_id']."/edit/'><img src='images/16/wrench.png' align=absmiddle alt='Edit'> Edit</a></td>
|
||||
</tr>
|
||||
");
|
||||
$i++;
|
||||
} ### PERMITTED
|
||||
$i++;
|
||||
} ### PERMITTED
|
||||
}
|
||||
echo("</table>");
|
||||
}
|
||||
|
||||
echo("</td></tr></table>");
|
||||
|
||||
?>
|
||||
?>
|
||||
Reference in New Issue
Block a user