@extends('admin.layouts.master')

@section('content')

<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h1 class="h3 mb-0 text-gray-800">{{ __('Translation - Front End') }}</h1>
    <a href="" class="d-none d-sm-inline-block btn btn-primary shadow-sm" data-bs-toggle="modal" data-bs-target="#exampleModal"><i class="fas fa-globe"></i> {{ __('Translate To Your Language') }}
    </a>
    <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h1 class="modal-title fs-5" id="exampleModalLabel">{{ __('Translate To Your Language') }}</h1>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <form action="{{ route('admin_translation_front_end_translate') }}" method="post">
                        @csrf
                        <div class="mb-3">
                            <label for="">Select Language</label>
                            <select name="code" class="form-select">
                                <option value="en">{{ __('English') }}</option>
                                <option value="es">{{ __('Spanish') }}</option>
                                <option value="fr">{{ __('French') }}</option>
                                <option value="de">{{ __('German') }}</option>
                                <option value="it">{{ __('Italian') }}</option>
                                <option value="nl">{{ __('Dutch') }}</option>
                                <option value="pt">{{ __('Portuguese') }}</option>
                                <option value="ru">{{ __('Russian') }}</option>
                                <option value="ja">{{ __('Japanese') }}</option>
                                <option value="ko">{{ __('Korean') }}</option>
                                <option value="zh-CN">{{ __('Chinese') }}</option>
                                <option value="ar">{{ __('Arabic') }}</option>
                                <option value="tr">{{ __('Turkish') }}</option>
                                <option value="vi">{{ __('Vietnamese') }}</option>
                                <option value="th">{{ __('Thai') }}</option>
                                <option value="id">{{ __('Indonesian') }}</option>
                                <option value="ms">{{ __('Malay') }}</option>
                                <option value="fil">{{ __('Filipino') }}</option>
                                <option value="hi">{{ __('Hindi') }}</option>
                                <option value="bn">{{ __('Bengali') }}</option>
                                <option value="ur">{{ __('Urdu') }}</option>
                                <option value="fa">{{ __('Persian') }}</option>
                                <option value="he">{{ __('Hebrew') }}</option>
                                <option value="sw">{{ __('Swahili') }}</option>
                                <option value="pl">{{ __('Polish') }}</option>
                                <option value="uk">{{ __('Ukrainian') }}</option>
                                <option value="el">{{ __('Greek') }}</option>
                                <option value="ta">{{ __('Tamil') }}</option>
                            </select>                            
                        </div>
                        <div class="mb-3">
                            <button type="submit" class="btn btn-primary">{{ __('Submit') }}</button>
                            <p class="text-danger mt_10">
                                {{ __('Note: This action may take few minutes to complete') }}
                            </p>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="card shadow mb-4">
    <div class="card-body">
        <form action="{{ route('admin_translation_front_end_update') }}" method="post">
            @csrf
            <div class="table-responsive">
                <table class="table table-bordered table-sm" id="" width="100%" cellspacing="0">
                    <thead>
                    <tr>
                        <th class="w_50_p">{{ __('Key') }}</th>
                        <th>{{ __('Value') }}</th>
                    </tr>
                    </thead>
                    <tbody>
                        @foreach($translation_data as $key=>$value)
                        <input type="hidden" class="form-control" name="key_arr[]" value="{{ $key }}">
                        <tr>
                            <td>
                                {{ $key }}
                            </td>
                            <td>
                                <input type="text" name="value_arr[]" class="form-control" value="{{ $value }}">
                            </td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>
            <button type="submit" class="btn btn-success mb-50 btn-common">{{ __('Update') }}</button>
        </form>
    </div>
</div>
@endsection