<?php $__env->startSection('content'); ?>
    <div class="content-page">
        <div class="content">

            <!-- Start Content-->
            <div class="container-fluid">

                <!-- start page title -->
                <div class="row">
                    <div class="col-12">
                        <div class="page-title-box">
                            <h4 class="page-title">Update Website Setup</h4>
                        </div>
                    </div>
                </div>

                <!-- end page title -->

                <div class="card">
                    <div class="card-body">
                        <?php if(isset($websiteSetup) && isset($websiteSetup->id)): ?>
                            <form action="<?php echo e(route('website.update', $websiteSetup->id)); ?>" method="POST"
                                enctype="multipart/form-data" class="needs-validation" novalidate>
                                <?php echo method_field('PUT'); ?>
                            <?php else: ?>
                                <form action="<?php echo e(route('website.store')); ?>" method="POST" enctype="multipart/form-data"
                                    class="needs-validation" novalidate>
                        <?php endif; ?>
                        <?php echo csrf_field(); ?>

                        <div class="row">
                            <div class="mb-3 col-md-3">
                                <label class="form-label">Contact Phone</label>
                                <input type="text" class="form-control" name="contact_phone_1"
                                    oninput="validatePhone(this)"
                                    <?php if(isset($websiteSetup)): ?> value="<?php echo e(old('contact_phone_1', optional($websiteSetup)->contact_phone_1)); ?>" <?php endif; ?>>
                            </div>
                            <div class="mb-3 col-md-3">
                                <label class="form-label">Contact Phone 2</label>
                                <input type="text" class="form-control" name="contact_phone_2"
                                    oninput="validatePhone(this)"
                                    <?php if(isset($websiteSetup)): ?> value="<?php echo e(old('contact_phone_2', optional($websiteSetup)->contact_phone_2)); ?>" <?php endif; ?>>
                            </div>
                            <div class="mb-3 col-md-3">
                                <label class="form-label">Contact Email</label>
                                <input type="email" class="form-control" name="contact_email_1"
                                    <?php if(isset($websiteSetup)): ?> value="<?php echo e(old('contact_email_1', optional($websiteSetup)->contact_email_1)); ?>" <?php endif; ?>>
                            </div>
                            <div class="mb-3 col-md-3">
                                <label class="form-label">Contact Email 2</label>
                                <input type="email" class="form-control" name="contact_email_2"
                                    <?php if(isset($websiteSetup)): ?> value="<?php echo e(old('contact_email_2', optional($websiteSetup)->contact_email_2)); ?>" <?php endif; ?>>
                            </div>
                            <div class="mb-3 col-md-4">
                                <label class="form-label">Whatsapp</label>
                                <div class="input-group flatpickr">
                                    <span class="input-group-text input-group-addon bg-success" data-toggle><i
                                            class="text-white bx bxl-whatsapp"></i></span>
                                    <input type="text" class="form-control" name="whatsapp_link"
                                        oninput="validatePhone(this)"
                                        <?php if(isset($websiteSetup)): ?> value="<?php echo e(old('whatsapp_link', optional($websiteSetup)->whatsapp_link)); ?>" <?php endif; ?>>
                                </div>
                            </div>

                            <div class="mb-3 col-md-4">
                                <label class="form-label">Facebook Link</label>
                                <div class="input-group flatpickr">
                                    <span class="input-group-text input-group-addon bg-primary" data-toggle><i
                                            class="text-white bx bxl-facebook"></i></span>
                                    <input type="text" class="form-control" name="facebook_link"
                                        <?php if(isset($websiteSetup)): ?> value="<?php echo e(old('facebook_link', optional($websiteSetup)->facebook_link)); ?>" <?php endif; ?>>
                                </div>
                            </div>

                            <div class="mb-3 col-md-4">
                                <label class="form-label">Twitter Link</label>
                                <div class="input-group flatpickr">
                                    <span class="input-group-text input-group-addon bg-info" data-toggle><i
                                            class="text-white bx bxl-twitter"></i></span>
                                    <input type="text" class="form-control" name="twitter_link"
                                        <?php if(isset($websiteSetup)): ?> value="<?php echo e(old('twitter_link', optional($websiteSetup)->twitter_link)); ?>" <?php endif; ?>>
                                </div>
                            </div>

                            <div class="mb-3 col-md-4">
                                <label class="form-label">Instagram Link</label>
                                <div class="input-group flatpickr">
                                    <span class="input-group-text input-group-addon bg-danger" data-toggle><i
                                            class="text-white bx bxl-instagram"></i></span>
                                    <input type="text" class="form-control" name="instagram_link"
                                        <?php if(isset($websiteSetup)): ?> value="<?php echo e(old('instagram_link', optional($websiteSetup)->instagram_link)); ?>" <?php endif; ?>>
                                </div>
                            </div>

                            <div class="mb-3 col-md-4">
                                <label class="form-label">Linkedin Link</label>
                                <div class="input-group flatpickr">
                                    <span class="input-group-text input-group-addon bg-primary" data-toggle><i
                                            class="text-white bx bxl-linkedin"></i></span>
                                    <input type="text" class="form-control" name="linkedin_link"
                                        <?php if(isset($websiteSetup)): ?> value="<?php echo e(old('linkedin_link', optional($websiteSetup)->linkedin_link)); ?>" <?php endif; ?>>
                                </div>
                            </div>

                            <div class="mb-3 col-md-4">
                                <label class="form-label">Youtube Link</label>
                                <div class="input-group flatpickr">
                                    <span class="input-group-text input-group-addon bg-danger" data-toggle><i
                                            class="text-white bx bxl-youtube"></i></span>
                                    <input type="text" class="form-control" name="youtube_link"
                                        <?php if(isset($websiteSetup)): ?> value="<?php echo e(old('youtube_link', optional($websiteSetup)->youtube_link)); ?>" <?php endif; ?>>
                                </div>
                            </div>

                            <div class="mb-3 col-md-6">
                                <label class="form-label">Copyright Text</label>
                                <input type="text" class="form-control" name="copyright_text"
                                    <?php if(isset($websiteSetup)): ?> value="<?php echo e(old('copyright_text', optional($websiteSetup)->copyright_text)); ?>" <?php endif; ?>>
                            </div>

                            <div class="mb-3 col-md-6">
                                <label class="form-label">Contact Address </label>
                                <textarea class="form-control" id="example-textarea" name="contact_address" rows="5">
                                    <?php if(isset($websiteSetup)): ?>
                                        <?php echo e(old('contact_address', optional($websiteSetup)->contact_address)); ?>

                                    <?php endif; ?>
                                </textarea>
                            </div>

                            <div class="mb-3 col-md-12">
                                <label class="form-label">About Footer</label>
                                <textarea class="ckeditor" id="example-textarea" name="about_footer" rows="5">
                                    <?php if(isset($websiteSetup)): ?>
                                        <?php echo e(old('about_footer', optional($websiteSetup)->about_footer)); ?>

                                    <?php endif; ?>
                                </textarea>
                            </div>


                            <div class="mb-3 col-md-4">
                                <label class="form-label">Logo</label>
                                <input type="file" id="logo" name="logo" class="form-control">
                                <?php if(isset($websiteSetup)): ?>
                                    <img class="mt-2" id="logo_img"
                                        src="<?php echo e(URL::asset('backend/images/website/' . old('logo', optional($websiteSetup)->logo))); ?>"
                                        onerror="this.onerror=null; this.src='<?php echo e(asset('backend/images/no_image.png')); ?>'"
                                        style="width: 25%;" />
                                <?php else: ?>
                                    <img class="mt-2" id="logo_img" src="<?php echo e(asset('backend/images/no_image.png')); ?>"
                                        onerror="this.onerror=null;this.src='<?php echo e(asset('backend/images/no_image.png')); ?>'"
                                        style="width:25%;">
                                <?php endif; ?>
                            </div>

                            <div class="mb-3 col-md-4">
                                <label class="form-label">Footer Logo</label>
                                <input type="file" id="footer_logo" name="footer_logo" class="form-control">
                                <?php if(isset($websiteSetup)): ?>
                                    <img class="mt-2" id="foot_logo_img"
                                        src="<?php echo e(URL::asset('backend/images/website/' . old('footer_logo', optional($websiteSetup)->footer_logo))); ?>"
                                        onerror="this.onerror=null; this.src='<?php echo e(asset('backend/images/no_image.png')); ?>'"
                                        style="width: 25%;" />
                                <?php else: ?>
                                    <img class="mt-2" id="foot_logo_img" src="<?php echo e(asset('backend/images/no_image.png')); ?>"
                                        onerror="this.onerror=null;this.src='<?php echo e(asset('backend/images/no_image.png')); ?>'"
                                        style="width:25%;">
                                <?php endif; ?>
                            </div>

                            <div class="mb-3 col-md-4">
                                <label class="form-label">Favicon</label>
                                <input type="file" id="favicon" name="favicon" class="form-control">
                                <?php if(isset($websiteSetup)): ?>
                                    <img class="mt-2" id="favicon_img"
                                        src="<?php echo e(URL::asset('backend/images/website/' . old('favicon', optional($websiteSetup)->favicon))); ?>"
                                        onerror="this.onerror=null; this.src='<?php echo e(asset('backend/images/no_image.png')); ?>'"
                                        style="width:10%;" />
                                <?php else: ?>
                                    <img class="mt-2" id="favicon_img"
                                        src="<?php echo e(asset('backend/images/no_image.png')); ?>"
                                        onerror="this.onerror=null;this.src='<?php echo e(asset('backend/images/no_image.png')); ?>'"
                                        style="width:10%;">
                                <?php endif; ?>
                            </div>

                            <div class="mb-3 col-md-4">
                                <button class="btn btn-primary" type="submit">Submit</button>
                            </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <!-- container -->
    </div>
    <!-- content -->

    </div>

    </div>
    <!-- END wrapper -->

    <script>
        logo.onchange = evt => {
            const [file] = logo.files
            if (file) {
                logo_img.src = URL.createObjectURL(file)
            }
        }

        footer_logo.onchange = evt => {
            const [file] = footer_logo.files
            if (file) {
                foot_logo_img.src = URL.createObjectURL(file)
            }
        }

        favicon.onchange = evt => {
            const [file] = favicon.files
            if (file) {
                favicon_img.src = URL.createObjectURL(file)
            }
        }
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('backend.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\auto-enterprises\resources\views/backend/website/index.blade.php ENDPATH**/ ?>