delete user
This commit is contained in:
parent
4a5dbde1c9
commit
75548c78f2
@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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'
|
||||
);
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 311 KiB |
Binary file not shown.
Before Width: | Height: | Size: 219 KiB |
Binary file not shown.
Before Width: | Height: | Size: 79 KiB |
Binary file not shown.
Before Width: | Height: | Size: 128 KiB |
Binary file not shown.
Before Width: | Height: | Size: 157 KiB |
Binary file not shown.
Before Width: | Height: | Size: 34 KiB |
@ -2,7 +2,8 @@
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Session::get('message') }}
|
||||
{{ Session::get('message_add') }}
|
||||
{{ Session::get('message_delete') }}
|
||||
|
||||
<br>
|
||||
<div class="col-md-2"></div>
|
||||
@ -24,6 +25,9 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($users as $user)
|
||||
<form method="POST" role="form" action="deleteUser">
|
||||
<input type="hidden" name="idUser" value="{{ $user->id }}">
|
||||
<input type="hidden" name="_token" value="{{{ csrf_token() }}}" />
|
||||
<tr style="background-color: #F6E3CE">
|
||||
<td>{{$user->lastname}}</td>
|
||||
<td>{{$user->firstname}}</td>
|
||||
@ -35,8 +39,9 @@
|
||||
<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-danger"><span class="glyphicon glyphicon-trash"></span></a></td>
|
||||
<td><button type="submit" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-trash"></span></a></td>
|
||||
</tr>
|
||||
</form>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@ -57,25 +62,25 @@
|
||||
<div class="form-group">
|
||||
<label for="firstname" class="col-sm-2 control-label">Prénom</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="firstname" name="firstname" placeholder="Prénom">
|
||||
<input type="text" class="form-control" id="firstname" name="firstname" required placeholder="Prénom">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lastname" class="col-sm-2 control-label">Nom</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="lastname" name="lastname" placeholder="Nom">
|
||||
<input type="text" class="form-control" id="lastname" name="lastname" required placeholder="Nom">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email" class="col-sm-2 control-label">Email</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" class="form-control" id="email" name="email" placeholder="Email">
|
||||
<input type="email" class="form-control" id="email" name="email" required placeholder="Email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="city" class="col-sm-2 control-label">Ville</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="city" name="city" placeholder="Ville">
|
||||
<input type="text" class="form-control" id="city" name="city" required placeholder="Ville">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -1,13 +1,19 @@
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">Espace {{ $nameRoute }}</a>
|
||||
<!-- <span class="glyphicon glyphicon-user" aria-hidden="true"></span> -->
|
||||
<p class="navbar-text"><img height="25" weight="25" src="{{$me->image}}"></img> </p>
|
||||
<p class="navbar-text">{{$me->firstname}}</p>
|
||||
<p class="navbar-text">{{$me->lastname}}</p>
|
||||
<p class="navbar-text">{{$me->email}}</p>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="logout">Se déconnecter</a></li>
|
||||
<li>
|
||||
<a href="logout">Se déconnecter</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="">Mes paramètres</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
Reference in New Issue
Block a user