#30 new bootsrap 3 theme

This commit is contained in:
Ulrich Block 2014-09-13 11:16:32 +02:00
parent 4d0eed63a8
commit 346e70d857
7 changed files with 97 additions and 108 deletions

View File

@ -260,6 +260,45 @@ if ($ui->smallletters('w', 9, 'get') == 'datatable') {
die;
} else if (isset($user_id) and $pa['voiceserverStats'] and $ui->w('d', 14, 'get') == 'voiceUserStats') {
$usageArray = array();
$dateRange = ($ui->escaped('dateRange', 'get')) ? $ui->escaped('dateRange', 'get') : date('m/d/Y', strtotime("-6 days")) . ' - ' . date('m/d/Y');
$accuracy = (in_array($ui->st('accuracy', 'get'), array('da', 'mo'))) ? $ui->st('accuracy', 'get') : 'da';
@list($startDate, $endDate) = explode('-', str_replace(' ', '', $dateRange));
@list($startMonth, $startDay, $startYear) = explode('/', $startDate);
@list($endMonth, $endDay, $endYear) = explode('/', $endDate);
if ($endYear > 2000 and $startYear > 2000) {
$menuStart = round((strtotime("{$endYear}-{$endMonth}-{$endDay}") - strtotime("{$startYear}-{$startMonth}-{$startDay}")) / 86400);
$extractOrNormal = ($accuracy == 'mo') ? "CONCAT(EXTRACT(YEAR FROM `date`),'-',EXTRACT(MONTH FROM `date`))" : '`date`';
$startDateFormatted = date('Y-m-d', strtotime($startYear . '-' . $startMonth . '-' . $startDay));
$endDateFormatted = date('Y-m-d', strtotime($endYear . '-' . $endMonth . '-' . $endDay));
if ($ui->id('serverID', 10, 'get')) {
$query = $sql->prepare("SELECT $extractOrNormal AS `groupedDate`,SUM(`used`)/COUNT(`sid`) AS `averageused`,SUM(`traffic`)/1024 as `fileTrafficMB` FROM `voice_server_stats` WHERE `sid`=? AND `uid`=? AND `resellerid`=? AND `date` BETWEEN ? AND ? GROUP BY `groupedDate` ORDER BY `groupedDate`");
$query->execute(array($ui->id('serverID', 10, 'get'), $user_id, $reseller_id, $startDateFormatted, $endDateFormatted));
} else {
$query = $sql->prepare("SELECT $extractOrNormal AS `groupedDate`,SUM(`used`)/COUNT(`sid`) AS `averageused`,SUM(`traffic`)/1024 as `fileTrafficMB` FROM `voice_server_stats` WHERE `uid`=? AND `resellerid`=? AND `date` BETWEEN ? AND ? GROUP BY `groupedDate` ORDER BY `groupedDate`");
$query->execute(array($user_id, $reseller_id, $startDateFormatted, $endDateFormatted));
}
while($row = $query->fetch(PDO::FETCH_ASSOC)) {
$usageArray[] = array('y' => $row['groupedDate'], 'slots' => ceil($row['averageused']), 'traffic' => ceil($row['fileTrafficMB']));
}
}
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 1 Jan 1900 00:00:00 GMT');
header('Content-type: application/json');
die(json_encode($usageArray));
} else if (isset($user_id) and ($pa['gserver'] or $pa['restart']) and $ui->username('mapgroup', 50, 'get')) {
$sprache = getlanguagefile('gserver', $user_language, $reseller_id);

View File

@ -52,10 +52,11 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
} else {
$data = array();
$slotUsage = array();
$trafficUsage = array();
$menuStart = 6;
$freeSlots = 0;
$usedSlots = 0;
$freeTraffic = 0;
$fileTraffic = 0;
$kind = 'al';
$display = $sprache->total;
@ -65,34 +66,8 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
@list($startDate, $endDate) = explode('-', str_replace(' ', '', $dateRange));
@list($startMonth, $startDay, $startYear) = explode('/', $startDate);
@list($endMonth, $endDay, $endYear) = explode('/', $endDate);
$freeSlots = 0;
$usedSlots = 0;
$freeTraffic = 0;
$fileTraffic = 0;
if ($endYear > 2000 and $startYear > 2000) {
$menuStart = round((strtotime("{$endYear}-{$endMonth}-{$endDay}") - strtotime("{$startYear}-{$startMonth}-{$startDay}")) / 86400);
$extractOrNormal = ($accuracy == 'mo') ? "CONCAT(EXTRACT(YEAR FROM `date`),'-',EXTRACT(MONTH FROM `date`))" : '`date`';
$startDateFormatted = date('Y-m-d', strtotime($startYear . '-' . $startMonth . '-' . $startDay));
$endDateFormatted = date('Y-m-d', strtotime($endYear . '-' . $endMonth . '-' . $endDay));
if ($ui->id('serverID', 10, 'post')) {
$query = $sql->prepare("SELECT $extractOrNormal AS `groupedDate`,SUM(`used`)/COUNT(`sid`) AS `averageused`,SUM(`traffic`)/1024 as `fileTrafficMB` FROM `voice_server_stats` WHERE `sid`=? AND `uid`=? AND `resellerid`=? AND `date` BETWEEN ? AND ? GROUP BY `groupedDate` ORDER BY `groupedDate`");
$query->execute(array($ui->id('serverID', 10, 'post'), $user_id, $reseller_id, $startDateFormatted, $endDateFormatted));
} else {
$query = $sql->prepare("SELECT $extractOrNormal AS `groupedDate`,SUM(`used`)/COUNT(`sid`) AS `averageused`,SUM(`traffic`)/1024 as `fileTrafficMB` FROM `voice_server_stats` WHERE `uid`=? AND `resellerid`=? AND `date` BETWEEN ? AND ? GROUP BY `groupedDate` ORDER BY `groupedDate`");
$query->execute(array($user_id, $reseller_id, $startDateFormatted, $endDateFormatted));
}
while($row = $query->fetch(PDO::FETCH_ASSOC)) {
$slotUsage[] = "{y: '{$row['groupedDate']}', item1: " . ceil($row['averageused']) . "}";
$trafficUsage[] = "{y: '{$row['groupedDate']}', item1: " . ceil($row['fileTrafficMB']) . "}";
}
if ($ui->id('serverID', 10, 'post')) {
$query = $sql->prepare("SELECT `slots` AS `s`,`usedslots` AS `u`,`maxtraffic` AS `m`,`filetraffic` AS `f` FROM `voice_server` WHERE `id`=? AND `userid`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($ui->id('serverID', 10, 'post'), $user_id, $reseller_id));
@ -107,10 +82,6 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$freeTraffic = ceil($row['m'] - ($row['f'] / 1024));
$fileTraffic = ceil($row['f'] / 1024);
}
}
$kind = 'al';
if ($ui->id('serverID', 10, 'post') and $ui->st('kind', 'post') == 'se') {
@ -134,7 +105,6 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$htmlExtraInformation['js'][] = '<script src="js/adminlte/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>';
$htmlExtraInformation['js'][] = "<script type=\"text/javascript\">
$(function() {
//Date range as a button
$('#dateRange').daterangepicker(
@ -163,31 +133,21 @@ $(function() {
$htmlExtraInformation['js'][] = '<script src="js/adminlte/plugins/morris/morris.min.js" type="text/javascript"></script>';
$htmlExtraInformation['js'][] = "<script type=\"text/javascript\">
$(function() {
'use strict';
var area = new Morris.Area({
element: 'slot-usage',
resize: true,
data: [" . implode(',', $slotUsage) . "],
xkey: 'y',
ykeys: ['item1'],
labels: ['{$voSprache->usage}'],
lineColors: ['#3c8dbc'],
hideHover: 'auto'
});
var line = new Morris.Area({
element: 'traffic-usage',
element: 'usage-chart',
resize: true,
data: [" . implode(',', $trafficUsage) . "],
data: [],
xkey: 'y',
ykeys: ['item1'],
labels: ['MegaByte'],
lineColors: ['#3c8dbc'],
ykeys: ['slots', 'traffic'],
labels: ['{$voSprache->slots}', '{$gsprache->traffic}'],
lineColors: ['#3c8dbc', '#00a65a'],
hideHover: 'auto'
});
var donut = new Morris.Donut({
var trafficDonut = new Morris.Donut({
element: 'traffic-chart',
resize: true,
colors: ['#00a65a', '#f56954'],
@ -198,7 +158,7 @@ $(function() {
hideHover: 'auto'
});
var donut = new Morris.Donut({
var slotsDonut = new Morris.Donut({
element: 'slots-chart',
resize: true,
colors: ['#00a65a', '#f56954'],
@ -208,10 +168,24 @@ $(function() {
],
hideHover: 'auto'
});
function changeMorrisArea() {
$.ajax({
type: 'GET',
dataType: 'json',
url: 'ajax.php',
data: { d: 'voiceUserStats', dateRange: $('#dateRange').val(), accuracy: $('#inputFormat').val(), serverID: $('#inputSelect').val()}
}).done(function(response) {
if (typeof line !== 'undefined') {
line.setData(response);
}
});
}
changeMorrisArea();
});
</script>";
/*<?php echo ;?>/<?php echo $maxTraffic;?>, "#00a65a"
<?php echo ;?>/<?php echo ;?>*/
$template_file = 'userpanel_voice_stats.tpl';
}

View File

@ -24,11 +24,13 @@
<div class="row-fluid">
<div class="span6">
<form class="form-horizontal" action="admin.php?w=gs&amp;d=ad&amp;r=gs" onsubmit="return confirm('<?php echo $gsprache->sure; ?>');" method="post">
<input type="hidden" name="token" value="<?php echo token();?>">
<input type="hidden" name="customer" value="<?php echo $customer;?>">
<input type="hidden" name="id" value="<?php echo $id;?>">
<input type="hidden" name="gamestring" value="<?php echo $gamestring;?>">
<input type="hidden" name="action" value="ad2">
<div class="control-group">
<label class="control-label" for="inputExternalID">externalID</label>
<div class="controls"><input id="inputExternalID" type="text" name="externalID" value=""></div>
@ -193,12 +195,14 @@
<label class="control-label" for="inputMaxRam">Max Ram</label>
<div class="controls"><input id="inputMaxRam" type="text" name="maxram" value="1024"></div>
</div>
<?php foreach(customColumns('G') as $row){ ?>
<div class="control-group">
<label class="control-label" for="inputCustom-<?php echo $row['customID'];?>"><?php echo $row['menu'];?></label>
<div class="controls"><?php echo $row['input'];?></div>
</div>
<?php }?>
<hr>
<?php foreach ($table as $table_row){ ?>
<h3><a href="javascript:void(0)" onclick="SwitchShowHideRows('<?php echo $table_row['id'];?>'); return false;"><?php echo $table_row['description'];?> <span class="btn btn-large btn-link"><i class="icon-plus"></i></span></a></h3>

View File

@ -152,12 +152,12 @@
<?php foreach ($array as $feed) { ?>
<?php if($lastdate!=$feed['date']){ ?>
<!-- timeline time label -->
<li class="time-label"><span class="bg-green"><?php echo $feed['date'];?></span></li>
<!-- /.timeline-label -->
<?php }; $lastdate=$feed['date'];?>
<!-- timeline item -->
<li>
<i class="fa fa-info bg-blue"></i>
<div class="timeline-item">
@ -173,7 +173,7 @@
</li>
<?php } ?>
<!-- END timeline item -->
<li>
<i class="fa fa-clock-o"></i>
</li>

View File

@ -52,16 +52,10 @@
<!-- timeline time label -->
<div class="col-md-6">
<?php foreach ($table as $table_row) { ?>
<ul class="timeline">
<?php foreach ($table as $table_row) { ?>
<li class="time-label"><span class="bg-blue"><?php echo $table_row['writedate'];?></span></li>
<li class="time-label">
<span class="bg-blue">
<?php echo $table_row['writedate'];?>
</span>
</li>
<!-- /.timeline-label -->
<!-- timeline item -->
<li>
<!-- timeline icon -->
<i class="fa fa-envelope bg-blue"></i>

View File

@ -37,18 +37,11 @@
</div><!-- ./col -->
<div class="col-md-6">
<?php foreach ($table as $table_row) { ?>
<ul class="timeline">
<!-- timeline time label -->
<li class="time-label">
<span class="bg-blue">
<?php echo $table_row['writedate'];?>
</span>
</li>
<!-- /.timeline-label -->
<!-- timeline item -->
<?php foreach ($table as $table_row) { ?>
<li class="time-label"><span class="bg-blue"><?php echo $table_row['writedate'];?></span></li>
<li>
<!-- timeline icon -->
<i class="fa fa-envelope bg-blue"></i>
<div class="timeline-item">
<h3 class="timeline-header"><?php echo $sprache->writer.': '.$table_row['writer'];?> ...</h3>
@ -57,9 +50,8 @@
</div>
</div>
</li>
<!-- END timeline item -->
</ul>
<?php } ?>
</ul>
</div><!-- ./col -->
</div>
</section>

View File

@ -88,26 +88,12 @@
<div class="col-md-12">
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title"><?php echo $voSprache->slots;?></h3>
<h3 class="box-title"><?php echo $voSprache->slots;?> + <?php echo $gsprache->traffic;?></h3>
</div>
<div class="box-body chart-responsive">
<div class="chart" id="slot-usage" style="height: 300px;"></div>
<div class="chart" id="usage-chart" style="height: 300px;"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="box box-info">
<div class="box-header">
<h3 class="box-title"><?php echo $gsprache->traffic;?></h3>
</div>
<div class="box-body chart-responsive">
<div class="chart" id="traffic-usage" style="height: 300px;"></div>
</div>
</div>
</div>
</div>
</section>