<?php $__env->startSection('content'); ?>

    <main>
        
         <main>

        <!-- Start Header -->
        <header class="header section registerPg">
            <div class="container">
                <div class="register_sec">
                    <div class="inner mt-5">
                        <h2 class="title text-center fw-bold color-primary mb-5 pb-4">  <?php echo e(__('web.regist_provider')); ?>      </h2>
                            <form method="post" action="<?php echo e($action); ?>" onsubmit="formAction(this)">
                            <?php echo csrf_field(); ?>
                            <div class="mb-5">
                                <div class="row">
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"><?php echo e(__('web.name')); ?> <span class="text-danger">*</span></label>
                                            <input type="text" name='name' class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.email')); ?>     <span class="text-danger">*</span></label>
                                            <input type="email" name="email" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.category')); ?>   <span class="text-danger">*</span></label>
                                            <select name="category_id" onchange="categorySelect(this)" class="form-control form-select">
                                                <option selected disabled> <?php echo e(__('web.select')); ?></option>
                                                <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($row->id); ?>"> <?php echo e($row->title); ?> </option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"><?php echo e(__('web.sub_category_id')); ?> <span class="text-danger">*</span></label>
                                            <select id="sub_category_id" name="sub_category_id" class="form-control form-select">
                                                <option selected disabled> <?php echo e(__('web.select')); ?></option>
                                                
                                            </select>
                                        </div>
                                    </div>
                                    
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.min_order')); ?>    <span class="text-danger">*</span></label>
                                            <input type="number" name="min_order" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    
                                </div>

                            </div>

                            <div class="my-5 pt-3">
                                <div class="row">
                                    <div class="col-lg-12">
                                        <h2 class=" fw-bold color-dark fs-4 mb-5">  <?php echo e(__('web.provider_info')); ?>      </h2>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.provider_logo')); ?>     <span class="text-danger">*</span></label>
                                            <div class="drop_box">
                                                <input id="demo1" class="demo1" type="file" name="logo" placeholder=" الملفات المدعومة: PDF, PNG , JPG ولا يتعدى حجمه 2 MB  " name="demo1[]" />
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"><?php echo e(__('web.provider_header')); ?>    <span class="text-danger">*</span></label>
                                            <div class="drop_box">
                                                <input id="demo1" class="demo1" type="file" name="header" placeholder=" الملفات المدعومة: PDF, PNG , JPG ولا يتعدى حجمه 2 MB  " name="demo1[]" />
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label">   <?php echo e(__('web.addresses_data.name')); ?>        <span class="text-danger">*</span></label>
                                            <input type="text" name="branch[name]" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label">    <?php echo e(__('web.addresses_data.address')); ?>         <span class="text-danger">*</span></label>
                                            <input type="text" name="branch[address]" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label">   <?php echo e(__('web.addresses_data.cost_delivery')); ?> <span class="text-danger">*</span></label>
                                            <input type="number" name="branch[cost_delivery]" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"><?php echo e(__('web.addresses_data.time_delivery')); ?>       <span class="text-danger">*</span></label>
                                            <input type="number" name="branch[time_delivery]" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.addresses_data.time_prepare')); ?>      <span class="text-danger">*</span></label>
                                            <input type="number" name="branch[time_prepare]" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.city')); ?>   <span class="text-danger">*</span></label>
                                            <select onchange="fetchAreas(this)" name='branch[city_id]' class="form-control form-select">
                                                <option selected disabled> <?php echo e(__('web.select')); ?></option>
                                                <?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($row->id); ?>"> <?php echo e($row->title); ?> </option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"><?php echo e(__('web.area')); ?> <span class="text-danger">*</span></label>
                                            <select name="branch[area_id]" id='area_id' class="form-control form-select">
                                                <option selected disabled> <?php echo e(__('web.select')); ?></option>
                                                
                                            </select>
                                        </div>
                                    </div>
                                    
                                    <div class="col-lg-12">
                                        <div class="map_box mb-4">
                                            <input type="hidden" name="branch[latitude]" id="latitude" value="">
                                            <input type="hidden" name="branch[longitude]" id="longitude" value="">
                                            <div id="address-canvas">
                                                <div id="map" style=" height: 400px;border: 1px solid #000;"></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="my-5 pt-3">
                                <div class="row">
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"><?php echo e(__('web.providers_data.name')); ?> <span class="text-danger">*</span></label>
                                            <input type="text" name="provider[name]" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.providers_data.email')); ?>     <span class="text-danger">*</span></label>
                                            <input type="email" name="provider[email]" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.providers_data.phone')); ?>    <span class="text-danger">*</span></label>
                                            <input type="number" name="provider[phone]" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.providers_data.password')); ?>   <span class="text-danger">*</span></label>
                                            <input type="password" name="provider[password]" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.providers_data.password_confirmation')); ?>   <span class="text-danger">*</span></label>
                                            <input type="password" name="provider[password_confirmation]" class="form-control" placeholder="" />
                                        </div>
                                    </div>

                                </div>

                            </div>

                            <div class="my-5 pt-3">
                                <div class="row">
                                    <div class="col-lg-12">
                                        <h2 class=" fw-bold color-dark fs-4 mb-5">  <?php echo e(__('web.bank_info')); ?>    </h2>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.bank_account')); ?>    <span class="text-danger">*</span></label>
                                            <input type="text" name="bank_account" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.bank_num')); ?> <span class="text-danger">*</span></label>
                                            <input type="text" name="bank_num" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"><?php echo e(__('web.iban')); ?>   <span class="text-danger">*</span></label>
                                            <input type="text" name="iban" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group mb-4">
                                            <label class="label"> <?php echo e(__('web.bank')); ?>   <span class="text-danger">*</span></label>
                                            <input type="text" name="bank" class="form-control" placeholder="" />
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="my-5 pt-3">

                                <div class="content mb-4">
                                    <div class="upload_content option1">
                                        <div class="wrapper">
                                            <div class="row">
                                                <div class="col-lg-6">
                                                    <div class="box">
                                                        <div class="js--image-preview"></div>
                                                        <div class="upload-options">
                                                            <label>
                                                                <input type="file" name="user_id_front_image" class="image-upload" accept="image/*" />
                                                            </label>
                                                        </div>
                                                        <h6 class="title"> <?php echo e(__('web.user_id_front_image')); ?> </h6>

                                                        <span class="alert_id" > “<?php echo e(__('web.hint_accept')); ?>“ </span>
                                                    </div>
                                                </div>
                                                <div class="col-lg-6">
                                                    <div class="box">
                                                        <div class="js--image-preview"></div>
                                                        <div class="upload-options">
                                                            <label>
                                                                <input type="file" name="user_id_back_image" class="image-upload" accept="image/*" />
                                                            </label>
                                                        </div>
                                                        <h6 class="title"> <?php echo e(__('web.user_id_back_image')); ?> </h6>

                                                        <span class="alert_id" > “<?php echo e(__('web.hint_accept')); ?>“ </span>
                                                    </div>
                                                </div>
                                                <div class="col-lg-6">
                                                    <div class="box">
                                                        <div class="js--image-preview"></div>
                                                        <div class="upload-options">
                                                            <label>
                                                                <input type="file" name="iban_card" class="image-upload" accept="image/*" />
                                                            </label>
                                                        </div>
                                                        <h6 class="title"> <?php echo e(__('web.iban_card')); ?> </h6>
                                                    </div>
                                                </div>
                                                <div class="col-lg-6">
                                                    <div class="box">
                                                        <div class="js--image-preview"></div>
                                                        <div class="upload-options">
                                                        <label>
                                                            <input type="file" name="license_work" class="image-upload" accept="image/*" />
                                                        </label>
                                                        </div>
                                                        <h6 class="title"> <?php echo e(__('web.license_work')); ?> </h6>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                            </div>




                                <div class="col-lg-12">
                                    <button type="submit" class="butn primary_butn mt-4 px-5 m-auto"><?php echo e(__('web.sure')); ?></button>
                                </div>

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

        </header>



    </main>


    </main>



    </main>

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

