|
@@ -49,10 +49,39 @@
|
|
$authors = Yii::$app->db->createCommand("select e, count(e) as c from (SELECT SUBSTRING_INDEX(`editors`,',',1) as e FROM `news` WHERE `dt_pub` BETWEEN '".$b_date."' AND '".$e_date."' and active = 'Y') t where 1 group by e order by e")->queryAll();
|
|
$authors = Yii::$app->db->createCommand("select e, count(e) as c from (SELECT SUBSTRING_INDEX(`editors`,',',1) as e FROM `news` WHERE `dt_pub` BETWEEN '".$b_date."' AND '".$e_date."' and active = 'Y') t where 1 group by e order by e")->queryAll();
|
|
$old_author_name = ['kondakov' => 'Вячеслав Кондаков*','bers'=>'Евгений Берсенёв','kuznecov' =>'Артём Кузнецов*', 'katya'=>'Екатерина Смолихина*', 'elena'=>'Елена Лепезина*', 'cherdanceva'=>'Александра Черданцева*'];
|
|
$old_author_name = ['kondakov' => 'Вячеслав Кондаков*','bers'=>'Евгений Берсенёв','kuznecov' =>'Артём Кузнецов*', 'katya'=>'Екатерина Смолихина*', 'elena'=>'Елена Лепезина*', 'cherdanceva'=>'Александра Черданцева*'];
|
|
|
|
|
|
- //select count(id) from news as n, news_topic_relation as tr WHERE dt_pub > "'. date("Y-m-d").'" AND dt_pub < now() and n.id = tr.news_id group by tr.topic_id'
|
|
|
|
|
|
+// рубрики заполнены
|
|
$rubric = Yii::$app->db->createCommand("select count(tr.topic_id) as c, nt.title as t from news as n, news_topic_relation as tr, news_topic as nt where `dt_pub` BETWEEN '".$b_date."' AND '".$e_date."' and n.active = 'Y' and n.id = tr.news_id and tr.topic_id = nt.id and nt.`active`=1 and nt.`show`='Y' group by tr.topic_id")->queryAll();
|
|
$rubric = Yii::$app->db->createCommand("select count(tr.topic_id) as c, nt.title as t from news as n, news_topic_relation as tr, news_topic as nt where `dt_pub` BETWEEN '".$b_date."' AND '".$e_date."' and n.active = 'Y' and n.id = tr.news_id and tr.topic_id = nt.id and nt.`active`=1 and nt.`show`='Y' group by tr.topic_id")->queryAll();
|
|
|
|
+// количество рубрик
|
|
$crubric = Yii::$app->db->createCommand("select count(id) as c from news_topic where `active`=1 and `show`='Y'")->queryOne();
|
|
$crubric = Yii::$app->db->createCommand("select count(id) as c from news_topic where `active`=1 and `show`='Y'")->queryOne();
|
|
$sumr = $crubric['c'];
|
|
$sumr = $crubric['c'];
|
|
|
|
+
|
|
|
|
+ $cnews = Yii::$app->db->createCommand("select count(id) as c from news where `dt_pub` BETWEEN '".$b_date."' AND '".$e_date."' and active = 'Y'")->queryOne();
|
|
|
|
+ $cntnews = $cnews['c'];
|
|
|
|
+
|
|
|
|
+ $cnewsp = Yii::$app->db->createCommand("select count(id) as c from news where `dt_pub` BETWEEN DATE_SUB('".$b_date."', INTERVAL 1 MONTH) AND DATE_SUB('".$e_date."', INTERVAL 1 MONTH) and active = 'Y'")->queryOne();
|
|
|
|
+ $cntnewsp = $cnewsp['c'];
|
|
|
|
+
|
|
|
|
+ $cnewsy = Yii::$app->db->createCommand("select count(id) as c from news where `dt_pub` BETWEEN '".$y."-01-01 00:00:00' AND '".$e_date."' and active = 'Y'")->queryOne();
|
|
|
|
+ $cntnewsy = $cnewsy['c'];
|
|
|
|
+
|
|
|
|
+ $cnewsyy = Yii::$app->db->createCommand("select count(id) as c from news where `dt_pub` BETWEEN DATE_SUB('".$b_date."', INTERVAL 1 YEAR) AND '".$e_date."' and active = 'Y'")->queryOne();
|
|
|
|
+ $cntnewsyy = $cnewsyy['c'];
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $now = time();
|
|
|
|
+ $ndate = strtotime( $y."-01-01");
|
|
|
|
+ $datediff = $now - $ndate;
|
|
|
|
+ $daysp = round($datediff / (60 * 60 * 24));
|
|
|
|
+
|
|
|
|
+ $edate = strtotime( $y."-12-31");
|
|
|
|
+ $datediff = $now - $edate;
|
|
|
|
+ $dayso = -round($datediff / (60 * 60 * 24));
|
|
|
|
+
|
|
|
|
+ $newsinterpolite = round($cntnewsy*$dayso/$daysp);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// echo $cntnewsp;
|
|
?>
|
|
?>
|
|
<section class="content dark-mode">
|
|
<section class="content dark-mode">
|
|
<div class="container-fluid">
|
|
<div class="container-fluid">
|
|
@@ -80,9 +109,9 @@ echo 100-$out[0]*1;
|
|
|
|
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box mb-3">
|
|
<div class="info-box mb-3">
|
|
-<span class="info-box-icon bg-danger elevation-1"><i class="fas fa-thumbs-up"></i></span>
|
|
|
|
|
|
+<span class="info-box-icon bg-warning elevation-1"><i class="fas fa-users"></i></span>
|
|
<div class="info-box-content">
|
|
<div class="info-box-content">
|
|
-<span class="info-box-text">Запросов</span>
|
|
|
|
|
|
+<span class="info-box-text">Запросов в секунду</span>
|
|
<span class="info-box-number">
|
|
<span class="info-box-number">
|
|
<?
|
|
<?
|
|
$str = "wget -q -O - http://localhost/nginx_status |grep 'Active connections:'";
|
|
$str = "wget -q -O - http://localhost/nginx_status |grep 'Active connections:'";
|
|
@@ -101,7 +130,7 @@ $s = explode(':',$out[0]);
|
|
<div class="clearfix hidden-md-up"></div>
|
|
<div class="clearfix hidden-md-up"></div>
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box mb-3">
|
|
<div class="info-box mb-3">
|
|
-<span class="info-box-icon bg-success elevation-1"><i class="fas fa-shopping-cart"></i></span>
|
|
|
|
|
|
+<span class="info-box-icon bg-success elevation-1"><i class="fas fa-thumbs-up"></i></span>
|
|
<div class="info-box-content">
|
|
<div class="info-box-content">
|
|
<span class="info-box-text">Наибольшее число новостей</span>
|
|
<span class="info-box-text">Наибольшее число новостей</span>
|
|
<span class="info-box-number"><?=$max?></span>
|
|
<span class="info-box-number"><?=$max?></span>
|
|
@@ -113,7 +142,7 @@ $s = explode(':',$out[0]);
|
|
|
|
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box mb-3">
|
|
<div class="info-box mb-3">
|
|
-<span class="info-box-icon bg-warning elevation-1"><i class="fas fa-users"></i></span>
|
|
|
|
|
|
+<span class="info-box-icon bg-danger elevation-1"><i class="fas fa-thumbs-down"></i></span>
|
|
<div class="info-box-content">
|
|
<div class="info-box-content">
|
|
<span class="info-box-text">Минимум новостей</span>
|
|
<span class="info-box-text">Минимум новостей</span>
|
|
<span class="info-box-number"><?=$min?></span>
|
|
<span class="info-box-number"><?=$min?></span>
|
|
@@ -177,7 +206,7 @@ $s = explode(':',$out[0]);
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="progress-group">
|
|
<div class="progress-group">
|
|
-<span class="progress-text">усреднее число новостей</span>
|
|
|
|
|
|
+<span class="progress-text">среднее число новостей</span>
|
|
<span class="float-right"><b><?=round($sum/count($cmd))?></b>/<?=$max?></span>
|
|
<span class="float-right"><b><?=round($sum/count($cmd))?></b>/<?=$max?></span>
|
|
<div class="progress progress-sm">
|
|
<div class="progress progress-sm">
|
|
<div class="progress-bar bg-success" style="width: <?=round($sum/count($cmd)*100/$max)?>%"></div>
|
|
<div class="progress-bar bg-success" style="width: <?=round($sum/count($cmd)*100/$max)?>%"></div>
|
|
@@ -196,6 +225,47 @@ $s = explode(':',$out[0]);
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+<div class="card-footer">
|
|
|
|
+<div class="row">
|
|
|
|
+<div class="col-sm-3 col-6">
|
|
|
|
+<div class="description-block border-right">
|
|
|
|
+<span class="description-percentage <?=$cntnews-$cntnewsp>0?'text-success':'text-danger'?>" title="От предыдущего месяца <?=$cntnewsp?>"><i class="fas <?=$cntnews-$cntnewsp>0?'fa-caret-up':'fa-caret-down'?>"></i><?=round(($cntnews-$cntnewsp)*100/$cntnewsp, 1)?>%</span>
|
|
|
|
+<h5 class="description-header"><?=$cntnews?></h5>
|
|
|
|
+<span class="description-text">Всего новостей за месяц</span>
|
|
|
|
+</div>
|
|
|
|
+
|
|
|
|
+</div>
|
|
|
|
+
|
|
|
|
+<div class="col-sm-3 col-6">
|
|
|
|
+<div class="description-block border-right">
|
|
|
|
+<span class="description-percentage <?=$cntnewsy-$cntnewsyy>0?'text-success':'text-danger'?>" title="До конца года <?=$cntnewsyy?>"><i class="fas <?=$cntnewsy-$cntnewsyy>0?'fa-caret-up':'fa-caret-down'?>"></i><?=round(($cntnewsy-$cntnewsyy)*100/$cntnewsyy, 1)?>%</span>
|
|
|
|
+<h5 class="description-header"><?=$cntnewsy?></h5>
|
|
|
|
+<span class="description-text">Новостей сначала года</span>
|
|
|
|
+</div>
|
|
|
|
+
|
|
|
|
+</div>
|
|
|
|
+
|
|
|
|
+<div class="col-sm-3 col-6">
|
|
|
|
+<div class="description-block border-right">
|
|
|
|
+<span class="description-percentage text-success"><i class="fas fa-caret-up"></i> 0%</span>
|
|
|
|
+<h5 class="description-header"><?=$cntnewsyy?></h5>
|
|
|
|
+<span class="description-text">За 365 дней</span>
|
|
|
|
+</div>
|
|
|
|
+
|
|
|
|
+</div>
|
|
|
|
+
|
|
|
|
+<div class="col-sm-3 col-6">
|
|
|
|
+<div class="description-block">
|
|
|
|
+<span class="description-percentage text-danger" title="От прошлого года"><i class="fas <?=($newsinterpolite+$cntnewsy)-$cntnewsyy>0?'text-success':'text-danger'?>"></i><i class="fas <?=($newsinterpolite+$cntnewsy)-$cntnewsyy>0?'fa-caret-up':'fa-caret-down'?>"></i><?=round((($newsinterpolite+$cntnewsy)-$cntnewsyy)*100/$cntnewsyy, 1)?>%</span>
|
|
|
|
+<h5 class="description-header"><?=$newsinterpolite+$cntnewsy?></h5>
|
|
|
|
+<span class="description-text">Будет новостей за этот год</span>
|
|
|
|
+</div>
|
|
|
|
+
|
|
|
|
+</div>
|
|
|
|
+</div>
|
|
|
|
+
|
|
|
|
+</div>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|