diff --git a/SRC/app/Http/Controllers/AdminController.php b/SRC/app/Http/Controllers/AdminController.php index db4a564..49be1eb 100755 --- a/SRC/app/Http/Controllers/AdminController.php +++ b/SRC/app/Http/Controllers/AdminController.php @@ -42,10 +42,10 @@ class AdminController extends Controller { $user->admin = 0; $user->city = Input::get('city'); $user->lastname = Input::get('lastname'); - $user->image = "./public/pictures/user_picture/default.png"; + $user->image = "pictures/user_picture/default.png"; $user->save(); - return redirect('/admin')->with('message', 'Referent ajouté avec succès'); + return redirect('/admin')->with('message_add', 'Referent ajouté avec succès'); } @@ -55,7 +55,10 @@ class AdminController extends Controller { */ public function deleteUser() { - // TODO + $idUser = Input::get('idUser'); + $user = User::find($idUser); + $user->delete(); + return redirect('/admin'); } } diff --git a/SRC/database/seeds/DatabaseSeeder.php b/SRC/database/seeds/DatabaseSeeder.php index 2a28a5b..8ec2700 100755 --- a/SRC/database/seeds/DatabaseSeeder.php +++ b/SRC/database/seeds/DatabaseSeeder.php @@ -32,7 +32,7 @@ class UserTableSeeder extends Seeder { 'city' => 'Montauban', 'email' => 'admin@admin.com', 'password' => Hash::make('admin'), - 'image' => '', + 'image' => 'pictures/user_picture/default.png', 'admin' => '1' ); @@ -45,7 +45,7 @@ class UserTableSeeder extends Seeder { 'city' => 'Toulouse', 'email' => 'ref@ref.com', 'password' => Hash::make('ref'), - 'image' => '', + 'image' => 'pictures/user_picture/default.png', 'admin' => '0' ); diff --git a/SRC/public/pictures/1.jpg b/SRC/public/pictures/1.jpg deleted file mode 100755 index 6dadcc0..0000000 Binary files a/SRC/public/pictures/1.jpg and /dev/null differ diff --git a/SRC/public/pictures/2.jpg b/SRC/public/pictures/2.jpg deleted file mode 100755 index 4844590..0000000 Binary files a/SRC/public/pictures/2.jpg and /dev/null differ diff --git a/SRC/public/pictures/3.jpg b/SRC/public/pictures/3.jpg deleted file mode 100755 index f938c7e..0000000 Binary files a/SRC/public/pictures/3.jpg and /dev/null differ diff --git a/SRC/public/pictures/4.jpg b/SRC/public/pictures/4.jpg deleted file mode 100755 index 585d2c6..0000000 Binary files a/SRC/public/pictures/4.jpg and /dev/null differ diff --git a/SRC/public/pictures/5.jpg b/SRC/public/pictures/5.jpg deleted file mode 100755 index 322e355..0000000 Binary files a/SRC/public/pictures/5.jpg and /dev/null differ diff --git a/SRC/public/pictures/6.jpg b/SRC/public/pictures/6.jpg deleted file mode 100755 index abb95f2..0000000 Binary files a/SRC/public/pictures/6.jpg and /dev/null differ diff --git a/SRC/resources/views/admin.blade.php b/SRC/resources/views/admin.blade.php index 43500cd..c1a081d 100755 --- a/SRC/resources/views/admin.blade.php +++ b/SRC/resources/views/admin.blade.php @@ -2,7 +2,8 @@ @section('content') -{{ Session::get('message') }} +{{ Session::get('message_add') }} +{{ Session::get('message_delete') }}
@@ -24,6 +25,9 @@ @foreach ($users as $user) +
+ + {{$user->lastname}} {{$user->firstname}} @@ -35,8 +39,9 @@ Admin @endif - +