@extends('dashboard.layouts.app')

@section('content')

<div class="row layout-top-spacing">
    <div class="col-lg-12">
        @if(Session::has('success'))
                <div class="alert alert-light-success alert-dismissible fade show border-0 mb-4" role="alert">
                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x close" data-bs-dismiss="alert"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button>
                    {{ Session::get('success') }}
                </div>
            @endif

            @if(Session::has('error'))
                <div class="alert alert-light-danger alert-dismissible fade show border-0 mb-4" role="alert">
                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x close" data-bs-dismiss="alert"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button>
                    {{ Session::get('error') }}
                </div>
            @endif

        <div class="statbox widget box box-shadow">
            <div class="widget-header">
                <div class="row">
                    <div class="col-xl-12 col-md-12 col-sm-12 col-12">
                        <h4>Update Team Member ({{ $team->name_en }})</h4>
                    </div>                 
                </div>
            </div>

            <div class="widget-content widget-content-area">
                <div class="row">
                    <div class="col-lg-12 col-12 ">
                        <form action="{{ route('about_us.teams.update', ['team' => $team->id]) }}" method="post" enctype="multipart/form-data">
                            @method('PUT')
                            @csrf

                            <div class="form-group mb-4">
                                <label>Name En:</label>
                                <input type="text" name="name_en" class="form-control @error('name_en') is-invalid @enderror" value="{{ old('name_en', $team->name_en) }}" placeholder="team name in english">
                                @error('name_en')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>
                            <div class="form-group mb-4">
                                <label>Name Ar:</label>
                                <input type="text" name="name_ar" class="form-control form-control-rtl @error('name_ar') is-invalid @enderror" value="{{ old('name_ar', $team->name_ar) }}" placeholder="team name in arabic">
                                @error('name_ar')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>
                            <div class="form-group mb-4">
                                <label>Title En:</label>
                                <input type="text" name="title_en" class="form-control @error('title_en') is-invalid @enderror" value="{{ old('title_en', $team->title_en) }}" placeholder="team title in english">
                                @error('title_en')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>
                            <div class="form-group mb-4">
                                <label>Title Ar:</label>
                                <input type="text" name="title_ar" class="form-control form-control-rtl @error('title_ar') is-invalid @enderror" value="{{ old('title_ar', $team->title_ar) }}" placeholder="team title in arabic">
                                @error('title_ar')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>
                            <div class="form-group mb-4">
                                <label>Description En:</label>
                                <textarea name="description_en" class="form-control @error('description_en') is-invalid @enderror" placeholder="team discreption in english">{{ old('description_en', $team->description_en) }}</textarea>
                                @error('description_en')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>
                            <div class="form-group mb-4">
                                <label>Description Ar:</label>
                                <textarea name="description_ar" class="form-control form-control-rtl @error('description_ar') is-invalid @enderror" placeholder="team discreption in arabic">{{ old('description_ar', $team->description_ar) }}</textarea>
                                @error('description_ar')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>
                            <div class="form-group mb-4">
                                <label>Order:</label>
                                <input type="text" name="order" class="form-control @error('order') is-invalid @enderror" value="{{ old('order', $team->order) }}" placeholder="team order ex: 1, 2, ...">
                                @error('order')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>
                            <div class="form-group mb-4">
                                <label for="image">Image:</label>
                                <input type="file" name="image" class="form-control" id="image">
                                @error('image')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>
                            <div class="form-group mb-4">
                                <label>Facebook:</label>
                                <input type="text" name="facebook" class="form-control @error('facebook') is-invalid @enderror" value="{{ old('facebook', $team->links['facebook']) }}" placeholder="team facebook link">
                                @error('facebook')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>
                            <div class="form-group mb-4">
                                <label>Twitter:</label>
                                <input type="text" name="twitter" class="form-control @error('twitter') is-invalid @enderror" value="{{ old('twitter', $team->links['twitter']) }}" placeholder="team twitter link">
                                @error('twitter')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>
                            <div class="form-group mb-4">
                                <label>Instagram:</label>
                                <input type="text" name="instagram" class="form-control @error('instagram') is-invalid @enderror" value="{{ old('instagram', $team->links['instagram']) }}" placeholder="team instagram link">
                                @error('instagram')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>
                            <div class="form-group mb-4">
                                <label>Linkedin:</label>
                                <input type="text" name="linkedin" class="form-control @error('linkedin') is-invalid @enderror" value="{{ old('linkedin', $team->links['linkedin']) }}" placeholder="team linkedin link">
                                @error('linkedin')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>
                            <div class="form-group mb-4">
                                <label>Github:</label>
                                <input type="text" name="github" class="form-control @error('github') is-invalid @enderror" value="{{ old('github', $team->links['github']) }}" placeholder="team github link">
                                @error('github')
                                    <div class="invalid-feedback">
                                        <strong>{{ $message }}</strong>
                                    </div>
                                @enderror
                            </div>

                            <button type="submit" class="btn btn-success">Update</button>
                        </form>
                    </div>                                        
                </div>

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

</div>

@endsection