PATH:
home
/
letacommog
/
letaweb
/
protected
/
modules
/
admin
/
views
/
dashboard
<div class=""> <div class="row"> <div class="col-md-12"> <ul class="topstats clearfix"> <li class="col-md-1"> </li> <li class="col-md-2"> <span class="title"> Today Profit </span> <h3><?php echo $today_profit; ?></h3> </li> <li class="col-md-2"> <span class="title"> Today sites </span> <h3><?php echo $today_site_count; ?></h3> </li> <li class="col-md-2"> <span class="title"> Total Profit </span> <h3><?php echo $total_profit; ?></h3> </li> <li class="col-md-2"> <span class="title"> Total sites </span> <h3><?php echo $total_site_count; ?></h3> </li> <li class="col-md-2"> <span class="title"> Total Users </span> <h3><?php echo $total_user_count; ?></h3> </li> <li class="col-md-1"> </li> </ul> </div> </div> <div class="row"> <div class="col-md-6"> <div class="panel panel-widget"> <?php $plans = Plan::model()->findAll(); $seriesData = array(); foreach ($plans as $plan) { $siteCount = Site::model()->count('plan_id=:plan_id', array(':plan_id'=>$plan->id)); $seriesData[] = array( 'name'=>$plan->name, 'y'=>$total_site_count > 0 ? (($siteCount / $total_site_count) * 100) : 0 ); } $this->widget( 'ext.yiibooster.widgets.TbHighCharts', array( 'options' => array( 'chart' => array( 'plotBackgroundColor' => 'white', 'plotBorderWidth' => 'null', 'plotShadow' => false, 'type' => 'pie' ), 'title' => array( 'text' => 'Website by Plans' ), 'tooltip' => array( 'pointFormat' => '{series.name}: <b>{point.percentage:.1f}%</b>' ), 'plotOptions' => array( 'pie' => array( 'cursor' => 'pointer', 'dataLabels' => array( 'enabled' => true, 'format' => '<b>{point.name}</b>: {point.percentage:.1f} %', 'style' => array( 'color' => "(Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'" ) ), 'showInLegend' => true ) ), 'series' => array( array('name'=>'Total', 'colorByPoint' => true,'data' => $seriesData), ) ) ) ); ?> </div> </div> <div class="col-md-6"> <div class="panel panel-widget"> <?php $plans = Plan::model()->findAll(); $seriesData = array(); foreach ($plans as $plan) { $profitPlan = Yii::app()->db->createCommand() ->select('sum(amount) as cnt') ->from(Purchase::model()->tableSchema->name.' as purchase') ->join(Subscription::model()->tableSchema->name.' as subscription', 'purchase.subscription_id=subscription.id') ->where('subscription.plan_id=:plan_id', array(':plan_id'=>$plan->id) ) ->queryScalar(); $seriesData[] = array( 'name'=>$plan->name, 'y'=>$total_profit > 0 ? (($profitPlan / $total_profit) * 100) : 0 ); } $this->widget( 'ext.yiibooster.widgets.TbHighCharts', array( 'options' => array( 'chart' => array( 'plotBackgroundColor' => 'white', 'plotBorderWidth' => 'null', 'plotShadow' => false, 'type' => 'pie' ), 'title' => array( 'text' => 'Profit by Plans' ), 'tooltip' => array( 'pointFormat' => '{series.name}: <b>{point.percentage:.1f}%</b>' ), 'plotOptions' => array( 'pie' => array( 'cursor' => 'pointer', 'dataLabels' => array( 'enabled' => true, 'format' => '<b>{point.name}</b>: {point.percentage:.1f} %', 'style' => array( 'color' => "(Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'" ) ), 'showInLegend' => true ) ), 'series' => array( array('name'=>'Total', 'colorByPoint' => true,'data' => $seriesData), ) ) ) ); ?> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="panel panel-widget"> <?php $visit_per_days = Yii::app()->db->createCommand() ->select('COUNT(*) as cnt,day(date_added) AS dateVar') ->from(Site::model()->tableSchema->name) ->where('date_added >= :start_month and date_added <= :end_month', array(':end_month'=>date('Y-m-t 00:00:00'), ':start_month'=>date('Y-m-01 00:00:00')) ) ->group('date(date_added)') ->queryAll(); $seriesData = array(); $months = array(); for ($i=1;$i <= 31;$i++) { $months[] = $i; $seriesData[$i-1] = 0; foreach ($visit_per_days as $visit_per_day) { if($visit_per_day['dateVar'] == $i) $seriesData[$i-1] = (int)$visit_per_day['cnt']; } } $this->widget( 'ext.yiibooster.widgets.TbHighCharts', array( 'options' => array( 'chart' => array( 'type' => 'line' ), 'title' => array( 'text' => 'Site registered this month' ), 'plotOptions' => array( 'line' => array( 'dataLabels' => array( 'enabled' => true ), 'enableMouseTracking' => false ) ), 'legend' => array( 'enabled' => false ), 'xAxis' => array( 'categories' => $months ), 'yAxis' => array( 'title' => array( ), 'min' => 0 ), 'series' => array( array('name' => '','data' => $seriesData), ) ) ) ); ?> </div> </div> </div> <div class="row"> <div class="col-md-8"> <div class="panel panel-widget"> <?php $earning_per_days = Yii::app()->db->createCommand() ->select('sum(amount) as cnt,day(date_added) AS dateVar') ->from(Purchase::model()->tableSchema->name) ->where('date_added >= :start_month and date_added <= :end_month', array(':end_month'=>date('Y-m-t 00:00:00'), ':start_month'=>date('Y-m-01 00:00:00')) ) ->group('date(date_added)') ->queryAll(); $seriesData = array(); $months = array(); for ($i=1;$i <= 31;$i++) { $months[] = $i; $seriesData[$i-1] = 0; foreach ($earning_per_days as $earning_per_day) { if($earning_per_day['dateVar'] == $i) $seriesData[$i-1] = (int)$earning_per_day['cnt']; } } $this->widget( 'ext.yiibooster.widgets.TbHighCharts', array( 'options' => array( 'chart' => array( 'type' => 'line' ), 'title' => array( 'text' => 'Profit this month' ), 'plotOptions' => array( 'line' => array( 'dataLabels' => array( 'enabled' => true ), 'enableMouseTracking' => false ) ), 'legend' => array( 'enabled' => false ), 'xAxis' => array( 'categories' => $months ), 'yAxis' => array( 'title' => array( ), 'min' => 0 ), 'series' => array( array('name' => '','data' => $seriesData), ) ) ) ); ?> </div> </div> <div class="col-md-4"> <div class="panel panel-widget"> <div class="panel-title"> <h5>Recently Added Sites</h5> </div> <div class="panel-body"> <?php $columns = array( array( 'header' => CHtml::encode('Name'), 'name' => 'name', ), array( 'header' => CHtml::encode('Plan'), 'name' => 'plan.name', 'filter' => CHtml::activeDropDownList($siteModel, 'plan_id', CHtml::listData( Plan::model()->findAll(), 'id', 'name'), array('empty' => 'Select all') ), ), array( 'header' => CHtml::encode('Date added'), 'name' => 'date_added', 'value' => 'date("Y-m-d",strtotime($data->date_added))', ), ); $form = $this->beginWidget('CActiveForm', array( 'enableAjaxValidation' => true, )); $this->widget('zii.widgets.grid.CGridView', array( 'id' => 'site-grid', 'dataProvider' => $siteModel->search(), 'columns' => $columns, 'enablePagination' => false, 'itemsCssClass' => 'table display dataTable', )); ?> <?php $this->endWidget(); ?> </div> </div> </div> </div> </div>
[+]
..
[-] midnav.php
[edit]
[-] index.php
[edit]