<?php echo e(Form::model($settings, ['method' => 'POST','route' => ['settingsUpdates'],'enctype'=>'multipart/form-data','data-toggle'=>'validator'])); ?>


<?php echo e(Form::hidden('id', null, array('placeholder' => 'id','class' => 'form-control'))); ?>

<?php echo e(Form::hidden('page', $page, array('placeholder' => 'id','class' => 'form-control'))); ?>

<div class="row">
    <div class="col-lg-6">
        <div class="form-group">
            <label for="avatar" class="col-sm-3 form-control-label"><?php echo e(__('message.logo')); ?></label>
            <div class="col-sm-12">
                <div class="row">
                    <div class="col-sm-4">
                        <img src="<?php echo e(getSingleMedia($settings,'site_logo')); ?>" width="100"  id="site_logo_preview" alt="site_logo" class="image site_logo site_logo_preview">
                        <?php if(getMediaFileExit($settings, 'site_logo')): ?>
                            <a class="text-danger remove-file" href="<?php echo e(route('remove.file', ['id' => $settings->id, 'type' => 'site_logo'])); ?>"
                                data--submit="confirm_form"
                                data--confirmation='true'
                                data--ajax="true"
                                title='<?php echo e(__("message.remove_file_title" , ["name" =>  __("message.image") ])); ?>'
                                data-title='<?php echo e(__("message.remove_file_title" , ["name" =>  __("message.image") ])); ?>'
                                data-message='<?php echo e(__("message.remove_file_msg")); ?>'>
                                <i class="ri-close-circle-line"></i>
                            </a>
                        <?php endif; ?>
                    </div>
                    <div class="col-sm-8">
                        <div class="custom-file col-md-12">
                            <?php echo e(Form::file('site_logo', [ 'class'=> 'custom-file-input custom-file-input-sm detail', 'id' => 'site_logo', 'lang' => 'en' , 'accept' => 'image/*' ])); ?>

                            <label class="custom-file-label" for="site_logo"><?php echo e(__('message.logo')); ?></label>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label for="avatar" class="col-sm-3 form-control-label"><?php echo e(__('message.dark_logo')); ?></label>
            <div class="col-sm-12">
                <div class="row">
                    <div class="col-sm-4">
                        <img src="<?php echo e(getSingleMedia($settings,'site_dark_logo')); ?>" width="100"  id="site_dark_logo_preview" alt="site_dark_logo" class="image site_dark_logo site_dark_logo_preview border">
                        <?php if(getMediaFileExit($settings, 'site_dark_logo')): ?>
                            <a class="text-danger remove-file" href="<?php echo e(route('remove.file', ['id' => $settings->id, 'type' => 'site_dark_logo'])); ?>"
                                data--submit="confirm_form"
                                data--confirmation='true'
                                data--ajax="true"
                                title='<?php echo e(__("message.remove_file_title" , ["name" =>  __("message.image") ])); ?>'
                                data-title='<?php echo e(__("message.remove_file_title" , ["name" =>  __("message.image") ])); ?>'
                                data-message='<?php echo e(__("message.remove_file_msg")); ?>'>
                                <i class="ri-close-circle-line"></i>
                            </a>
                        <?php endif; ?>
                    </div>
                    <div class="col-sm-8">
                        <div class="custom-file col-md-12">
                            <?php echo e(Form::file('site_dark_logo', [ 'class'=> 'custom-file-input custom-file-input-sm detail', 'id' => 'site_dark_logo', 'lang' => 'en' , 'accept' => 'image/*' ])); ?>

                            <label class="custom-file-label" for="site_dark_logo"><?php echo e(__('message.dark_logo')); ?></label>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label for="avatar" class="col-sm-6 form-control-label"><?php echo e(__('message.favicon')); ?></label>
            <div class="col-sm-12">
                <div class="row">
                    <div class="col-sm-4">
                        <img src="<?php echo e(getSingleMedia($settings,'site_favicon')); ?>" height="30"  id="site_favicon_preview" alt="site_favicon" class="image site_favicon site_favicon_preview">
                        <?php if(getMediaFileExit($settings, 'site_favicon')): ?>
                            <a class="text-danger remove-file" href="<?php echo e(route('remove.file', ['id' => $settings->id, 'type' => 'site_favicon'])); ?>"
                                data--submit="confirm_form"
                                data--confirmation='true'
                                data--ajax="true"
                                title='<?php echo e(__("message.remove_file_title" , ["name" =>  __("message.image") ])); ?>'
                                data-title='<?php echo e(__("message.remove_file_title" , ["name" =>  __("message.image") ])); ?>'
                                data-message='<?php echo e(__("message.remove_file_msg")); ?>'>
                                <i class="ri-close-circle-line"></i>
                            </a>
                        <?php endif; ?>
                    </div>
                    <div class="col-sm-8">
                        <div class="custom-file col-md-12">
                            <?php echo e(Form::file('site_favicon', ['class'=>"custom-file-input custom-file-input-sm detail" , 'id'=>"site_favicon" , 'lang'=>"en" , 'accept'=>"image/*"])); ?>

                            <?php echo e(Form::label('site_favicon',__('message.site_favicon'), ['class' => 'custom-file-label'])); ?>

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

            </div>
        </div>

        <div class="form-group">
            <?php echo e(Form::label('site_name',__('message.site_name'), ['class' => 'col-sm-6  form-control-label'])); ?>

            <div class="col-sm-12">
                <?php echo e(Form::text('site_name', null, ['class'=>"form-control" ,'placeholder'=> __('message.site_name') ])); ?>

            </div>
        </div>

        <div class="form-group">
            <?php echo e(Form::label('site_description',__('message.site_description'), ['class' => 'col-sm-6  form-control-label'])); ?>

            <div class="col-sm-12">
                <?php echo e(Form::textarea('site_description', null, ['class'=>"form-control textarea" , 'rows'=>3  , 'placeholder'=> __('message.site_description')])); ?>

            </div>
        </div>

        <div class="form-group">
            <?php echo e(Form::label('contact_email',__('message.contact_email'), ['class' => 'col-sm-6  form-control-label'])); ?>

            <div class="col-sm-12">
                <?php echo e(Form::text('support_email', null, ['class'=>"form-control" ,'placeholder'=> __('message.contact_email') ])); ?>

            </div>
        </div>

        <div class="form-group">
            <?php echo e(Form::label('contact_number',__('message.contact_number'), ['class' => 'col-sm-6  form-control-label'])); ?>

            <div class="col-sm-12">
                <?php echo e(Form::text('support_number', null, ['class'=>"form-control" ,'placeholder'=> __('message.contact_number') ])); ?>

            </div>
        </div>

        <div class="form-group">
            <?php echo e(Form::label('site_email', __('message.site_email'), ['class' => 'col-sm-6  form-control-label'])); ?>

            <div class="col-sm-12">
                <?php echo e(Form::text('site_email', null , ['class' => 'form-control', 'placeholder' => __('message.site_email'), ])); ?>

            </div>
        </div>

    </div>
    <div class="col-lg-6">
        <div class="form-group">
            <?php echo e(Form::label('default_language',__('message.default_language'), ['class' => 'col-sm-12  form-control-label'])); ?>

            <div class="col-sm-12">
                <select class="form-control select2js default_language" name="env[DEFAULT_LANGUAGE]" id="default_language">
                    <?php $__currentLoopData = languagesArray(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($language['id']); ?>" <?php echo e(config('app.locale') == $language['id']  ? 'selected' : ''); ?>  ><?php echo e($language['title']); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
        </div>
        <div class="form-group">
            <?php echo e(Form::label('language_option',__('message.language_option'), ['class' => 'col-sm-12  form-control-label'])); ?>

            <div class="col-sm-12">
                <select class="form-control select2js language_option" name="language_option[]" id="language_option" multiple>
                    <?php $__currentLoopData = languagesArray(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if(config('app.locale') == $language['id']  ): ?>
                            <option value="<?php echo e($language['id']); ?>"  disabled=""><?php echo e($language['title']); ?></option>
                        <?php else: ?>
                            <option value="<?php echo e($language['id']); ?>" <?php echo e(in_array($language['id'], $settings->language_option) ? 'selected' : ''); ?>  ><?php echo e($language['title']); ?></option>
                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
        </div>

        <div class="form-group">
            <?php echo e(Form::label('currency', __('message.currency'), ['class' => 'col-sm-12 form-control-label'])); ?>

            <div class="col-sm-12">
                <?php
                    $currency_code = $settings->currency_code  ?? 'USD';
                    $currency = currencyArray($currency_code);
                ?>
                <select class="form-control select2js" name="currency_code" id="currency_code">
                    <?php $__currentLoopData = currencyArray(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $array): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($array['code']); ?>" <?php echo e($array['code'] == $currency_code  ? 'selected' : ''); ?>>
                            ( <?php echo e($array['symbol']); ?> ) <?php echo e($array['name']); ?>

                        </option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
        </div>

        <div class="form-group">
            <?php echo e(Form::label('currency_position', __('message.currency_position'), ['class' => 'col-sm-12 form-control-label'])); ?>

            <div class="col-sm-12">
                <?php echo e(Form::select('currency_position',['left' => __('message.left') , 'right' => __('message.right') ], isset($settings) ? $settings->currency_position : 'left',[ 'class' =>'form-control select2js'])); ?>

            </div>
        </div>


        <div class="form-group">
            <?php echo e(Form::label('timezone', __('message.timezone'), ['class' => 'col-sm-12 form-control-label'])); ?>

            <div class="col-sm-12">
                <?php echo e(Form::select('timezone', [ auth()->user()->timezone => timeZoneList()[ auth()->user()->timezone ] ] , old('timezone') , [
                    'data-ajax--url' => route('ajax-list', [ 'type' => 'timezone' ]),
                    'data-placeholder' => __('message.select_field', [ 'name' => __('message.timezone') ]),
                    'class' =>'form-control select2js', 'required'
                    ])); ?>

            </div>
        </div>

        <div class="form-group">
            <?php echo e(Form::label('facebook_url', __('message.facebook_url'), ['class' => 'col-sm-6  form-control-label'])); ?>

            <div class="col-sm-12">
                <?php echo e(Form::text('facebook_url', null, ['class'=>"form-control", 'placeholder' => __('message.enter_name', [ 'name' => __('message.facebook_url') ]) ])); ?>

            </div>
        </div>
        <div class="form-group">
            <?php echo e(Form::label('twitter_url',__('message.twitter_url'), ['class' => 'col-sm-6  form-control-label'])); ?>

            <div class="col-sm-12">
                <?php echo e(Form::text('twitter_url', null, ['class'=>"form-control", 'placeholder' => __('message.enter_name',[ 'name' => __('message.twitter_url') ]) ])); ?>

            </div>
        </div>

        <div class="form-group">
            <?php echo e(Form::label('linkedin_url',__('message.linkedin_url'), ['class' => 'col-sm-6  form-control-label'])); ?>

            <div class="col-sm-12">
                <?php echo e(Form::text('linkedin_url', null, ['class'=>"form-control", 'placeholder' => __('message.enter_name',[ 'name' => __('message.linkedin_url') ]) ])); ?>

            </div>
        </div>

        <div class="form-group">
            <?php echo e(Form::label('instagram_url',__('message.instagram_url'), ['class' => 'col-sm-6  form-control-label'])); ?>

            <div class="col-sm-12">
                <?php echo e(Form::text('instagram_url', null, ['class'=>"form-control", 'placeholder' => __('message.enter_name',[ 'name' => __('message.instagram_url') ]) ])); ?>

            </div>
        </div>

        <div class="form-group">
            <?php echo e(Form::label('copyright_text',__('message.copyright_text'), ['class' => 'col-sm-6  form-control-label'])); ?>

            <div class="col-sm-12">
                <?php echo e(Form::text('site_copyright', null, ['class'=>"form-control", 'placeholder' =>__('message.copyright_text')])); ?>

            </div>
        </div>
        
    </div>
    <hr>
     <div class="col-lg-12">
        <div class="form-group">
            <div class="col-md-offset-3 col-sm-12 ">
                <?php echo e(Form::submit(__('message.save'), ['class'=>"btn btn-md btn-primary float-md-right"])); ?>

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

<script>
    function getExtension(filename) {
            var parts = filename.split('.');
            return parts[parts.length - 1];
        }
        function isImage(filename) {
            var ext = getExtension(filename);
            switch (ext.toLowerCase()) {
                case 'jpg':
                case 'jpeg':
                case 'png':
                case 'gif':
                case 'ico':
                    return true;
            }
            return false;
        }
    function readURL(input,className) {
        if (input.files && input.files[0]) {
            var reader = new FileReader();
            var res = isImage(input.files[0].name);
            if(res == false){
                var msg = 'Image should be png/PNG, jpg/JPG & jpeg/JPG.';
                Snackbar.show({text: msg ,pos: 'bottom-right',backgroundColor:'#d32f2f',actionTextColor:'#fff'});
                $(input).val("");
                return false;
            }
            reader.onload = function(e){
                $(document).find('img.'+className).attr('src', e.target.result);
                $(document).find("label."+className).text((input.files[0].name));
            }

            reader.readAsDataURL(input.files[0]);
        }
    }
    $(document).ready(function (){
        $('.select2js').select2();
        $(document).on('change','#site_logo',function(){
            readURL(this,'site_logo');
        });
        $(document).on('change','#site_favicon',function(){
            readURL(this,'site_favicon');
        });

        $('.default_language').on('change', function (e) {
            var id= $(this).val();
            $('.language_option option:disabled').prop('selected',true);
            $('.language_option option').prop('disabled',false);

            $('.language_option option').each(function(index, val){
                var $this = $(this);
                if(id == $this.val()){
                $this.prop('disabled',true);
                $this.prop('selected',false);
                }
            });
            $('.language_option').select2("destroy").select2();
        });
    })
</script>
<?php /**PATH /www/wwwroot/mxunzo.atharvatek.com/resources/views/setting/general-setting.blade.php ENDPATH**/ ?>