
<?php $__env->startSection('title'); ?> বিজ্ঞাপন | TESTPAPER <?php $__env->stopSection(); ?>
<?php $__env->startSection('ads'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('ads.index'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('main_content_section'); ?>
<div class="row py-3 ps-2">
    <div class="heading d-flex justify-content-start align-items-center">
        <h3 class="mb-0"><span> বিজ্ঞাপন সম্পাদন</span></h3>
    </div>
</div>

<!-- BEGIN: Content-->
<div class="app-content content ">
    <div class="card">
        <div class="card-body">
            <form action="<?php echo e(route('ads.update',$ads->id)); ?>" method="post"
                enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <?php echo method_field('put'); ?>
                <div class="col-md-12">
                    <div class="row">

                        <div class="col-md-12 mb-3">
                            <div class="form-group">
                                <label for="name">ডেসক্রিপসন <span class=" text-danger">(required)</span></label>
                                <textarea class=" form-control" name="ads_text" id="ads_descrition" cols="20" rows="5"
                                    placeholder=" বিজ্ঞাপন বিস্তারিত"><?php echo $ads->ads_text; ?></textarea>

                                <span id="warnTextDesc2" class="text-danger warn d-none">Description is required</span>
                            </div>

                            <?php $__errorArgs = ['ads_text'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="col-md-12" style="margin-top: 15px;">
                            <button type="submit" class="btn btn btn-success m-0 py-2 text-right"
                                onclick="return validate()">সম্পাদন</button>
                        </div>

                    </div>

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

    </div>

</div>
<!-- END: Content-->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<!-- tinymce text editor -->
<script src="<?php echo e(asset('backend/template-assets/js/tinymce.min.js')); ?>"></script>
<script src="<?php echo e(asset('backend/template-assets/js/custom_tinymce.js')); ?>"></script>

<script>
    //To check validation...
    function validate(){
        if ((tinymce.EditorManager.get('ads_descrition').getContent()) == '') {
            document.getElementById('warnTextDesc2').classList.add('active')
            return false;
        }
    };
</script>

<script>
    var editor_config = {
            path_absolute : "/",
            selector: "textarea",
            plugins: [
                "advlist autolink lists link image charmap print preview hr anchor pagebreak",
                "searchreplace wordcount visualblocks visualchars code fullscreen",
                "insertdatetime media nonbreaking save table contextmenu directionality",
                "emoticons template paste textcolor colorpicker textpattern"
            ],
            toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media",
            relative_urls: false,
            file_browser_callback : function(field_name, url, type, win) {
                var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
                var y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;

                var cmsURL = editor_config.path_absolute + 'laravel-filemanager?field_name=' + field_name;
                if (type == 'image') {
                    cmsURL = cmsURL + "&type=Images";
                } else {
                    cmsURL = cmsURL + "&type=Files";
                }

                tinyMCE.activeEditor.windowManager.open({
                    file : cmsURL,
                    title : 'Filemanager',
                    width : x * 0.8,
                    height : y * 0.8,
                    resizable : "yes",
                    close_previous : "no"
                });
            }
        };

        tinymce.init(editor_config);
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\Project\Personal-Project\Office-Project\update\test-paper-final\resources\views/admin/ads/edit.blade.php ENDPATH**/ ?>