<?php $__env->startSection('title'); ?> <?php if( ! empty($title)): ?> <?php echo e($title); ?> | <?php endif; ?> ##parent-placeholder-3c6de1b7dd91465d437ef415f94f36afc1fbc8a8## <?php $__env->stopSection(); ?>


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

        <div id="wrapper">

            <?php echo $__env->make('admin.sidebar_menu', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>

            <div id="page-wrapper">
                <?php if( ! empty($title)): ?>
                    <div class="row">
                        <div class="col-lg-12">
                            <h1 class="page-header"> <?php echo e($title); ?>  </h1>
                        </div> <!-- /.col-lg-12 -->
                    </div> <!-- /.row -->
                <?php endif; ?>

                <?php echo e(Form::open(['route'=>'save_settings','class' => 'form-horizontal', 'files' => true])); ?>



                    <div id="social_login_settings_wrap">

                        <legend><?php echo app('translator')->getFromJson('app.social_login'); ?></legend>
                        <div class="form-group <?php echo e($errors->has('enable_social_login')? 'has-error':''); ?>">
                            <label class="col-md-4 control-label"><?php echo app('translator')->getFromJson('app.enable_disable'); ?> </label>
                            <div class="col-md-8">
                                <label for="enable_social_login" class="checkbox-inline">
                                    <input type="checkbox" value="1" id="enable_social_login" name="enable_social_login" <?php echo e(get_option('enable_social_login') == 1 ? 'checked="checked"': ''); ?>>
                                    <?php echo app('translator')->getFromJson('app.enable_social_login'); ?>
                                </label>

                                <p class="text-info"><?php echo app('translator')->getFromJson('app.enable_social_login_help_text'); ?></p>
                            </div>
                        </div>


                        <div class="form-group <?php echo e($errors->has('enable_facebook_login')? 'has-error':''); ?>">
                            <label class="col-md-4 control-label"><?php echo app('translator')->getFromJson('app.enable_disable'); ?> </label>
                            <div class="col-md-8">
                                <label for="enable_facebook_login" class="checkbox-inline">
                                    <input type="checkbox" value="1" id="enable_facebook_login" name="enable_facebook_login" <?php echo e(get_option('enable_facebook_login') == 1 ? 'checked="checked"': ''); ?>>
                                    <?php echo app('translator')->getFromJson('app.enable_facebook_login'); ?>
                                </label>
                            </div>
                        </div>

                        <div class="form-group <?php echo e($errors->has('enable_google_login')? 'has-error':''); ?>">
                            <label class="col-md-4 control-label"><?php echo app('translator')->getFromJson('app.enable_disable'); ?> </label>
                            <div class="col-md-8">
                                <label for="enable_google_login" class="checkbox-inline">
                                    <input type="checkbox" value="1" id="enable_google_login" name="enable_google_login" <?php echo e(get_option('enable_google_login') == 1 ? 'checked="checked"': ''); ?>>
                                    <?php echo app('translator')->getFromJson('app.enable_google_login'); ?>
                                </label>
                            </div>
                        </div>




                        <div id="facebook_login_api_wrap" style="display: <?php echo e(get_option('enable_facebook_login') == 1 ? 'block' : 'none'); ?>;">
                            <hr />
                            <div class="form-group">
                                <label for="fb_app_id" class="col-sm-4 control-label"><?php echo app('translator')->getFromJson('app.facebook'); ?> <?php echo app('translator')->getFromJson('app.app_id'); ?></label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" id="fb_app_id" value="<?php echo e(get_option('fb_app_id')); ?>" name="fb_app_id" placeholder="<?php echo app('translator')->getFromJson('app.fb_app_id'); ?>">
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="fb_app_secret" class="col-sm-4 control-label"><?php echo app('translator')->getFromJson('app.facebook'); ?> <?php echo app('translator')->getFromJson('app.app_secret'); ?></label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" id="fb_app_secret" value="<?php echo e(get_option('fb_app_secret')); ?>" name="fb_app_secret" placeholder="<?php echo app('translator')->getFromJson('app.app_secret'); ?>">
                                </div>
                            </div>

                        </div>


                        <div id="google_login_api_wrap" style="display: <?php echo e(get_option('enable_google_login') == 1 ? 'block' : 'none'); ?>;">
                            <hr />
                            <div class="form-group">
                                <label for="google_client_id" class="col-sm-4 control-label"><?php echo app('translator')->getFromJson('app.google'); ?> <?php echo app('translator')->getFromJson('app.client_id'); ?></label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" id="google_client_id" value="<?php echo e(get_option('google_client_id')); ?>" name="google_client_id" placeholder="<?php echo app('translator')->getFromJson('app.google_client_id'); ?>">
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="google_client_secret" class="col-sm-4 control-label"><?php echo app('translator')->getFromJson('app.google'); ?> <?php echo app('translator')->getFromJson('app.client_secret'); ?></label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" id="google_client_secret" value="<?php echo e(get_option('google_client_secret')); ?>" name="google_client_secret" placeholder="<?php echo app('translator')->getFromJson('app.app_secret'); ?>">
                                </div>
                            </div>

                        </div>

                    </div>

                <hr />

                <div class="form-group">
                    <div class="col-sm-offset-4 col-sm-8">
                        <button type="submit" id="settings_save_btn" class="btn btn-primary"><?php echo app('translator')->getFromJson('app.save_settings'); ?></button>
                    </div>
                </div>

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


            </div>   <!-- /#page-wrapper -->

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


<?php $__env->startSection('page-js'); ?>
    <script>
        $(document).ready(function(){

            $('input[type="checkbox"], input[type="radio"]').click(function(){
                var input_name = $(this).attr('name');
                var input_value = 0;
                if ($(this).prop('checked')){
                    input_value = $(this).val();
                }
                $.ajax({
                    url : '<?php echo e(route('save_settings')); ?>',
                    type: "POST",
                    data: { [input_name]: input_value, '_token': '<?php echo e(csrf_token()); ?>' }
                });
            });

            /**
             * show or hide stripe and paypal settings wrap
             */
            $('#enable_facebook_login').click(function(){
                if ($(this).prop('checked')){
                    $('#facebook_login_api_wrap').slideDown();
                }else{
                    $('#facebook_login_api_wrap').slideUp();
                }
            });
            $('#enable_google_login').click(function(){
                if ($(this).prop('checked')){
                    $('#google_login_api_wrap').slideDown();
                }else{
                    $('#google_login_api_wrap').slideUp();
                }
            });



            /**
             * Send settings option value to server
             */
            $('#settings_save_btn').click(function(e){
                e.preventDefault();

                var this_btn = $(this);
                this_btn.attr('disabled', 'disabled');

                var form_data = this_btn.closest('form').serialize();
                $.ajax({
                    url : '<?php echo e(route('save_settings')); ?>',
                    type: "POST",
                    data: form_data,
                    success : function (data) {
                        if (data.success == 1){
                            this_btn.removeAttr('disabled');
                            toastr.success(data.msg, '<?php echo app('translator')->getFromJson('app.success'); ?>', toastr_options);
                        }
                    }
                });
            });

        });
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layout.main', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>