
@extends('layouts.nav')
@section('title')
@endsection
@section('content')               


<div class="pagetitle">
      <h1>Users and Permissions </h1>
      
    </div><!-- End Page Title -->

    <section class="section">
      <div class="row">
        <div class="col-lg-12">
          @include("auth._messages")
          <div class="card">
            <div class="card-body">
              <h5 class="card-title">Users Table</h5>
                <a href="{{url('users/add')}}" style="float: right;margin-bottom: 12px;"  class="btn btn-primary"> Add New User</a>
                <br>
              <!-- Default Table -->
              <table style="margin-top: 12px;" class="table">
                <thead>
                  <tr>
                    <th scope="col">User Code</th>
                    <th scope="col">Full Name</th>
                    <th scope="col">National Id</th>
                    <th scope="col">Phone</th>
                    <th scope="col">Email</th>
                    <th scope="col">Address</th>
                    <th scope="col">Role</th>
                    <th scope="col">action</th>
                  </tr>
                </thead>
                <tbody>
                  @foreach ($getUsers as $user)
                  <tr>
                    <th scope="row">{{$user->UserCode}}</th>
                    <td>{{$user->FullName}}</td>
                    <td>{{$user->National_ID}}</td>
                    <td>{{$user->Phone}}</td>
                    <td>{{$user->email}}</td>
                    <td>{{$user->Address}}</td>
                    <td>{{$user->role_name}}</td>
                    <td> 
                      <a href="{{url('users/edit', $user->id)}}" class="btn btn-primary btn-sm">Edit</a>
                      <a href="{{url('users/delete', $user->id)}}" class="btn btn-danger btn-sm" >Delete</a>
                      <a href="{{url('users/permissions', $user->id)}}" class="btn btn btn-sm" >permissions</a>
                    </td>
                  </tr>
                  @endforeach
                </tbody>
              </table>
              <!-- End Default Table Example -->
            </div>
          </div>

         

        </div>

        
      </div>
    </section>
@endsection