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



<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>



<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>



<script src="https://cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/css/bootstrap-select.min.css">

<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/js/bootstrap-select.min.js"></script>



<main id="main" class="main">

    <?php if( Session::get('permissions.user_type') == 'A' || Session::get('permissions.user_type') == 'SA'): ?>

	    <div style="visibility:hidden">

	        <?php if($dataDetails->id !=null): ?>

	            <?php echo e($image_required = ''); ?>


	        <?php else: ?>

	            <?php echo e($image_required = 'required'); ?>


	        <?php endif; ?>

	    </div>

        <div class="page-breadcrumb">

            <div class="row">

                <div class="col-12 d-flex no-block align-items-center justify-content-between px-4 mb-2">

                    <h4 class="page-title">CATEGORY BANNER</h4>

                    <div class="ml-auto text-right">

                        <a href="<?php echo e(route('admin.category.list')); ?>" class="btn btn-outline-info">Back</a>

                    </div>

                </div>

            </div>

        </div>



        <div class="container-fluid">

            <!-- ============================================================== -->

            <!-- Start Page Content -->

            <!-- ============================================================== -->

            <div class="row">

                <div class="col-12">

                    <div class="card">

                        <?php $__currentLoopData = ['danger', 'warning', 'success', 'info']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $msg): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                            <?php if(Session::has('alert-' . $msg)): ?>

                                <h4 class="font-weight-light alert alert-<?php echo e($msg); ?>"><?php echo e(Session::get('alert-' . $msg)); ?></h4>

                            <?php endif; ?>

                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                        <form action="<?php echo e(url('admin/category/list_banners_edit/')); ?>/<?php echo e(encrypt($dataDetails->id)); ?>" method="POST" class="form-horizontal" id="formadd" enctype="multipart/form-data">

                            <?php echo csrf_field(); ?>

                            <div class="card-body">

                                <h4 class="card-title">Category Banner Edit</h4>

                                

                                <input type="hidden" name="formid" value="<?php echo $dataDetails->id; ?>">

                                <div class="form-group m-t-20">

                                    <label>Site Name<span></span></label>

                                    <input type="text" class="form-control" id="site_id" name="site_id" value="<?php echo e($site->site_name); ?>" disabled>

                                </div>

                                <div class="form-group m-t-20">

                                    <label>Category Image<span>*</span></label>

                                    <input type="file" class="form-control" id="image" name="image" value="" placeholder="Enter Category Title" <?php echo e($image_required); ?>>

                                    <?php if($dataDetails->image != ''): ?>

                                        <a href="<?php echo e(asset('upload/category_banners/' . $dataDetails->image)); ?>" target="blank">

                                            <img style="width: 500px; height: auto; border-radius: 1%;"

                                                src="<?php echo e(asset('upload/category_banners/' . $dataDetails->image)); ?>"

                                                alt="">

                                        </a>

                                    <?php endif; ?>

                                </div>

                                <div class="form-group m-t-20">

                                    <label>Banner Alt Msg</label>

                                    <input type="text" class="form-control" id="cbhead" name="cbhead" value="<?php echo e($dataDetails->ban_head); ?>" placeholder="Enter Banner Alt Msg" >

                                </div>

                                <div class="form-group m-t-20">

                                    <label>Banner Heading</label>*</span></label>

                                    <input type="text" class="form-control" id="cbannerhead" name="cbannerhead" value="<?php echo e($dataDetails->banner_heading); ?>" placeholder="Enter Banner Heading" required>

                                </div>

                                <div class="form-group m-t-20">

                                    <label>Content Top</label>

                                    <textarea class="form-control" rows="5" id="cbcontenttop" name="cbcontenttop" placeholder="Enter Content Top" ><?php echo e($dataDetails->content_top); ?></textarea>

                                </div>

                                <div class="form-group m-t-20">

                                    <label>Content Bottom</label>

                                    <textarea class="form-control" rows="5" id="cbcontentbottom" name="cbcontentbottom" placeholder="Enter Content Bottom"><?php echo e($dataDetails->content_bottom); ?></textarea>

                                </div>

                                <div class="form-group m-t-20">

                                    <label>Meta Title</label>

                                    <input type="text" class="form-control" id="cbmeta_title" name="cbmeta_title" value="<?php echo e($dataDetails->meta_title); ?>" placeholder="Enter Meta Title" required>

                                </div>

                                <div class="form-group m-t-20">

                                    <label>Meta Description</label>

                                    <textarea class="form-control" rows="5" id="cbmeta_description" name="cbmeta_description" placeholder="Enter Meta Description" required><?php echo e($dataDetails->meta_description); ?></textarea>

                                </div>

                                <div class="form-group m-t-20">

                                    <label>Tagline</label>

                                    <input type="text" class="form-control" id="cbtagline" name="cbtagline" value="<?php echo e($dataDetails->tag_line); ?>" placeholder="Enter Tagline" >

                                </div>

                                <div class="form-group m-t-20">

                                    <label>Top Head</label>

                                    <input type="text" class="form-control" id="cbtophead" name="cbtophead" value="<?php echo e($dataDetails->tophead); ?>" placeholder="Enter Tophead" >

                                </div>

                            </div>

                            <div class="border-top">

                                <div class="card-body">

                                    <input class="btn btn-primary" type="submit" value="UPDATE">

                                </div>

                            </div>

                        </form>

                    </div>

                </div>

            </div>

        </div>

    <?php endif; ?>

