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

<!-- [ breadcrumb ] start -->
<div class="page-header">
    <div class="page-block">
        <div class="row align-items-center">
            <div class="col-md-12">
                <ul class="breadcrumb">
                    <li class="breadcrumb-item"><a href="<?php echo e(route('admin.dashboard')); ?>">হোম</a></li>
                    <li class="breadcrumb-item"><a href="javascript: void(0)">কন্টেন্ট</a></li>
                    <li class="breadcrumb-item" aria-current="page">নিউজ / তৈরি করুন</li>
                </ul>
            </div>
            <div class="col-md-12">
                <div class="page-header-title">
                    <h2 class="mb-0">নিউজ / তৈরি করুন</h2>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- [ breadcrumb ] end -->

<?php echo $__env->make('includes.admin.form-both', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<div class="gocover" style="background: url(<?php echo e(asset('assets/images/'.$gs->admin_loader)); ?>) no-repeat scroll center center rgba(45, 45, 45, 0.5);"></div>
<form id="geniusformdata2" action="<?php echo e(route('article.store')); ?>" method="POST" enctype="multipart/form-data">
    <?php echo e(csrf_field()); ?>

    <input type="hidden" name="is_pending">
    <input type="hidden" name="post_type">
    <div class="row">
        
        <div class="col-lg-8">
            <div class="card">
                <div class="card-header"><h5><?php echo e(__('কন্টেন্ট তথ্য')); ?></h5></div>
                <div class="card-body">
                    <div class="mb-3">
                        <label class="form-label"><?php echo e(__('Language')); ?> <span class="text-danger">*</span></label>
                        <select name="language_id" id="article_language_id" class="form-select">
                            <option value=""><?php echo e(__('Please Select a Language')); ?></option>
                            <?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($language->id); ?>"><?php echo e($language->language); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>

                    <div class="mb-3">
                        <label class="form-label"><?php echo e(__('Title')); ?> <span class="text-danger">*</span></label>
                        <input type="text" class="form-control" name="title" placeholder="<?php echo e(__('Title')); ?>" id="title" autocomplete="off">
                        <small class="text-muted"><?php echo e(__('(In Any Language)')); ?></small>
                    </div>

                    <div class="mb-3">
                        <label class="form-label"><?php echo e(__('Slug')); ?> <span class="text-danger">*</span></label>
                        <input type="text" class="form-control" id="slug" name="slug" placeholder="<?php echo e(__('Slug')); ?>" value="">
                        <p id="slugCheck"></p>
                        <small class="text-muted"><?php echo e(__('In English')); ?></small>
                    </div>

                    <div class="row">
                        <div class="col-md-4 mb-3">
                            <label class="form-label"><?php echo e(__('Division')); ?> <span class="text-danger">*</span></label>
                            <select name="division_id" id="division_id" class="form-select">
                                <option value=""><?php echo e(__('Select Division')); ?></option>
                                <?php $__currentLoopData = $divisions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $division): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($division->id); ?>"><?php echo e($division->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="col-md-4 mb-3">
                            <label class="form-label"><?php echo e(__('District')); ?> <span class="text-danger">*</span></label>
                            <select name="district_id" id="district_id" class="form-select">
                                <option value=""><?php echo e(__('Select District')); ?></option>
                            </select>
                        </div>
                        <div class="col-md-4 mb-3">
                            <label class="form-label"><?php echo e(__('Upazila')); ?> <span class="text-danger">*</span></label>
                            <select name="upazila_id" id="upazila_id" class="form-select">
                                <option value=""><?php echo e(__('Select Upazila')); ?></option>
                            </select>
                        </div>
                    </div>

                    <div class="mb-3">
                        <label class="form-label"><?php echo e(__('Meta Keyword')); ?> <span class="text-danger">*</span></label>
                        <textarea class="form-control" name="meta_tag" rows="2" placeholder="<?php echo e(__('Keyword meta tag')); ?>"></textarea>
                    </div>

                    <div class="mb-3">
                        <label class="form-label">Images Caption <span class="text-danger">*</span></label>
                        <input type="text" class="form-control" name="images_caption" placeholder="<?php echo e(__('Images Caption')); ?>" id="images_caption" autocomplete="off">
                        <small class="text-muted"><?php echo e(__('(In Any Language)')); ?></small>
                    </div>

                    <div class="mb-3">
                        <label class="form-label"><?php echo e(__('Short Description')); ?> <span class="text-danger">*</span></label>
                        <textarea class="form-control" name="short_description" rows="3" placeholder="<?php echo e(__('Short Details')); ?>"></textarea>
                    </div>

                    <div class="mb-3 description">
                        <label class="form-label"><?php echo e(__('Description')); ?> <span class="text-danger">*</span></label>
                        <textarea class="nic-edit" name="description" placeholder="<?php echo e(__('Description')); ?>" id="description"></textarea>
                    </div>
                </div>
            </div>
        </div>

        
        <div class="col-lg-4">
            
            <div class="card">
                <div class="card-header"><h5><?php echo e(__('ফিচার্ড ইমেজ')); ?></h5></div>
                <div class="card-body">
                    <div class="img-upload custom-image-upload">
                        <div id="image-preview" class="img-preview" style="background: url(<?php echo e(asset('assets/admin/images/upload.png')); ?>);">
                            <label for="image-upload" class="img-label" id="image-label"><i class="icofont-upload-alt"></i><?php echo e(__('Upload')); ?></label>
                            <input type="file" name="image_big" class="img-upload" id="image-upload">
                        </div>
                        <p class="text-muted small mt-1"><?php echo e(__('Prefered Size: (600x600) or Square Sized Image')); ?></p>
                    </div>
                </div>
            </div>

            
            <div class="card categoryDiv">
                <div class="card-header"><h5><?php echo e(__('ক্যাটাগরি')); ?></h5></div>
                <div class="card-body">
                    <div class="mb-3">
                        <label class="form-label"><?php echo e(__('Category')); ?> <span class="text-danger">*</span></label>
                        <select name="category_id" id="article_parent_id" class="form-select"></select>
                    </div>
                    <div class="mb-3">
                        <label class="form-label"><?php echo e(__('Sub Category')); ?></label>
                        <select name="subcategories_id" id="subcategory_id" class="form-select">
                            <option value=""><?php echo e(__('Please add a subcategory(if any)')); ?></option>
                        </select>
                    </div>
                </div>
            </div>

            
            <div class="card">
                <div class="card-header"><h5><?php echo e(__('পোস্ট অপশন')); ?></h5></div>
                <div class="card-body">
                    <?php
                        $radioOptions = [
                            ['name' => 'is_feature', 'label' => __('Add to Feature'), 'id' => 'is_feature'],
                            ['name' => 'is_slider', 'label' => __('Add to Slider'), 'id' => 'is_slider'],
                            ['name' => 'slider_right', 'label' => __('Slider Right Post'), 'id' => 'slider_right'],
                            ['name' => 'is_trending', 'label' => __('Add to Trending News'), 'id' => 'is_trending'],
                        ];
                    ?>
                    <?php $__currentLoopData = $radioOptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $opt): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="mb-3">
                        <label class="form-label"><?php echo e($opt['label']); ?></label>
                        <div>
                            <div class="form-check form-check-inline">
                                <input type="radio" class="form-check-input" name="<?php echo e($opt['name']); ?>" value="1" id="<?php echo e($opt['id']); ?>1">
                                <label class="form-check-label" for="<?php echo e($opt['id']); ?>1"><?php echo e(__('Yes')); ?></label>
                            </div>
                            <div class="form-check form-check-inline">
                                <input type="radio" class="form-check-input" name="<?php echo e($opt['name']); ?>" value="0" id="<?php echo e($opt['id']); ?>2" checked>
                                <label class="form-check-label" for="<?php echo e($opt['id']); ?>2"><?php echo e(__('No')); ?></label>
                            </div>
                        </div>
                    </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>

            
            <div class="card">
                <div class="card-header"><h5><?php echo e(__('প্রকাশ')); ?></h5></div>
                <div class="card-body">
                    <div class="mb-3">
                        <div class="form-check">
                            <input type="checkbox" class="form-check-input schedule" name="schedule_post" value="1" id="schedule_post">
                            <label class="form-check-label" for="schedule_post"><?php echo e(__('Schedule Post')); ?></label>
                        </div>
                    </div>
                    <div class="mb-3 datepick" style="display:none;">
                        <label class="form-label"><?php echo e(__('Start Date')); ?></label>
                        <input id="from" class="form-control" type="text" name="schedule_post_date" autocomplete="off" placeholder="<?php echo e(__('Start Date')); ?>" required="" value="">
                    </div>
                    <div class="d-grid gap-2">
                        <input type="submit" data-draft="1" class="btn btn-warning submit-btn1 saveAsDraft" value="Save as Drafts">
                        <input type="submit" data-draft="0" class="btn btn-primary submit-btn1 addPost" value="Add Post">
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>


