@extends('admin.layouts.app')

@section('content')
@if (session('user_update_msg'))
<div class="alert alert-success">
    {{ session('user_update_msg') }}
</div>
@endif
<h2 class="mb-3">{{ awtTrans('تعديل العضو') }}</h2>
<div class="row mb-5">
    <div class="col-lg-12">
        {!! Form::model($user, ['method' => 'PATCH', 'route' => ['admin.users.update', $user->id], 'files'=>true]) !!}
        <div class="row">

            <div class="form-group col-lg-6">
                {!! Form::label('name_ar', awtTrans('Name Arabic')) !!}
                {!! Form::text('name_ar', null, ['class' => ($errors->has('name_ar')) ? 'form-control is-invalid' : 'form-control']) !!}
                <small class="text-danger">{{ $errors->first('name_ar') }}</small>
            </div>

            <div class="form-group col-lg-6">
                {!! Form::label('name_en', awtTrans('Name English')) !!}
                {!! Form::text('name_en', null, ['class' => ($errors->has('name_en')) ? 'form-control is-invalid' : 'form-control']) !!}
                <small class="text-danger">{{ $errors->first('name_en') }}</small>
            </div>

        </div>


        <div class="row">

            <div class="form-group col-lg-6">
                {!! Form::label('job_title_ar', awtTrans('Job Title Arabic')) !!}
                {!! Form::text('job_title_ar', null, ['class' => ($errors->has('job_title_ar')) ? 'form-control is-invalid' : 'form-control']) !!}
                <small class="text-danger">{{ $errors->first('job_title_ar') }}</small>
            </div>

            <div class="form-group col-lg-6">
                {!! Form::label('job_title_en', awtTrans('Job Title English')) !!}
                {!! Form::text('job_title_en', null, ['class' => ($errors->has('job_title_en')) ? 'form-control is-invalid' : 'form-control']) !!}
                <small class="text-danger">{{ $errors->first('job_title_en') }}</small>
            </div>

        </div>

        <div class="text-right float-right">
            <a href="{{ route('admin.users.index') }}" class="btn btn-info px-4 mr-2">{{ awtTrans('الكل') }}</a>
            {!! Form::submit(awtTrans('Update'), ['class' => 'btn btn-success']) !!}
        </div>
        {!! Form::close() !!}

    </div>

</div>


<!-- Modal -->
<div class="modal fade" id="deleteModal" tabindex="-1" aria-labelledby="deleteModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="deleteModalLabel">Delete User</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                Are you sure? You wanna delete?
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
                {!! Form::open(['method' => 'DELETE', 'route' => ['admin.users.destroy', $user->id]]) !!}
                {!! Form::submit('Confirm', ['class' => 'btn btn-danger']) !!}
                {!! Form::close() !!}
            </div>
        </div>
    </div>
</div>


@endsection