</main>    



<script type="text/javascript">



    $.validator.setDefaults({

            submitHandler: function(form) {

                form.submit();

            }

    });

    $(document).ready(function () {
        setTimeout(function () {
            $('.cke_notifications_area').attr("style", "display: none !important");
        }, 1000); // 60000ms = 1 minute
    });

    $(function() {

        // validate the comment form when it is submitted

        $("#formadd").validate({

            ignore: [],

            errorPlacement: function(label, element) {

                label.addClass('mt-2 text-danger');

                label.insertAfter(element);

            },

            highlight: function(element, errorClass) {

                $(element).parents('.form-group').addClass('has-danger')

                $(element).addClass('form-control-danger')

            }

          });

    });





    CKEDITOR.replace("cbcontenttop");

    CKEDITOR.replace("cbcontentbottom");





    $('#title').on('blur', function(){

        var title = $.trim($(this).val());

        if(title != ''){

            //if($.trim($('#slug').val()) == ''){

                $('#slug').val(title.replace(/ /g,"-").toLowerCase());

                $('#slug-error').hide();

            //}

        }

    });



    



    $('.ctype').click(function(){

        if(this.value == 'P'){

            $('.price-range').show();

            $('#from_price').attr('required', true);

            $('#to_price').attr('required', true);

            $('#equation').attr('required', true);

        }else{

            $('.price-range').hide();

            $('#from_price').removeattr('required', true);

            $('#to_price').removeattr('required', true);

            $('#equation').removeattr('required', true);

        }

       

    })



    if($('#cattype').val() == 'P'){

        $('.price-range').show();

        $('#from_price').attr('required', true);

        $('#to_price').attr('required', true);

        $('#equation').attr('required', true);

    }else{

        $('.price-range').hide();

        $('#from_price').removeattr('required', true);

        $('#to_price').removeattr('required', true);

        $('#equation').removeattr('required', true);

    }





    var _URL = window.URL || window.webkitURL;

    $("#image").change(function (e) {

        var file, img;



        var fuData = document.getElementById('image');

        var FileUploadPath1 = fuData.value;

        if (FileUploadPath1 == ''){

            alert("Please upload an image");

        }

        else{

            var Extension = FileUploadPath1.substring(FileUploadPath1.lastIndexOf('.') + 1).toLowerCase();

            if (Extension == "gif" || Extension == "png" || Extension == "bmp" || Extension == "jpeg" || Extension == "jpg" || Extension == "webp"){

                if ((file = this.files[0])) {

                    img = new Image();

                    img.onload = function () {

                        // if(this.width < 1920 || this.height < 308) {

                        //     //alert('Minimum upload image size 1920px X 379px');

                        //     alert('Minimum upload image size 1920px X 308px');

                        //     document.getElementById('image').value="";

                        //     document.getElementById('list').src="";

                        //     $('#list').hide();

                        //     return false;

                        // }

                        // else{

                            $('#list').show();

                            var output = document.getElementById('list');

                            output.src = URL.createObjectURL(e.target.files[0]);

                            document.getElementById('list').style.width="300px";

                            return true;

                        //}

                    };

                    img.src = _URL.createObjectURL(file);

                }

            }

        }

    });





</script>     



<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/rightflorist/public_html/ofadmin.rightflorist.org/resources/views/admin/category/category_banner_edit.blade.php ENDPATH**/ ?>