<div class="modal fade" id="setgallery" tabindex="-1" role="dialog" aria-labelledby="setgallery" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalCenterTitle"><?php echo e(__('Image Gallery')); ?></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="top-area">
                    <div class="row">
                        <div class="col-sm-6 text-right">
                            <div class="upload-img-btn">
                                <label id="article_gallery"><i class="icofont-upload-alt"></i><?php echo e(__('Upload File')); ?></label>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <a href="javascript:;" class="upload-done" data-bs-dismiss="modal"><i class="fas fa-check"></i> <?php echo e(__('Done')); ?></a>
                        </div>
                        <div class="col-sm-12 text-center">( <small><?php echo e(__('You can upload multiple Images.')); ?></small> )</div>
                    </div>
                </div>
                <div class="gallery-images">
                    <div class="selected-image">
                        <div class="row"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script src="<?php echo e(asset('assets/admin/js/page.js')); ?>"></script>
<script src="<?php echo e(asset('assets/admin/js/articleCreate.js')); ?>"></script>
<script src="<?php echo e(asset('assets/admin/js/tagify.js')); ?>"></script>
<script>
    $('.tags').tagify();
</script>

<script>
$(document).ready(function() {
    $('#article_language_id').on('change', function() {
        var lang_id = $(this).val();
        if(lang_id) {
            $.ajax({
                url: '/admin/get-divisions/' + lang_id,
                type: 'GET',
                success: function(data) {
                    $('#division_id').html(data);
                    $('#district_id').html('<option value="">Select District</option>');
                    $('#upazila_id').html('<option value="">Select Upazila</option>');
                }
            });
        } else {
            $('#division_id').html('<option value="">Select Division</option>');
            $('#district_id').html('<option value="">Select District</option>');
            $('#upazila_id').html('<option value="">Select Upazila</option>');
        }
    });

    $('#division_id').on('change', function() {
        var division_id = $(this).val();
        if(division_id) {
            $.ajax({
                url: '/admin/get-districts/' + division_id,
                type: 'GET',
                success: function(data) {
                    $('#district_id').html(data);
                    $('#upazila_id').html('<option value="">Select Upazila</option>');
                }
            });
        }
    });

    $('#district_id').on('change', function() {
        var district_id = $(this).val();
        if(district_id) {
            $.ajax({
                url: '/admin/get-upazilas/' + district_id,
                type: 'GET',
                success: function(data) {
                    $('#upazila_id').html(data);
                }
            });
        }
    });
});
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/istiakahmedsourav/Desktop/JAMUNABKP/project/resources/views/admin/article/create.blade.php ENDPATH**/ ?>