diff --git a/controllers/PageController.php b/controllers/PageController.php index a54fa25..f2cf3f8 100644 --- a/controllers/PageController.php +++ b/controllers/PageController.php @@ -206,4 +206,50 @@ class PageController extends Controller )); } + static function actionStatus() + { + if (App::$user && App::$user->isAdmin == 1) { + self::$layout = 'layouts/page.php'; + self::addStyle('/css/style.css?ver=' . App::getConfig('version')); + self::addStyle('/css/pageStyle.css?ver=' . App::getConfig('version')); + self::addStyle('/css/bootstrap.min.css'); + self::addScript('/js/jquery-2.1.0.min.js'); + self::addScript('/js/bootstrap.min.js'); + + App::setConfig('title', 'Сводка по проекту'); + + $points = Point::model()->getCount(array( + 'where' => '`status` = "published" AND `categoryId` NOT IN ('. implode(',', Category::$paidIds).')', + )); + + $paidPoints = Point::model()->getCount(array( + 'where' => '`status` = "published" AND `categoryId` IN ('. implode(',', Category::$paidIds).')', + )); + + $notModeratedPoints = Point::model()->getCount(array( + 'where' => '`status` = "moderation"', + )); + + $articles = Article::model()->getCount(array( + 'where' => '`status` = "published"', + )); + + $comments = Comment::model()->getCount(); + + $users = User::model()->getCount(); + + self::render('page/status.php', array( + 'points' => $points, + 'paidPoints' => $paidPoints, + 'notModeratedPoints' => $notModeratedPoints, + 'articles' => $articles, + 'comments' => $comments, + 'users' => $users, + 'randomPoint' => Point::model()->getRandom(), + )); + } else { + App::error404(); + } + } + } diff --git a/views/page/status.php b/views/page/status.php new file mode 100644 index 0000000..a36d69d --- /dev/null +++ b/views/page/status.php @@ -0,0 +1,11 @@ +
+
+

Сводка по проекту

+ +

Точек:

+ Платных точек:
+ Точек на модерации:
+ Статей:
+ Комментариев:
+ Пользователей:
+
\ No newline at end of file