<?php $__env->startSection('content'); ?>
    <div class="side-title">
        <h3><?php echo e($head ?? ''); ?></h3>
    </div>

    <div class="border-item">
        <form class="form-row" method="post" onsubmit="saveForm(this)" action="<?php echo e($action); ?>" enctype="multipart/form-data">
            <?php if($provider ?? ''  && $provider->id): ?>
                <?php echo method_field('PUT'); ?>
            <?php endif; ?>
            <?php echo csrf_field(); ?>

            <ul class="nav nav-tabs col-12" role="tablist">
                <li class="nav-item">
                    <a class="nav-link active" data-toggle="tab" href="#personal_info"><?php echo e(__('providers.personal_info')); ?></a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" data-toggle="tab" href="#badges"><?php echo e(__('providers.badges')); ?></a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" data-toggle="tab" href="#stats"><?php echo e(__('providers.stats')); ?></a>
                </li>
            </ul>
              
            <!-- Tab panes -->
            <div class="tab-content col-12">
                <div class="tab-pane col-12 pt-5 active" id="personal_info">
                    <div class="row col-lg-12">
                        <div class="form-group col">
                            <label><?php echo e(__('providers.name')); ?> </label>
                            <input type="text" class="form-control <?php echo e($errors->has('name') ? 'is-invalid' : ''); ?>" name="name" placeholder="<?php echo e(__('providers.name')); ?>" value='<?php echo e(old("name", $provider->name ?? "")); ?>'/>
                        </div>

                        <div class="form-group col">
                            <label><?php echo e(__('providers.email')); ?> </label>
                            <input type="text"  class="form-control <?php echo e($errors->has('email') ? 'is-invalid' : ''); ?>" name="email" placeholder="<?php echo e(__('providers.email')); ?>" value='<?php echo e(old("email", $provider->email ?? null)); ?>'/>
                        </div>

                        <div class="form-group col">
                            <label><?php echo e(__('providers.phone')); ?> </label>
                            <div class="input-group">
                                <input type="text" class="form-control <?php echo e($errors->has('phone') ? 'is-invalid' : ''); ?>" name="phone" placeholder="<?php echo e(__('providers.phone')); ?>" value='<?php echo e(old("phone", $provider->phone ?? "")); ?>'/>
                            </div>
                        </div>
                    </div>

                    <div class="row col-lg-12">
                        <div class="form-group col">
                            <label><?php echo e(__('providers.password')); ?> </label>
                            <input type="password" class="form-control <?php echo e($errors->has('password') ? 'is-invalid' : ''); ?>" name="password" placeholder="<?php echo e(__('providers.password')); ?>" value='<?php echo e(old("password", "")); ?>'/>
                        </div>

                        <div class="form-group col">
                            <label><?php echo e(__('providers.password_confirmation')); ?> </label>
                            <input type="password" class="form-control <?php echo e($errors->has('password_confirmation') ? 'is-invalid' : ''); ?>" name="password_confirmation" placeholder="<?php echo e(__('providers.password_confirmation')); ?>" value='<?php echo e(old("password_confirmation", "")); ?>'/>
                        </div>
                    </div>
                    <div class="row col-lg-12">
                        <div class="form-group col">
                            <label><?php echo e(__('providers.status')); ?> </label>
                            <select name="status" id="status" class="form-control">
                                <?php $__currentLoopData = __('providers.statuses'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $status=>$label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($status); ?>" <?php echo e($status == old("status", $provider->providerProfile->status ?? '') ? 'selected' : ''); ?>><?php echo e($label); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="form-group col">
                            <label><?php echo e(__('providers.photo')); ?> </label>
                            <input type="file" class="form-control <?php echo e($errors->has('photo') ? 'is-invalid' : ''); ?>" name="photo" placeholder="<?php echo e(__('providers.photo')); ?>" value='<?php echo e(old('photo', '')); ?>' accept="image/*"/>
                            <?php if(($provider->photo ?? null) && ($provider->photo_url ?? null)): ?>
                                <a href="<?php echo e($provider->photo_url); ?>" class="btn btn-primary" target="_new"><i class="fas fa-download"></i></a>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
                
                <div class="tab-pane col-12 pt-5" id="badges">
                    <div class="custom-control custom-switch">
                        <input type="checkbox" class="custom-control-input" id="is_top" name="is_top" <?php echo e(old('is_top', $provider->providerProfile->is_top ?? 0) ? 'checked' : ''); ?>>
                        <label class="custom-control-label" for="is_top"><?php echo e(__('providers.badges_labels.top')); ?></label>
                    </div>
                    <div class="custom-control custom-switch">
                        <input type="checkbox" class="custom-control-input" id="is_reliable" name="is_reliable" <?php echo e(old('is_reliable', $provider->providerProfile->is_reliable ?? 0) ? 'checked' : ''); ?>>
                        <label class="custom-control-label" for="is_reliable"><?php echo e(__('providers.badges_labels.reliable')); ?></label>
                    </div>
                    <div class="custom-control custom-switch">
                        <input type="checkbox" class="custom-control-input" id="is_most_active" <?php echo e($provider->is_most_active ?? 0 ? 'checked' : ''); ?> <?php if(true): echo 'disabled'; endif; ?>>
                        <label class="custom-control-label" for="is_most_active"><?php echo e(__('providers.badges_labels.most_active_user_units_month')); ?></label>
                    </div>
                </div>
                

                <div class="tab-pane col-12 pt-5" id="stats">
                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th><?php echo e(__('providers.total_units')); ?></th>
                                <th><?php echo e(__('providers.total_sold_units')); ?></th>
                                <th><?php echo e(__('providers.total_visits')); ?></th>
                            </tr>
                        </thead>
                        <tr>
                            <th><?php echo e($provider->total_units ?? 0); ?></th>
                            <th><?php echo e($provider->total_sold ?? 0); ?></th>
                            <th><?php echo e($provider->total_units_visits ?? 0); ?></th>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="text-center mt-5 col-12">
                <button class="butn"><span><?php echo e(__('dashboard.save')); ?></span></button>
            </div>
        </form>
    </div>

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


<?php $__env->startSection('inner_js'); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/resources/views/admin/providers/form.blade.php ENDPATH**/ ?>