fix <?php ?> to blade using
This commit is contained in:
parent
3c35527b1e
commit
759b6a240e
@ -1,5 +1,8 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use DB;
|
||||
use Auth;
|
||||
|
||||
class AdminController extends Controller {
|
||||
|
||||
|
||||
@ -20,7 +23,11 @@ class AdminController extends Controller {
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('admin', ['nameRoute' => 'Admin']);
|
||||
$email = Auth::user()->email;
|
||||
$me = DB::table('users')->where('email', $email)->first();
|
||||
$user = DB::table('users')->where('name','<>',"admin")->get();
|
||||
|
||||
return view('admin', ['nameRoute' => 'Admin', 'users' => $user, 'me' => $me]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use DB;
|
||||
use Auth;
|
||||
|
||||
class ReferentController extends Controller {
|
||||
|
||||
|
||||
@ -20,7 +23,9 @@ class ReferentController extends Controller {
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('referent', ['nameRoute' => 'Référent']);
|
||||
$email = Auth::user()->email;
|
||||
$me = DB::table('users')->where('email', $email)->first();
|
||||
return view('referent', ['nameRoute' => 'Référent', 'me' => $me]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,9 +2,6 @@
|
||||
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<div class="col-md-2"></div>
|
||||
|
||||
@ -20,22 +17,17 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$user = DB::table('users')->where('name','<>',"admin")->get();
|
||||
foreach ($user as $ref) {
|
||||
|
||||
?> <tr>
|
||||
<td><?php echo $ref->name; ?></td>
|
||||
<td><?php echo $ref->email; ?></td>
|
||||
@foreach ($users as $user)
|
||||
<tr>
|
||||
<td>{{$user->name}}></td>
|
||||
<td>{{$user->email}}</td>
|
||||
<td>Toulouse</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-default btn-sm">Se connecter</button>
|
||||
<button type="button" class="btn btn-warning btn-sm">Supprimer</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -1,14 +1,10 @@
|
||||
<?php
|
||||
$email = Auth::user()->email;
|
||||
$user = DB::table('users')->where('email', $email)->first();
|
||||
?>
|
||||
<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="50" weight="50" src="<?php echo $user->image; ?>"></img> </p>
|
||||
<p class="navbar-text"><?php echo $user->name; ?></p>
|
||||
<p class="navbar-text"><?php echo $user->email; ?></p>
|
||||
<p class="navbar-text"><img height="50" weight="50" src="{{$me->image}}"></img> </p>
|
||||
<p class="navbar-text">{{$me->name}}</p>
|
||||
<p class="navbar-text">{{$me->email}}</p>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="logout">Se déconnecter</a></li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user