@extends('layouts.admin')

@section('title', 'ویرایش کاربر')

@section('content')
<div class="row clearfix">
    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
        <div class="card">
            <div class="header">
                <h2>ویرایش کاربر: {{ $user->full_name }}</h2>
            </div>
            <div class="body">
                <form action="{{ route('admin.users.update', $user) }}" method="POST">
                    @csrf
                    @method('PUT')

                    <div class="form-group form-float">
                        <div class="form-line">
                            <input type="text" class="form-control" name="full_name" value="{{ old('full_name', $user->full_name) }}" required>
                            <label class="form-label">نام کامل</label>
                        </div>
                    </div>

                    <div class="form-group form-float">
                        <div class="form-line">
                            <input type="email" class="form-control" name="email" value="{{ old('email', $user->email) }}" required>
                            <label class="form-label">ایمیل</label>
                        </div>
                    </div>

                    <div class="form-group form-float">
                        <div class="form-line">
                            <input type="text" class="form-control" name="phone" value="{{ old('phone', $user->phone) }}">
                            <label class="form-label">تلفن</label>
                        </div>
                    </div>

                    <div class="form-group">
                        <label>وضعیت</label>
                        <select class="form-control show-tick" name="status">
                            <option value="active" {{ $user->status == 'active' ? 'selected' : '' }}>فعال</option>
                            <option value="inactive" {{ $user->status == 'inactive' ? 'selected' : '' }}>غیرفعال</option>
                            <option value="banned" {{ $user->status == 'banned' ? 'selected' : '' }}>مسدود</option>
                            <option value="pending" {{ $user->status == 'pending' ? 'selected' : '' }}>در انتظار</option>
                        </select>
                    </div>

                    <button type="submit" class="btn btn-primary m-t-15 waves-effect">ذخیره تغییرات</button>
                    <a href="{{ route('admin.users.index') }}" class="btn btn-default m-t-15 waves-effect">بازگشت</a>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection
