From 491af90f0fec34b7523a26fb45204cc2b3802d7c Mon Sep 17 00:00:00 2001 From: Malibu Date: Tue, 17 Feb 2015 20:33:32 +0100 Subject: [PATCH] up --- SRC/app/Http/Controllers/AdminController.php | 25 ++++++++++++++++---- SRC/app/Http/routes.php | 4 ++-- SRC/resources/views/admin.blade.php | 22 ++++++++++++----- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/SRC/app/Http/Controllers/AdminController.php b/SRC/app/Http/Controllers/AdminController.php index 7cd8241..1ade79b 100755 --- a/SRC/app/Http/Controllers/AdminController.php +++ b/SRC/app/Http/Controllers/AdminController.php @@ -1,6 +1,7 @@ name = Input::get('firstname'); + $user->email = Input::get('email'); + $user->admin = 0; + $city = Input::get('city'); - //print('ok'); + $lastname = Input::get('lastname'); + + $user->save(); + return redirect('/admin')->with('message', 'Referent ajouté avec succès'); + } + + + /** + * Delete an user + * + */ + public function deleteUser() + { + // TODO } } diff --git a/SRC/app/Http/routes.php b/SRC/app/Http/routes.php index 8248a8a..19f178e 100755 --- a/SRC/app/Http/routes.php +++ b/SRC/app/Http/routes.php @@ -33,5 +33,5 @@ Route::group(['middleware' => 'admin'], function () { Route::get('admin', 'AdminController@index'); Route::post('addUser', 'AdminController@addUser'); -}); - + Route::post('deleteUser', 'AdminController@deleteUser'); +}); \ No newline at end of file diff --git a/SRC/resources/views/admin.blade.php b/SRC/resources/views/admin.blade.php index 080053d..dc9499a 100755 --- a/SRC/resources/views/admin.blade.php +++ b/SRC/resources/views/admin.blade.php @@ -2,6 +2,8 @@ @section('content') +{{ Session::get('message') }} +
@@ -42,6 +44,7 @@
+