Skip to content

Commit

Permalink
Added additonal information
Browse files Browse the repository at this point in the history
  • Loading branch information
canvasowl committed Sep 15, 2016
1 parent 2beb02c commit d488c61
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
18 changes: 16 additions & 2 deletions app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

namespace App\Http\Controllers;
use App\Client;
use App\Project;
use App\Task;
use Illuminate\Support\Facades\Auth;

use App\User;
Expand All @@ -19,8 +22,19 @@ public function index(){
}

$users = User::all();
$n = count($users);
return View::make('admin/index')->with('pTitle', 'Admin')->with('users', $users)->with('n', $n);
$n_users = count($users);
$n_tasks = Task::all()->count();
$n_projects = Project::all()->count();
$n_clients = Client::all()->count();

return View::make('admin/index')
->with('pTitle', 'Admin')
->with('users', $users)
->with('n_users', $n_users)
->with('n_tasks', $n_tasks)
->with('n_projects', $n_projects)
->with('n_clients', $n_clients);

}

}
6 changes: 5 additions & 1 deletion resources/views/admin/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<div class="row">
<div class="col-xs-12">
<h1>Admin</h1>
<p>Number of users: <span class="badge">{{ $n }}</span></p>
<p>Number of users: <span class="badge">{{ $n_users }}</span></p>
<p>Number of clients: <span class="badge">{{ $n_clients }}</span></p>
<p>Number of projects: <span class="badge">{{ $n_projects }}</span></p>
<p>Number of tasks: <span class="badge">{{ $n_tasks }}</span></p>

<table class="table table-striped">
<thead>
<tr>
Expand Down

0 comments on commit d488c61

Please sign in to comment.