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

<div class="pagetitle">
      <h1>Edit User</h1>
      
    </div><!-- End Page Title -->
    <section class="section">
      <div class="row">
       
        <div class="col-lg-6">

 
          <div class="card">
            <div class="card-body">
              <h5 class="card-title">Users</h5>
                @if($errors->any())
                    <div class="alert alert-danger">
                        <ul>
                            @foreach($errors->all() as $error)
                                <li>{{ $error }}</li>
                            @endforeach
                        </ul>
                    </div>
                @endif
              <!-- No Labels Form -->
              <form action="" style="display:flex; flex-direction:column; gap:20px;" class="row g-3" method="POST">
               {{csrf_field()}}

               
                <div class="col-md-8">
                  <input type="full_name" name="full_name" class="form-control" value="{{$getUser->FullName}}" placeholder="Full Name">
                </div>
                <div class="col-md-8">
                  <input type="text" name="national_id" class="form-control" value="{{$getUser->National_ID}}" placeholder="National ID">
                </div>
                <div class="col-md-8">
                  <input type="text" name="user_code" class="form-control" value="{{$getUser->UserCode}}" placeholder="User Code">
                </div>
                <div class="col-md-8">
                  <input type="email" name="email" class="form-control" readonly value="{{$getUser->email}}" placeholder="Email">
                </div>
                <div class="col-md-8">
                  <input type="text" name="phone" class="form-control" value="{{$getUser->Phone}}" placeholder="Phone Number">
                </div>
                <div class="col-md-8">
                    <input type="text" name="address" class="form-control" value="{{$getUser->Address}}" placeholder="Address">
                </div>
                
                <div class="col-md-8">
                  <select class="form-control" name="role_id" id="">
                    <option disabled  readonly>
                      Role
                    </option>
                      
                    @foreach ($getRole as $role)
                      <option {{ ($getUser->role_id == $role->id) ? 'selected' :''}} value="{{$role->id}}">
                          {{$role->name}}
                        </option>
                    @endforeach
                  </select>
                </div>
                <div class="col-md-6">
                  <input type="password" name="password" class="form-control" placeholder="Password">
                </div>
               
                
                <div style="padding-left: 15px; display:flex; gap:20px;" class="">
                    <button type="reset" class="btn btn-secondary">Reset</button>
                  <button type="submit" class="btn btn-primary">Submit</button>
                </div>
              </for><!-- End No Labels Form -->

            </div>
          </div>

        

        </div>
      </div>
    </section>

@endsection