<?php $__env->startSection('css'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('assets/web/css/lib/toastr.css')); ?>" />
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <section class="page-heading">
        <div class="container">
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="<?php echo e(LaravelLocalization::getLocalizedURL(getCurrentLocale(), route('home'), [], true)); ?>"><?php echo e(__('main.home')); ?></a></li>
                    <li class="breadcrumb-item active" aria-current="page"><?php echo e(__('main.new_register')); ?></li>
                </ol>
                <h3><?php echo e(__('main.new_register')); ?></h3>
            </nav>
        </div>
        <img src="<?php echo e(asset('assets/web/images/page-heading-1.png')); ?>" alt="" class="pattern1">
        <img src="<?php echo e(asset('assets/web/images/page-heading-2.png')); ?>" alt="" class="pattern2">
        <img src="<?php echo e(asset('assets/web/images/page-heading-3.png')); ?>" alt="" class="pattern3">
    </section>
    <section class="register-pg">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-6 pr-0 pl-0">
                    <img src="<?php echo e(asset('assets/web/images/header-img.png')); ?>" alt="" class="main-img">
                </div>
                <div class="col-md-6 pr-0 pl-0">
                    <div class="text-box center-vr">
                        <h6 class="h6"><?php echo e(__('main.join_us')); ?></h6>
                        <h4 class="h4"><?php echo e(__('main.create_account')); ?> <b><?php echo e(__('main.new')); ?></b></h4>
                        <p class="p"><?php echo e(__('main.register_hint')); ?></p>
                        <div class="form-wrapper  mt-4">
                            <form method="post" action="<?php echo e(route('provider.doRegister')); ?>" class="register_form">
                                <div class="row">
                                    <div class="col-lg-12">
                                        <div class="form-group">
                                            <input name="name" type="text" class="form-control" autocomplete="off" autofocus required />
                                            <label class="floating-label"><?php echo e(__('members.name')); ?></label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <input name="email" type="email" class="form-control" autocomplete="off" autofocus required />
                                    <label class="floating-label"><?php echo e(__('members.email')); ?></label>
                                </div>
                                <div class="form-group">
                                    <div class="row phone-num-row">
                                        <div class="col-2  pr-0 pl-0">
                                            <select name="code" class="form-control phone-select">
                                                <?php if(count($countryCods)): ?>
                                                    <?php $__currentLoopData = $countryCods; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $code): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($code); ?>"><?php echo e($code); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                            </select>
                                        </div>
                                        <div class="col-10 pr-0 pl-0">
                                            <input name="phone" type="tel" class="form-control phone-input" autocomplete="off" autofocus required />
                                            <label class="floating-label"><?php echo e(__('members.phone')); ?></label>
                                        </div>

                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-4">
                                        <div class="form-group">
                                            <select name="region_id" class="form-control" autocomplete="off" autofocus required >
                                                <option> <?php echo e(__('members.region_id')); ?> </option>
                                                <?php if(count($regions)): ?>
                                                    <?php $__currentLoopData = $regions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $region): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($region->id); ?>"><?php echo e($region->name); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                            </select>
                                            <label class="floating-label"><?php echo e(__('members.region_id')); ?></label>
                                        </div>
                                    </div>
                                    <div class="col-lg-4">
                                        <div class="form-group">
                                            <select name="city_id" class="form-control" autocomplete="off" autofocus required >
                                                <option value=""> <?php echo e(__('members.city_id')); ?> </option>
                                            </select>
                                            <label class="floating-label"><?php echo e(__('members.city_id')); ?></label>
                                        </div>
                                    </div>
                                    <div class="col-lg-4">
                                        <div class="form-group">
                                            <select name="sector_id" class="form-control" autocomplete="off" autofocus required >
                                                <option value=""> <?php echo e(__('members.sector_id')); ?> </option>
                                            </select>
                                            <label class="floating-label"><?php echo e(__('members.sector_id')); ?></label>
                                        </div>
                                    </div>
                                    <div class="col-lg-12">
                                        <div class="form-group">
                                            <input name="street" type="text" class="form-control" autocomplete="off" autofocus required />
                                            <label class="floating-label"><?php echo e(__('members.street')); ?></label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <input name="password" type="password" class="form-control" id="password" autocomplete="off" autofocus required />
                                    <label class="floating-label"> <?php echo e(__('members.password')); ?> </label>
                                    <span class="togglePassword"><i class="far fa-eye" id="togglePassword"></i></span>
                                </div>
                                <div class="form-group">
                                    <input name="password_confirmation" type="password" class="form-control" autocomplete="off" autofocus required />
                                    <label class="floating-label"> <?php echo e(__('members.retype_password')); ?> </label>
                                </div>
                                <div class="form-group file-input-group">
                                    <div class="wrap">
                                        <div class="file">
                                            <div class="commercial_file_input file__input" id="file__input">
                                                <input class="file__input--file" id="customFile" type="file"  name="commercial_file" />
                                                <label class="file__input--label" for="customFile" data-text-btn="<?php echo e(__('members.select')); ?>"> <?php echo e(__('members.commercial_file')); ?>  :</label>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group file-input-group">
                                    <div class="wrap">
                                        <div class="file">
                                            <div class="logo_file_input file__input" id="file__input">
                                                <input class="file__input--file" id="customLogoFile" type="file" name="logo" />
                                                <label class="file__input--label" for="customLogoFile" data-text-btn="<?php echo e(__('members.select')); ?>"> <?php echo e(__('members.logo')); ?>  :</label>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="custom-control custom-checkbox">
                                    <input value="1" name="agreement" type="checkbox" class="custom-control-input" id="policices">
                                    <label class="custom-control-label" for="policices"><?php echo e(__('main.agreement_on')); ?> <a href="<?php echo e(route('termsConditions')); ?>"><?php echo e(__('policies.terms_conditions')); ?></a> <?php echo e(__('main.and')); ?> <a href="<?php echo e(route('privacyPolicy')); ?>"><?php echo e(__('policies.privacy_policy')); ?></a></label>
                                </div>
                                <div class="custom-control custom-checkbox mt-3">
                                    <input value="1" name="email_receive" type="checkbox" class="custom-control-input" id="newsletter">
                                    <label class="custom-control-label" for="newsletter"><?php echo e(__('members.email_receive')); ?></label>
                                </div>
                                <button class="submit-butn mt-4 register_button" type="submit"><?php echo e(__('main.sign_up')); ?></button>

                                <p class="another_choice mt-4"><?php echo e(__('main.have_account')); ?> <a href="<?php echo e(route('userProvider.login')); ?>"><?php echo e(__('main.sign_in')); ?></a></p>

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

                </div>
            </div>

        </div>
    </section>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('inner_js'); ?>
    <script src="<?php echo e(asset('assets/web/js/lib/toastr.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/web/js/users.register.js')); ?>"></script>
    <script>
        let getCityAndSectorRoute = "<?php echo e(route('provider.getCityAndSector')); ?>";
    </script>
    <script>
        $('select[name="region_id"], select[name="city_id"]').change(async function (e) {
            let data = {
                    region_id: $('select[name="region_id"]').val(),
                    city_id: $('select[name="city_id"]').val()
                },
                url = getCityAndSectorRoute,
                method = 'get';

            const response=await ajax({
                url,
                data,
                dataType: 'json',
                method
            });

            if (response.cities.length && !response.sectors.length){
                let cities = $('select[name="city_id"]');
                cities.html(`<option value=""> <?php echo e(__('members.city_id')); ?> </option>`);
                for(let i = 0; i < response.cities.length; i++){
                    cities.append(`<option value="`+response.cities[i].id+`">`+response.cities[i].name+`</option>`)
                }
            }
            if (response.cities.length && response.sectors.length){
                let sectors = $('select[name="sector_id"]');
                sectors.html(`<option value=""> <?php echo e(__('members.sector_id')); ?> </option>`);
                for(let i = 0; i < response.sectors.length; i++){
                    sectors.append(`<option value="`+response.sectors[i].id+`">`+response.sectors[i].name+`</option>`)
                }
            }
        });

        $(document).ready(function() {

            // ------------  File upload BEGIN ------------
            $('input[name="commercial_file"]').on('change', function(event) {
                $('.commercial_file_value').remove();
                var files = event.target.files;
                for (var i = 0; i < files.length; i++) {
                    var file = files[i];
                    $("<div class='commercial_file_value file__value'><div class='file__value--text'>" + file.name + "</div><div class='file__value--remove' data-id='" + file.name + "' ></div></div>").insertAfter('.commercial_file_input');
                }
            });

            $('input[name="logo"]').on('change', function(event) {
                $('.logo_file_value').remove();
                var files = event.target.files;
                for (var i = 0; i < files.length; i++) {
                    var file = files[i];
                    $("<div class='logo_file_value file__value'><div class='file__value--text'>" + file.name + "</div><div class='file__value--remove' data-id='" + file.name + "' ></div></div>").insertAfter('.logo_file_input');
                }
            });


            //Click to remove item
            $('body').on('click', '.commercial_file_value, .logo_file_value', function() {
                $(this).remove();
                $('input[name="logo"]').val('');
                $('input[name="commercial_file"]').val('');
            });
            // ------------ File upload END ------------

        });

    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('web.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\wamp64\www\meet\resources\views/web/members/providers/register.blade.php ENDPATH**/ ?>