<?php $__env->startSection('inject_js'); ?>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB9i5KheHihWwx0k0y0xyqWy-RVLB9AqjU&callback=initMap"></script>


    <script type="text/javascript">

        window.onload = function() {
            var latlng = new google.maps.LatLng(<?php echo '21.4989, 39.2509'; ?>);
            var map = new google.maps.Map(document.getElementById('map'), {
                center: latlng,
                zoom: 11,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            });
            var marker = new google.maps.Marker({
                position: latlng,
                map: map,
                title: 'Set lat/lon values for this property',
                draggable: true
            });
            google.maps.event.addListener(marker, 'dragend', function(a) {
                console.log(a);
                var div = document.createElement('div');
                let lat = a.latLng.lat().toFixed(4);
                let lan =  a.latLng.lng().toFixed(4);
                document.getElementsByTagName('body')[0].appendChild(div);
                $("#latitude").val(function() {
                    return  lat;
                });
                $("#longitude").val(function() {
                    return  lan;
                });

            });

        };

        function getLocation() {
            if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(showPosition);
            } else {
                x.innerHTML = "Geolocation is not supported by this browser.";
            }
        }

        function showPosition(position) {


            var latlng = new google.maps.LatLng(position.coords.latitude , position.coords.longitude);
            // $("#mylatlng").val(function() {
            //     return  latlng;


            // });
            var map = new google.maps.Map(document.getElementById('map'), {
                center: latlng,
                zoom: 11,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            });
            var marker = new google.maps.Marker({
                position: latlng,
                map: map,
                title: 'Set lat/lon values for this property',
                draggable: true
            });
            google.maps.event.addListener(marker, 'dragend', function(a) {
                console.log(a);
                var div = document.createElement('div');alert(div);
                div.innerHTML = a.latLng.lat().toFixed(4) + ', ' + a.latLng.lng().toFixed(4);



            });
        }

    </script>
    <script>
        function fetchAreas(elem)
        {
            let city_id = $(elem).val()
            $.ajax({
                url : "<?php echo e(route('fetch.store.areas')); ?>",
                type : 'GET',
                data : 'city_id='+city_id,
                success:function(data)
                {
                    $('#area_id').html(data);
                }
            })
        }
        function categorySelect(elem)
        {
            let category_id = $(elem).val()
            $.ajax({
                url : "<?php echo e(route('admin.model')); ?>",
                type : 'GET',
                data : 'category_id='+category_id,
                success:function(data)
                {
                    $('#sub_category_id').html(data);
                }
            })
        }
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('web.layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/omaralyomhost/public_html/made/resources/views/web/pages/auth/regist.blade.php ENDPATH**/ ?>