update admin view

This commit is contained in:
Malibu 2015-02-17 20:53:30 +01:00
parent f64fd23032
commit 6822c63274
2 changed files with 9 additions and 4 deletions

View File

@ -37,12 +37,11 @@ class AdminController extends Controller {
{ {
$user = new User; $user = new User;
$user->name = Input::get('firstname'); $user->firstname = Input::get('firstname');
$user->email = Input::get('email'); $user->email = Input::get('email');
$user->admin = 0; $user->admin = 0;
$user->city = Input::get('city');
$city = Input::get('city'); $user->lastname = Input::get('lastname');
$lastname = Input::get('lastname');
$user->save(); $user->save();
return redirect('/admin')->with('message', 'Referent ajouté avec succès'); return redirect('/admin')->with('message', 'Referent ajouté avec succès');

View File

@ -17,6 +17,7 @@
<td>Prénom</td> <td>Prénom</td>
<td>Mail</td> <td>Mail</td>
<td>Lieu</td> <td>Lieu</td>
<td>Type utilisateur</td>
<td>Se connecter</td> <td>Se connecter</td>
<td>Supprimer</td> <td>Supprimer</td>
</tr> </tr>
@ -28,6 +29,11 @@
<td>{{$user->firstname}}</td> <td>{{$user->firstname}}</td>
<td>{{$user->email}}</td> <td>{{$user->email}}</td>
<td>{{$user->city}}</td> <td>{{$user->city}}</td>
@if ($user->admin == 0)
<td>Référent</td>
@else
<td>Admin</td>
@endif
<td><a href="#" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-ok"></span></a></td> <td><a href="#" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-ok"></span></a></td>
<td><a href="#" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-trash"></span></a></td> <td><a href="#" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-trash"></span></a></td>
</tr> </tr>