@extends('superadmin.layout')
@section('content')
    <!-- begin::main content -->
    <main class="main-content">
        <div class="container">
            <!-- begin::page header -->
            <div class="page-header">
                <h3>View User</h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">Dashboard</a></li>
                        <li class="breadcrumb-item"><a href="{{ asset('users') }}">users</a></li>
                        <li class="breadcrumb-item active" aria-current="page">View User</li>
                    </ol>
                </nav>
            </div>
            <!-- end::page header -->
            <x-flashMessage />
            <div class="row">
                <div class="col-md-6">
                    <div class="card">
                        <div class="card-header">
                            <a href="{{ asset('users') }}" class="btn btn-primary pull-right  text-white"><i
                                    class="fa fa-list"></i>&nbsp;User List</a>
                        </div>
                        <div class="card-body">
                            <form>
                                <div class="form-group">
                                    <label for="username">Username</label>
                                    <input type="text" readonly class="form-control" name="username"
                                        value="{{ $user->name }}" id="username" placeholder="Enter User Name">

                                </div>
                                <div class="form-group">
                                    <label for="email">Email</label>
                                    <input type="email" readonly class="form-control" name="email"
                                        value="{{ $user->email }}" id="email" placeholder="Enter Email Name">

                                </div>
                                <div class="form-group">
                                    <label for="phone">Mobile (Optional)</label>
                                    <input readonly type="number" class="form-control" name="phone"
                                        value="{{ $user->phone }}" id="phone" placeholder="Enter Phone">

                                </div>
                                <div class="form-group">
                                    <label for="dob">DOB (Optional)</label>
                                    <input readonly type="date" class="form-control" name="dob"
                                        value="{{ $user->dob }}" id="dob" placeholder="Date of birth">
                                </div>

                                <div class="form-group">
                                    <label for="gender">Gender</label>
                                    <select class="form-control" name="gender" id="gender">
                                        <option {{ $user->gender == 'male' ? 'selected' : '' }} value="male">Male
                                        </option>
                                        <option {{ $user->gender == 'female' ? 'selected' : '' }} value="female">
                                            Female
                                        </option>
                                        <option {{ $user->gender == 'other' ? 'selected' : '' }} value="other">Other
                                        </option>
                                    </select>
                                </div>

                                <div class="form-group">

                                    <label for="institute">Role</label>
                                    <select disabled multiple id="js-example-basic-roles" name="role[]">
                                        <option></option>
                                        @if (!empty($roles))
                                            @foreach ($roles as $role)
                                                <option value="{{ $role->slug }}">{{ $role->name }}</option>
                                            @endforeach
                                        @endif
                                    </select>

                                    @if ($errors->has('role'))
                                        <div class="error">
                                            {{ $errors->first('role') }}
                                        </div>
                                    @endif
                                </div>

                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>
    <!-- end::main content -->
@endsection
@push('footer-script')
    <!-- begin::select2 -->
    <!-- begin::select2 -->
    <link rel="stylesheet" href="{{ asset('public/admin/vendors/select2/css/select2.min.css') }}" type="text/css">
    <!-- end::select2 -->
    <script src="{{ asset('public/admin/vendors/select2/js/select2.min.js') }}"></script>
    <script src="{{ asset('public/admin/js/examples/select2.js') }}"></script>
    <!-- end::select2 -->
    <script>
        $(document).ready(function() {
            $('#js-example-basic-roles').select2({});
            $('#js-example-basic-roles').val(@json($ur_roles));
            $('#js-example-basic-roles').trigger('change');

        });
    </script>
@endpush
