This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/app/Controllers/Manage/OverviewController.php

53 lines
1,002 B
PHP
Raw Normal View History

2016-07-31 19:36:13 +00:00
<?php
/**
* Holds the overview controller.
* @package Sakura
*/
namespace Sakura\Controllers\Manage;
use Sakura\DB;
/**
* Overview controller.
* @package Sakura
* @author Julian van de Groep <me@flash.moe>
*/
class OverviewController extends Controller
{
2016-08-05 02:35:37 +00:00
/**
* Renders the base overview page.
* @return string
*/
2016-12-04 16:33:52 +00:00
public function index(): string
2016-07-31 19:36:13 +00:00
{
return view('manage/overview/index');
}
2016-08-05 02:35:37 +00:00
/**
* Gets the data for the overview page.
* @return string
*/
2016-12-04 16:33:52 +00:00
public function data(): string
2016-07-31 19:36:13 +00:00
{
$data = new \stdClass;
$data->postsCount = DB::table('posts')
->count();
$data->topicsCount = DB::table('topics')
->count();
$data->usersCount = DB::table('users')
->count();
$data->commentsCount = DB::table('comments')
->count();
$data->uploadsCount = DB::table('uploads')
->count();
return $this->json($data);
}
}