@php
    $countryGroups = [
        'East Africa' => ['Burundi' => 'Burundi', 'Comoros' => 'Comoros', 'Djibouti' => 'Djibouti', 'DR Congo' => 'DR Congo', 'Eritrea' => 'Eritrea', 'Ethiopia' => 'Ethiopia', 'Kenya' => 'Kenya', 'Madagascar' => 'Madagascar', 'Malawi' => 'Malawi', 'Mauritius' => 'Mauritius', 'Mozambique' => 'Mozambique', 'Rwanda' => 'Rwanda', 'Seychelles' => 'Seychelles', 'Somalia' => 'Somalia', 'South Sudan' => 'South Sudan', 'Tanzania' => 'Tanzania', 'Uganda' => 'Uganda', 'Zambia' => 'Zambia', 'Zimbabwe' => 'Zimbabwe'],
        'Rest of Africa' => ['Algeria' => 'Algeria', 'Angola' => 'Angola', 'Benin' => 'Benin', 'Botswana' => 'Botswana', 'Burkina Faso' => 'Burkina Faso', 'Cameroon' => 'Cameroon', 'Cape Verde' => 'Cape Verde', 'Central African Republic' => 'Central African Republic', 'Chad' => 'Chad', 'Congo' => 'Congo', "Cote d'Ivoire" => "Cote d'Ivoire", 'Egypt' => 'Egypt', 'Equatorial Guinea' => 'Equatorial Guinea', 'Eswatini' => 'Eswatini', 'Gabon' => 'Gabon', 'Gambia' => 'Gambia', 'Ghana' => 'Ghana', 'Guinea' => 'Guinea', 'Guinea-Bissau' => 'Guinea-Bissau', 'Liberia' => 'Liberia', 'Libya' => 'Libya', 'Mali' => 'Mali', 'Mauritania' => 'Mauritania', 'Morocco' => 'Morocco', 'Namibia' => 'Namibia', 'Niger' => 'Niger', 'Nigeria' => 'Nigeria', 'Sao Tome and Principe' => 'Sao Tome and Principe', 'Senegal' => 'Senegal', 'Sierra Leone' => 'Sierra Leone', 'South Africa' => 'South Africa', 'Sudan' => 'Sudan', 'Togo' => 'Togo', 'Tunisia' => 'Tunisia'],
        'Rest of World' => ['Afghanistan' => 'Afghanistan', 'Albania' => 'Albania', 'Andorra' => 'Andorra', 'Argentina' => 'Argentina', 'Armenia' => 'Armenia', 'Australia' => 'Australia', 'Austria' => 'Austria', 'Azerbaijan' => 'Azerbaijan', 'Bahrain' => 'Bahrain', 'Bangladesh' => 'Bangladesh', 'Belgium' => 'Belgium', 'Brazil' => 'Brazil', 'Bulgaria' => 'Bulgaria', 'Canada' => 'Canada', 'China' => 'China', 'Croatia' => 'Croatia', 'Cyprus' => 'Cyprus', 'Czech Republic' => 'Czech Republic', 'Denmark' => 'Denmark', 'Finland' => 'Finland', 'France' => 'France', 'Germany' => 'Germany', 'India' => 'India', 'Iraq' => 'Iraq', 'Ireland' => 'Ireland', 'Israel' => 'Israel', 'Italy' => 'Italy', 'Japan' => 'Japan', 'Jordan' => 'Jordan', 'Kuwait' => 'Kuwait', 'Malaysia' => 'Malaysia', 'Netherlands' => 'Netherlands', 'New Zealand' => 'New Zealand', 'Norway' => 'Norway', 'Oman' => 'Oman', 'Pakistan' => 'Pakistan', 'Philippines' => 'Philippines', 'Poland' => 'Poland', 'Portugal' => 'Portugal', 'Qatar' => 'Qatar', 'Romania' => 'Romania', 'Russia' => 'Russia', 'Saudi Arabia' => 'Saudi Arabia', 'Singapore' => 'Singapore', 'Spain' => 'Spain', 'Sri Lanka' => 'Sri Lanka', 'Sweden' => 'Sweden', 'Switzerland' => 'Switzerland', 'Thailand' => 'Thailand', 'Turkey' => 'Turkey', 'Ukraine' => 'Ukraine', 'United Arab Emirates' => 'United Arab Emirates', 'United Kingdom' => 'United Kingdom', 'United States' => 'United States', 'Uzbekistan' => 'Uzbekistan', 'Vietnam' => 'Vietnam', 'Yemen' => 'Yemen']
    ];

    $stateGroups = [
        'Kenya (47 Counties)' => ['Baringo' => 'Baringo', 'Bomet' => 'Bomet', 'Bungoma' => 'Bungoma', 'Busia' => 'Busia', 'Elgeyo-Marakwet' => 'Elgeyo-Marakwet', 'Embu' => 'Embu', 'Garissa' => 'Garissa', 'Homa Bay' => 'Homa Bay', 'Isiolo' => 'Isiolo', 'Kajiado' => 'Kajiado', 'Kakamega' => 'Kakamega', 'Kericho' => 'Kericho', 'Kiambu' => 'Kiambu', 'Kilifi' => 'Kilifi', 'Kirinyaga' => 'Kirinyaga', 'Kisii' => 'Kisii', 'Kisumu' => 'Kisumu', 'Kitui' => 'Kitui', 'Kwale' => 'Kwale', 'Laikipia' => 'Laikipia', 'Lamu' => 'Lamu', 'Machakos' => 'Machakos', 'Makueni' => 'Makueni', 'Mandera' => 'Mandera', 'Marsabit' => 'Marsabit', 'Meru' => 'Meru', 'Migori' => 'Migori', 'Mombasa' => 'Mombasa', 'Muranga' => 'Muranga', 'Nairobi' => 'Nairobi', 'Nakuru' => 'Nakuru', 'Nandi' => 'Nandi', 'Narok' => 'Narok', 'Nyamira' => 'Nyamira', 'Nyandarua' => 'Nyandarua', 'Nyeri' => 'Nyeri', 'Samburu' => 'Samburu', 'Siaya' => 'Siaya', 'Taita-Taveta' => 'Taita-Taveta', 'Tana River' => 'Tana River', 'Tharaka-Nithi' => 'Tharaka-Nithi', 'Trans Nzoia' => 'Trans Nzoia', 'Turkana' => 'Turkana', 'Uasin Gishu' => 'Uasin Gishu', 'Vihiga' => 'Vihiga', 'Wajir' => 'Wajir', 'West Pokot' => 'West Pokot'],
        'East Africa Regions' => ['Central' => 'Central', 'Eastern' => 'Eastern', 'Northern' => 'Northern', 'Western' => 'Western', 'Karamoja' => 'Karamoja', 'Kigali' => 'Kigali', 'Arusha' => 'Arusha', 'Dar es Salaam' => 'Dar es Salaam', 'Dodoma' => 'Dodoma'],
        'GCC Regions' => ['Abu Dhabi' => 'Abu Dhabi', 'Ajman' => 'Ajman', 'Dubai' => 'Dubai', 'Fujairah' => 'Fujairah', 'Ras Al Khaimah' => 'Ras Al Khaimah', 'Sharjah' => 'Sharjah', 'Umm Al Quwain' => 'Umm Al Quwain', 'Riyadh' => 'Riyadh', 'Makkah' => 'Makkah', 'Madinah' => 'Madinah', 'Ad Dawhah' => 'Ad Dawhah', 'Muscat' => 'Muscat'],
        'Europe Regions' => ['England' => 'England', 'Scotland' => 'Scotland', 'Wales' => 'Wales', 'Northern Ireland' => 'Northern Ireland', 'Berlin' => 'Berlin', 'Bavaria' => 'Bavaria', 'Ile-de-France' => 'Ile-de-France', 'Madrid' => 'Madrid', 'Lazio' => 'Lazio', 'Lombardy' => 'Lombardy', 'Vienna' => 'Vienna', 'Zurich' => 'Zurich']
    ];
