Overhaul ADSL traffic reporting/graphing

This commit is contained in:
Deon George
2013-11-14 22:50:35 +11:00
parent 158a4f9e47
commit e01d37244c
33 changed files with 891 additions and 471 deletions

View File

@@ -1,9 +1,19 @@
<!-- @todo NEEDS TO BE TRANSLATED -->
<table class="box-left">
<?php foreach ($traffic as $metric => $usage) { ?>
<tr>
<td><?php echo $metric; ?></td>
<td class="head"><?php echo $usage; ?></td>
</tr>
<?php } ?>
<table class="table table-striped table-condensed table-hover" id="list-table">
<thead><tr>
<th><?php echo $index; ?></th>
<?php foreach ($th as $i) : ?>
<th><?php echo $o->friendly($i); ?></th>
<?php endforeach ?>
</tr></thead>
<tbody>
<?php foreach ($td as $i => $details) : ?>
<tr>
<td><?php echo $i; ?></td>
<?php foreach ($th as $k) : ?>
<td><?php echo $details[$k]; ?></td>
<?php endforeach ?>
</tr>
<?php endforeach ?>
</tbody>
</table>

View File

@@ -39,22 +39,42 @@
<legend>Traffic Usage</legend>
<div class="dl-horizontal">
<dt>This Month</dt>
<dd>&nbsp;<?php echo $o->traffic_month(NULL); ?></dd>
<dt>Last Month</dt>
<dd>&nbsp;<?php echo $o->traffic_lastmonth(); ?></dd>
<dd>&nbsp;<?php echo $o->traffic_month(strtotime('last month'),TRUE,1000); ?> GB</dd>
<dt>This Month</dt>
<dd>&nbsp;<?php echo $o->traffic_month(strtotime('yesterday'),TRUE,1000); ?> GB</dd>
<dt>Excess Traffic</dt>
<dd>&nbsp;$<?php echo $o->traffic_excess(strtotime('yesterday'),TRUE,TRUE); ?></dd>
</div> <!-- dl-horizontal -->
</fieldset>
<fieldset class="span6">
<table>
<tr>
<td>View Daily Traffic for Month</td>
<td><?php echo Form::open(); echo Form::select('month',array_merge(array(''),$o->get_traffic_months()),(isset($_POST['month']) ? $_POST['month'] : '')); echo Form::submit('submit',_('Show'),array('class'=>'form_button')); echo Form::close(); ?></td>
</tr>
</table>
<form class="form-inline" method="POST">
<div class="dl-horizontal">
<dt>View Traffic for</dt>
<dd><?php echo Form::select('month',array_merge(array(''),$o->get_traffic_months()),(isset($_POST['month']) ? $_POST['month'] : ''),array('class'=>'input-small','nocg'=>TRUE)); ?>
<button type="submit" class="btn btn-mini">Submit</button></dd>
</div> <!-- dl-horizontal -->
</form>
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab1" data-toggle="tab">Graph</a></li>
<li class=""><a href="#tab2" data-toggle="tab">Table</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<?php echo $o->traffic_graph(isset($_POST['month']) ? $_POST['month'] : ''); ?>
</div> <!-- /tab-pane -->
<div class="tab-pane" id="tab2">
<?php echo $o->traffic_table(isset($_POST['month']) ? $_POST['month'] : ''); ?>
</div> <!-- /tab-pane -->
</div> <!-- /tab-content -->
</div> <!-- /tabbable -->
<?php echo $o->graph_traffic(isset($_POST['month']) ? $_POST['month'] : ''); ?><br>
<?php echo $o->table_traffic(isset($_POST['month']) ? $_POST['month'] : ''); ?>
</fieldset>