diff --git a/SRC/app/Http/Controllers/AdminController.php b/SRC/app/Http/Controllers/AdminController.php index f577628..00b16c4 100755 --- a/SRC/app/Http/Controllers/AdminController.php +++ b/SRC/app/Http/Controllers/AdminController.php @@ -45,7 +45,7 @@ class AdminController extends Controller { $user->image = "pictures/user_picture/default.png"; $user->save(); - return redirect('/admin')->with('message_add', 'Referent ajouté avec succès'); + return redirect('/admin')->with('message_add', 'User ajouté avec succès'); } @@ -66,7 +66,7 @@ class AdminController extends Controller { //$user->image = "pictures/user_picture/default.png"; $user->save(); - return redirect('/admin')->with('message_update', 'Referent mis à jour avec succès'); + return redirect('/admin')->with('message_update', 'User mis à jour avec succès'); } @@ -79,7 +79,7 @@ class AdminController extends Controller { $idUser = Input::get('idUser'); $user = User::find($idUser); $user->delete(); - return redirect('/admin')->with('message_delete', 'Referent supprimé avec succès'); + return redirect('/admin')->with('message_delete', 'User supprimé avec succès'); } } diff --git a/SRC/app/Http/Controllers/ReferentController.php b/SRC/app/Http/Controllers/ReferentController.php index c0599a8..2cbe27b 100755 --- a/SRC/app/Http/Controllers/ReferentController.php +++ b/SRC/app/Http/Controllers/ReferentController.php @@ -1,6 +1,7 @@ 'Référent', 'me' => $me]); } + /** + * updateUser an user in database. + * + * + */ + public function update() + { + $user = User::find(Input::get('idUser')); + + $user->firstname = Input::get('firstname'); + $user->email = Input::get('email'); + $user->city = Input::get('city'); + $user->lastname = Input::get('lastname'); + + $user->save(); + return redirect('/referent')->with('message_update', 'Referent mis à jour avec succès'); + } + } diff --git a/SRC/app/Http/routes.php b/SRC/app/Http/routes.php index ae401ab..44f365c 100755 --- a/SRC/app/Http/routes.php +++ b/SRC/app/Http/routes.php @@ -27,6 +27,7 @@ Route::group(['middleware' => 'auth'], function () { Route::get('referent', 'ReferentController@index'); Route::get('logout', 'LoginController@logout'); + Route::post('update', 'ReferentController@update'); }); Route::group(['middleware' => 'admin'], function () diff --git a/SRC/resources/views/navbar_signed.blade.php b/SRC/resources/views/navbar_signed.blade.php index 41c5591..a29b126 100755 --- a/SRC/resources/views/navbar_signed.blade.php +++ b/SRC/resources/views/navbar_signed.blade.php @@ -14,7 +14,7 @@
  • Mes paramètres
  • - + @@ -27,7 +27,7 @@ -
    + droits == 0) action="update" @else action="updateUser" @endif>