@endphp
{{Form::open(array('url'=>'customer','method'=>'post', 'class'=>'needs-validation', 'novalidate'))}}
<div class="modal-body">

    <h6 class="sub-title">{{__('Basic Info')}}</h6>
    <div class="row">
        <div class="col-lg-4 col-md-4 col-sm-6">
            <div class="form-group">
                {{Form::label('name',__('Company Name'),array('class'=>'form-label')) }}<x-required></x-required>
                {{Form::text('name',null,array('class'=>'form-control','required'=>'required' ,'placeholder'=>__('Enter Company Name')))}}
            </div>
        </div>
        <div class="col-lg-4 col-md-4 col-sm-6">
            <div class="form-group">
                {{Form::label('contact',__('Contact'),['class'=>'form-label'])}}<x-required></x-required>
                {{Form::text('contact',old('contact'),array('class'=>'form-control','required'=>'required','placeholder'=>__('Enter Contact'),'inputmode'=>'tel','autocomplete'=>'tel'))}}
                <div class="text-danger mt-1" style="font-size: 11px; line-height: 1.2;">
                    {{ __('Input Phone No. without Zero (0) infront') }}
                </div>
            </div>
        </div>
        <div class="col-lg-4 col-md-4 col-sm-6">
            <div class="form-group">
                {{Form::label('email',__('Email'),['class'=>'form-label'])}}<x-required></x-required>
                {{Form::email('email',null,array('class'=>'form-control' , 'placeholder'=>__('Enter email'),'required'=>'required'))}}

            </div>
        </div>

        <div class="col-lg-4 col-md-4 col-sm-6">
            <div class="form-group">
                {{Form::label('tax_number',__('PIN/Tax Number'),['class'=>'form-label'])}}
                {{Form::text('tax_number',null,array('class'=>'form-control' , 'placeholder' => __('Enter PIN/Tax Number')))}}
            </div>
        </div>
        @if(!$customFields->isEmpty())
            {{-- <div class="col-lg-4 col-md-4 col-sm-6"> --}}
                {{-- <div class="tab-pane fade show" id="tab-2" role="tabpanel"> --}}
                    @include('customFields.formBuilder')
                {{-- </div> --}}
            {{-- </div> --}}
        @endif
    </div>

    <h6 class="sub-title">{{__('Billing Address')}}</h6>
    <div class="row">
        <div class="col-lg-6 col-md-6 col-sm-6">
            <div class="form-group">
                {{Form::label('billing_name',__('Contact Name'),array('class'=>'','class'=>'form-label')) }}
                {{Form::text('billing_name',null,array('class'=>'form-control' , 'placeholder'=>__('Enter Name')))}}
            </div>
        </div>
        <div class="col-lg-6 col-md-6 col-sm-6">
            <div class="form-group">
                {{Form::label('billing_phone',__('Phone'),array('class'=>'form-label')) }}
                {{Form::text('billing_phone',null,array('class'=>'form-control' , 'placeholder'=>__('Enter Phone')))}}
            </div>
        </div>
        <div class="col-md-12">
            <div class="form-group">
                {{Form::label('billing_address',__('Address'),array('class'=>'form-label')) }}
                {{Form::textarea('billing_address',null,array('class'=>'form-control','rows'=>3 , 'placeholder'=>__('Enter Address')))}}

            </div>
        </div>
        <div class="col-lg-6 col-md-6 col-sm-6">
            <div class="form-group">
                {{Form::label('billing_country',__('Country'),array('class'=>'form-label')) }}<x-required></x-required>
                {{Form::select('billing_country', $countryGroups, old('billing_country', 'Kenya'), array('class'=>'form-control','required'=>'required'))}}
            </div>
        </div>
        <div class="col-lg-6 col-md-6 col-sm-6">
            <div class="form-group">
                {{Form::label('billing_city',__('City'),array('class'=>'form-label')) }}<x-required></x-required>
                {{Form::text('billing_city',null,array('class'=>'form-control' , 'placeholder'=>__('Enter City'),'required'=>'required'))}}

            </div>
        </div>
        <div class="col-lg-6 col-md-6 col-sm-6">
            <div class="form-group">
                {{Form::label('billing_state',__('County/State'),array('class'=>'form-label')) }}<x-required></x-required>
                {{Form::select('billing_state', $stateGroups, old('billing_state', 'Nairobi'), array('class'=>'form-control','required'=>'required'))}}
            </div>
        </div>

        <div class="col-lg-6 col-md-6 col-sm-6">
            <div class="form-group">
                {{Form::label('billing_zip',__('Postal/Zip Code'),array('class'=>'form-label')) }}<x-required></x-required>
                {{Form::text('billing_zip',null,array('class'=>'form-control' , 'placeholder'=>__('Enter Postal/Zip Code'),'required'=>'required'))}}

            </div>
        </div>

    </div>

    @if(App\Models\Utility::getValByName('shipping_display')=='on')
        <div class="col-md-12 text-end">
            <input type="button" id="billing_data" value="{{__('Shipping Same As Billing')}}" class="btn btn-primary">
        </div>
        <h6 class="sub-title">{{__('Shipping Address')}}</h6>
        <div class="row">
            <div class="col-lg-6 col-md-6 col-sm-6">
                <div class="form-group">
                    {{Form::label('shipping_name',__('Contact Name'),array('class'=>'form-label')) }}
                    {{Form::text('shipping_name',null,array('class'=>'form-control' , 'placeholder'=>__('Enter Name')))}}

                </div>
            </div>
            <div class="col-lg-6 col-md-6 col-sm-6">
                <div class="form-group">
                    {{Form::label('shipping_phone',__('Phone'),array('class'=>'form-label')) }}
                    {{Form::text('shipping_phone',null,array('class'=>'form-control' , 'placeholder'=>__('Enter Phone')))}}

                </div>
            </div>
            <div class="col-md-12">
                <div class="form-group">
                    {{Form::label('shipping_address',__('Address'),array('class'=>'form-label')) }}
                    <label class="form-label" for="example2cols1Input"></label>
                    {{Form::textarea('shipping_address',null,array('class'=>'form-control','rows'=>3 , 'placeholder'=>__('Enter Address')))}}

                </div>
            </div>


            <div class="col-lg-6 col-md-6 col-sm-6">
                <div class="form-group">
                    {{Form::label('shipping_country',__('Country'),array('class'=>'form-label')) }}<x-required></x-required>
                    {{Form::select('shipping_country', $countryGroups, old('shipping_country', 'Kenya'), array('class'=>'form-control','required'=>'required'))}}

                </div>
            </div>
            <div class="col-lg-6 col-md-6 col-sm-6">
                <div class="form-group">
                    {{Form::label('shipping_city',__('City'),array('class'=>'form-label')) }}<x-required></x-required>
                    {{Form::text('shipping_city',null,array('class'=>'form-control' , 'placeholder'=>__('Enter City'),'required'=>'required'))}}

                </div>
            </div>
            <div class="col-lg-6 col-md-6 col-sm-6">
                <div class="form-group">
                    {{Form::label('shipping_state',__('County/State'),array('class'=>'form-label')) }}<x-required></x-required>
                    {{Form::select('shipping_state', $stateGroups, old('shipping_state', 'Nairobi'), array('class'=>'form-control','required'=>'required'))}}

                </div>
            </div>


            <div class="col-lg-6 col-md-6 col-sm-6">
                <div class="form-group">
                    {{Form::label('shipping_zip',__('Postal/Zip Code'),array('class'=>'form-label')) }}<x-required></x-required>
                    {{Form::text('shipping_zip',null,array('class'=>'form-control' , 'placeholder' => __('Enter Postal/Zip Code'),'required'=>'required'))}}

                </div>
            </div>

        </div>
    @endif

</div>
<div class="modal-footer">
    <input type="button" value="{{__('Cancel')}}" class="btn btn-secondary" data-bs-dismiss="modal">
    <input type="submit" value="{{__('Create')}}" class="btn btn-primary">
</div>
{{Form::close()}}



