<?php $__env->startSection('title'); ?>
    <?php if($vendor): ?>
        <?php echo app('translator')->getFromJson('Vendor Profile'); ?> - <?php echo e(config('app.name')); ?>

    <?php else: ?>
        <?php echo app('translator')->getFromJson('Register as Vendor'); ?>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-header-title'); ?>
    <?php if($vendor): ?>
        <?php echo app('translator')->getFromJson('Vendor Profile'); ?>
    <?php else: ?>
        <?php echo app('translator')->getFromJson('Register your Vendor Profile'); ?>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-header-description'); ?>
    <?php if($vendor): ?>
        <?php echo app('translator')->getFromJson('Vendor Profile'); ?>
    <?php else: ?>
        <?php echo app('translator')->getFromJson('Register your Vendor Profile'); ?>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('styles'); ?>
    <?php echo $__env->make('partials.phone_style', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <style>
        textarea {
            height: unset !important;
        }
    </style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('sidebar'); ?>
    <?php echo $__env->make('includes.user-account-sidebar', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('above_content'); ?>
    <div class="breadcrumb">
        <div class="container">
            <div class="breadcrumb-inner">
                <ul class="list-inline list-unstyled">
                    <li><a href="<?php echo e(url('/')); ?>"><?php echo app('translator')->getFromJson('Home'); ?></a></li>
                    <li class="active"><?php echo app('translator')->getFromJson('Vendor Profile'); ?></li>
                </ul>
            </div>
            <!-- /.breadcrumb-inner -->
        </div>
        <!-- /.container -->
    </div>
    <!-- /.breadcrumb -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="col-md-9 user_account">
        <div class="shopping-cart user_account_dashboard">
            <div class="page-title">
                <h2>
                    <?php if($vendor): ?>
                        <?php echo app('translator')->getFromJson('Vendor Profile'); ?>
                    <?php else: ?>
                        <?php echo app('translator')->getFromJson('Register as Vendor'); ?>
                    <?php endif; ?>
                </h2>
            </div>
            <div class="content-panel">
                <div class="col-md-12">
                    <?php if(isset($vendor->approved) && !$vendor->approved): ?>
                        <div class="alert alert-warning text-center" role="alert">
                            <?php echo app('translator')->getFromJson('Your vendor profile is pending for approval by an administrator.'); ?>
                        </div>
                    <?php elseif($vendor->approved): ?>
                        <div class="text-center">
                            <div class="well">
                                <label class="f-20 pt-5"><?php echo app('translator')->getFromJson('Status:'); ?> <strong><?php echo app('translator')->getFromJson('Approved'); ?></strong></label>
                                <a target="_blank" href="<?php echo e(route('manage.vendor.dashboard')); ?>" class="btn btn-sm btn-primary pull-right"><?php echo app('translator')->getFromJson('Vendor Dashboard'); ?></a>
                                <div class="clearfix"></div>
                            </div>
                        </div>
                    <?php endif; ?>
                    <?php if(session()->has('profile_updated')): ?>
                        <div class="alert alert-success alert-dismissible" role="alert">
                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                            <?php echo e(session('profile_updated')); ?>

                        </div>
                    <?php endif; ?>
                    <?php echo $__env->make('includes.form_errors', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                </div>

                <div class="col-sm-12 profile-setting-form">
                    <?php echo Form::model($vendor, ['method'=>'patch', 'action'=>['FrontVendorController@updateProfile'], 'onsubmit'=>'submit_button.disabled = true; submit_button.value = "' . __('Please Wait...') . '"; return true;', 'id'=>'update-profile-form']); ?>


                    <?php if($vendor->approved): ?>
                        <label><?php echo app('translator')->getFromJson('Shop URL:'); ?></label>
                        <div class="well">
                            <small>
                                <a class="f-15" target="blank" href="<?php echo e(url('/shop')); ?>/<?php echo e($vendor->slug); ?>"><?php echo e(url('/shop')); ?>/<?php echo e($vendor->slug); ?></a>
                            </small>
                        </div>
                    <?php endif; ?>

                    <label class="text-muted"><?php echo app('translator')->getFromJson('Shop Name:'); ?></label>&nbsp;
                    <span>
                        <?php echo e($vendor->shop_name); ?>

                    </span>
                    <br><br>

                    <div class="form-group<?php echo e($errors->has('name') ? ' has-error' : ''); ?>">
                        <?php echo Form::label('name', __('Company Name:')); ?>

                        <?php echo Form::text('name', null, ['class'=>'form-control', 'placeholder'=>__('Enter company name'), 'required']); ?>

                    </div>

                    <div class="form-group<?php echo e($errors->has('phone') ? ' has-error' : ''); ?>">
                        <?php echo Form::label('phone-number', __('Phone:')); ?>

                        <?php echo Form::text('phone-number', isset( $vendor->phone ) ? $vendor->phone : null, ['class'=>'form-control', 'placeholder'=>__('Enter phone number'), 'required']); ?>

                    </div>

                    <div class="form-group<?php echo e($errors->has('description') ? ' has-error' : ''); ?>">
                        <?php echo Form::label('description', __('Description:')); ?>

                        <?php echo Form::textarea('description', null, ['class'=>'form-control', 'placeholder'=>__('Enter description'), 'rows'=>'6']); ?>

                    </div>

                    <div class="form-group<?php echo e($errors->has('address') ? ' has-error' : ''); ?>">
                        <?php echo Form::label('address', __('Address:')); ?>

                        <?php echo Form::text('address', null, ['class'=>'form-control', 'placeholder'=>__('Enter address')]); ?>

                    </div>

                    <div class="form-group<?php echo e($errors->has('city') ? ' has-error' : ''); ?>">
                        <?php echo Form::label('city', __('City:')); ?>

                        <?php echo Form::text('city', null, ['class'=>'form-control', 'placeholder'=>__('Enter city')]); ?>

                    </div>

                    <div class="form-group<?php echo e($errors->has('state') ? ' has-error' : ''); ?>">
                        <?php echo Form::label('state', __('State:')); ?>

                        <?php echo Form::text('state', null, ['class'=>'form-control', 'placeholder'=>__('Enter state')]); ?>

                    </div>

                    <div class="form-group">
                        <button type="submit" class="btn  btn-block" name="submit_button" id="update_btn">
                            <?php echo e($vendor ? $vendor->profile_completed ? __('Update Profile') : __('Complete Profile') : __('Register as Vendor')); ?>

                        </button>
                    </div>

                    <?php echo Form::close(); ?>

                </div>

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

<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(asset('js/tinymce/tinymce.min.js')); ?>"></script>
    <script>
        var editor_config = {
            path_absolute : APP_URL + "/",
            selector: "textarea",
            resize: false,
            plugins: [
                "advlist autolink lists link charmap print preview hr anchor pagebreak",
                "searchreplace wordcount visualblocks visualchars code fullscreen",
                "insertdatetime nonbreaking save table contextmenu directionality",
                "emoticons template paste textcolor colorpicker textpattern"
            ],
            toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent",
            relative_urls: false,
            file_browser_callback : function(field_name, url, type, win) {
                var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
                var y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;

                var cmsURL = editor_config.path_absolute + 'laravel-filemanager?field_name=' + field_name;
                if (type == 'image') {
                    cmsURL = cmsURL + "&type=Images";
                } else {
                    cmsURL = cmsURL + "&type=Files";
                }

                tinyMCE.activeEditor.windowManager.open({
                    file : cmsURL,
                    title : 'Filemanager',
                    width : x * 0.8,
                    height : y * 0.8,
                    resizable : "yes",
                    close_previous : "no"
                });
            }
        };

        tinymce.init(editor_config);
    </script>
    <?php echo $__env->make('partials.phone_script', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.front', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>