@extends('layout.app')


@section('content')
    <form action="{{ route('packages.store') }}" method="POST">

        @csrf

        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="form-group col-md-6">
                        <label for="package_name" class="block text-sm font-medium text-gray-700">
                            Package Name*
                        </label>
                        <input type="text" name="package_name" id="package_name" value="{{ old('package_name') }}"
                            class="form-control " placeholder="Package Name" autocomplete="off" required>
                        @error('package_name')
                            <div class="alert alert-danger">
                                {{ $message }}
                            </div>
                        @enderror

                    </div>
                    <div class="form-group col-md-6">
                        <label for="package_rate" class="block text-sm font-medium text-gray-700">
                            Package Rate
                        </label>
                        <input step="0.01" type="number" name="package_rate" id="package_rate"
                            class="focus:ring-indigo-500 focus:border-indigo-500 form-control" placeholder="Package Rate"
                            value="{{ old('package_rate') }}" autocomplete="off" required>
                        @error('package_rate')
                            <div class="alert alert-danger">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>
                    <div class="form-group col-md-6">
                        <label for="pool_name" class="block text-sm font-medium text-gray-700">
                            @if (checkAPI())
                                Profile Name
                            @else
                                Pool Name
                            @endif
                        </label>

                        @if (checkAPI())
                            <input type="text" name="profile_name" id="profile_name"
                                class="focus:ring-indigo-500 focus:border-indigo-500 form-control"
                                placeholder="Profile Name" value="{{ old('profile_name') }}" autocomplete="off">
                            @error('profile_name')
                                <div class="alert alert-danger">
                                    {{ $message }}
                                </div>
                            @enderror
                        @else
                            <input type="text" name="pool_name" id="pool_name"
                                class="focus:ring-indigo-500 focus:border-indigo-500 form-control" placeholder="Pool Name"
                                value="{{ old('pool_name') }}" autocomplete="off" required>
                            @error('pool_name')
                                <div class="alert alert-danger">
                                    {{ $message }}
                                </div>
                            @enderror
                        @endif
                    </div>
                    @if (checkSettings('static_ip_manage') == 'enable')
                        <div class="form-group col-md-6">
                            <span class="text-green"><strong>Note :</strong> Upload Speed & Download Speed এ যা দিবেন তা ৮ দিয়ে ভাগ হবে EX: (1MB / 8 = 128kb)</span>
                            <div class="row">
                                <div class="col-md-6">
                                    <label for="package_rate" class="block text-sm font-medium text-gray-700">
                                        Package Upload Speed
                                    </label>
                                    <input step="0.01" type="text" name="speed_up" id="speed_up"
                                        class="focus:ring-indigo-500 focus:border-indigo-500 form-control"
                                        placeholder="Package Upload Speed" value="{{ old('speed_up') }}" autocomplete="off"
                                        required>
                                    @error('speed_up')
                                        <div class="alert alert-danger">
                                            {{ $message }}
                                        </div>
                                    @enderror
                                </div>
                                <div class="col-md-6">
                                    <label for="package_rate" class="block text-sm font-medium text-gray-700">
                                        Package Download Speed
                                    </label>
                                    <input step="0.01" type="text" name="speed_down" id="speed_down"
                                        class="focus:ring-indigo-500 focus:border-indigo-500 form-control"
                                        placeholder="Package Download Speed" value="{{ old('speed_down') }}"
                                        autocomplete="off" required>
                                    @error('speed_down')
                                        <div class="alert alert-danger">
                                            {{ $message }}
                                        </div>
                                    @enderror
                                </div>
                            </div>
                        </div>
                    @endif
                    @if (checkSettings('package_limite_quantity') == 'enable')
                        <div class="form-group col-md-6">
                            <label for="package_rate" class="block text-sm font-medium text-gray-700">
                                Limite Quanity
                            </label>
                            <input step="0.01" type="number" name="limite_quantity" id="limite_quanity"
                                placeholder="In MB" min="0"
                                class="focus:ring-indigo-500 focus:border-indigo-500 form-control"
                                placeholder="Limite Quanity In GB" value="{{ old('limite_quantity') }}" autocomplete="off"
                                required>
                            @error('limite_quantity')
                                <div class="alert alert-danger">
                                    {{ $message }}
                                </div>
                            @enderror
                        </div>
                    @endif

                    <div class="form-group col-md-6">
                        <label for="package_rate" class="block text-sm font-medium text-gray-700">
                            Package Bandwidth for BTRC Report
                        </label>
                        <input type="number" name="package_bandwidth" id="package_bandwidth"
                            class="focus:ring-indigo-500 focus:border-indigo-500 form-control"
                            placeholder="Package Bandwidth for BTRC Report" value="{{ old('package_bandwidth') }}"
                            autocomplete="off" required>
                        @error('package_bandwidth')
                            <div class="alert alert-danger">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>

                    <div class="form-group col-md-6">
                        <label for="package_rate" class="block text-sm font-medium text-gray-700">
                            Package Price for BTRC Report
                        </label>
                        <input type="number" name="btrc_package_price" id="btrc_package_price" step=".01"
                            class="focus:ring-indigo-500 focus:border-indigo-500 form-control"
                            placeholder="Package Price for BTRC Report" value="{{ old('btrc_package_price') }}"
                            autocomplete="off">
                        @error('btrc_package_price')
                            <div class="alert alert-danger">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>


                    @if (checkSettings('package-commission') == 'enable')
                        <div class="form-group col-md-6">
                            <label for="pool_name" class="block text-sm font-medium text-gray-700">
                                Commission
                            </label>
                            <input type="number" name="commission" id="commission"
                                class="focus:ring-indigo-500 focus:border-indigo-500 form-control"
                                placeholder="Commission" value="{{ old('commission') }}" autocomplete="off">
                            @error('commission')
                                <div class="alert alert-danger">
                                    {{ $message }}
                                </div>
                            @enderror
                        </div>
                    @endif

                    @if (globalPermission('ResellerClientOnlineRecharge') && !globalPermission('setClientPaymentAmountToClient')  )
                        <div class="form-group col-md-6">
                            <label for="pool_name" class="block text-sm font-medium text-gray-700">
                                Client payment amount
                            </label>
                            <input type="number" name="client_payment_amount" id="client_payment_amount"
                                class="focus:ring-indigo-500 focus:border-indigo-500 form-control"
                                placeholder=" Client payment amount" value="{{ old('client_payment_amount') }}" autocomplete="off">
                            @error('client_payment_amount')
                                <div class="alert alert-danger">
                                    {{ $message }}
                                </div>
                            @enderror
                        </div>
                    @endif
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-primary float-right">
                        Save
                    </button>
                </div>
            </div>
        </div>





    </form>
@endsection
