Esempio n. 1
0
use app\widgets\InfoBox;
use app\widgets\Table;
use machour\sparkline\Sparkline;
use yii\bootstrap\Progress;
$this->title = 'Dashboard';
$this->subTitle = 'Version 2.0';
$this->params['breadcrumbs'] = ['Dashboard'];
$this->registerCssFile('/plugins/jvectormap/jquery-jvectormap-1.2.2.css');
$this->registerJsFile('/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js', ['depends' => 'yii\\web\\YiiAsset']);
$this->registerJsFile('/plugins/jvectormap/jquery-jvectormap-world-mill-en.js', ['depends' => 'yii\\web\\YiiAsset']);
$this->registerJsFile('/plugins/chartjs/Chart.min.js', ['depends' => 'yii\\web\\YiiAsset']);
$this->registerJsFile('js/pages/dashboard2.js', ['depends' => 'yii\\web\\YiiAsset']);
$data = [['OR9842', 'Call of Duty IV', 'Shipped', 'success', [90, 80, 90, -70, 61, -83, 63], '#00a65a'], ['OR1848', 'Samsung Smart TV', 'Pending', 'warning', [90, 80, -90, 70, 61, -83, 68], '#f39c12'], ['OR7429', 'iPhone 6 Plus', 'Delivered', 'danger', [90, -80, 90, 70, -61, 83, 63], '#f56954'], ['OR7429', 'Samsung Smart TV', 'Processing', 'info', [90, 80, -90, 70, -61, 83, 63], '#00c0ef'], ['OR1848', 'Samsung Smart TV', 'Pending', 'warning', [90, 80, -90, 70, 61, -83, 68], '#f39c12'], ['OR7429', 'iPhone 6 Plus', 'Delivered', 'danger', [90, -80, 90, 70, -61, 83, 63], '#f56954'], ['OR9842', 'Call of Duty IV', 'Shipped', 'success', [90, 80, 90, -70, 61, -83, 63], '#00a65a']];
$models = [];
foreach ($data as $datum) {
    $models[] = ['Order ID' => Html::a($datum[0], ['site/index']), 'Item' => $datum[1], 'Status' => Html::aLabel($datum[2], $datum[3]), 'Popularity' => Sparkline::widget(['clientOptions' => ['type' => 'bar', 'height' => 20, 'barColor' => $datum[5]], 'data' => $datum[4]])];
}
$columns = ['Order ID:html', 'Item', 'Status:html', 'Popularity:raw'];
$salesChartData = ['labels' => ["January", "February", "March", "April", "May", "June", "July"], 'datasets' => [['label' => "Electronics", 'fillColor' => "rgb(210, 214, 222)", 'strokeColor' => "rgb(210, 214, 222)", 'pointColor' => "rgb(210, 214, 222)", 'pointStrokeColor' => "#c1c7d1", 'pointHighlightFill' => "#fff", 'pointHighlightStroke' => "rgb(220,220,220)", 'data' => [65, 59, 80, 81, 56, 55, 40]], ['label' => "Digital Goods", 'fillColor' => "rgba(60,141,188,0.9)", 'strokeColor' => "rgba(60,141,188,0.8)", 'pointColor' => "#3b8bba", 'pointStrokeColor' => "rgba(60,141,188,1)", 'pointHighlightFill' => "#fff", 'pointHighlightStroke' => "rgba(60,141,188,1)", 'data' => [28, 48, 40, 19, 86, 27, 90]]]];
$salesChartOptions = ['showScale' => true, 'scaleShowGridLines' => false, 'scaleGridLineColor' => "rgba(0,0,0,.05)", 'scaleGridLineWidth' => 1, 'scaleShowHorizontalLines' => true, 'scaleShowVerticalLines' => true, 'bezierCurve' => true, 'bezierCurveTension' => 0.3, 'pointDot' => false, 'pointDotRadius' => 4, 'pointDotStrokeWidth' => 1, 'pointHitDetectionRadius' => 20, 'datasetStroke' => true, 'datasetStrokeWidth' => 2, 'datasetFill' => true, 'legendTemplate' => "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].lineColor%>\"></span><%=datasets[i].label%></li><%}%></ul>", 'maintainAspectRatio' => true, 'responsive' => true];
?>

<div class="row">
    <div class="col-md-3 col-sm-6 col-xs-12">
        <?php 
echo InfoBox::widget(['text' => 'CPU TRAFFIC', 'number' => '90%', 'icon' => Html::ion('ios-gear-outline')]);
?>
    </div>

    <div class="col-md-3 col-sm-6 col-xs-12">
        <?php