
<?php $__env->startSection('title'); ?> পোস্ট <?php $__env->stopSection(); ?>
<?php $__env->startSection('post.create'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('post.create'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('admin_content'); ?>

<!-- BEGIN: Content-->
<div class="app-content content ">
    <div class="card">

        <div class="card-header p-1">
            <div class="head-label">
                <h4>নতুন পোস্ট</h4>
            </div>
        </div>

        <div class="card-body">
            <form action="<?php echo e(route('post.store')); ?>" method="post" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
                    <div class="">
                        <div class="row border rounded">

                            <div class="col-md-6 col-12 p-1">
                                <?php if(isset($defaultPostData)): ?>
                                <div class="row">

                                    <div class="col-md-6 col-12 mb-2">
                                        <div class="form-group">
                                            <label for="name">শ্রেণীর নাম <span class=" text-danger">(required)</span>
                                            </label>
                                            <select id="classname_id" name="classname_id" class="form-select select2">
                                                <option selected disabled> শ্রেণী সিলেক্ট করুন </option>
                                                <?php $__currentLoopData = $classes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $class): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($class->id); ?>"
                                                    <?php echo e($class->id == $defaultPostData->classname_id ? "selected":""); ?>>
                                                    <?php echo e($class->class_name); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                        <?php $__errorArgs = ['classname_id'];
$__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-6 col-12 mb-2">
                                        <div class="form-group">
                                            <label for="department_id">বিভাগের নাম <span
                                                    class=" text-danger">(required)</span> </label>
                                            <select id="department_id" name="department_id" class="form-select select2">
                                                <option selected disabled> বিভাগ সিলেক্ট করুন </option>
                                                <?php $__currentLoopData = $departments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $department): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($department->id); ?>"
                                                    <?php echo e($department->id == $defaultPostData->department_id ? "selected":""); ?>>
                                                    <?php echo e($department->department_name); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                        <?php $__errorArgs = ['department_id'];
$__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-6 col-12 mb-2">
                                        <div class="form-group">
                                            <label for="subject_id">বিষয়ের নাম <span
                                                    class=" text-danger">(required)</span> </label>
                                            <select id="subject_id" name="subject_id" class="form-select select2">
                                                <option selected disabled> বিষয় সিলেক্ট করুন </option>
                                                <?php $__currentLoopData = $subjects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subject): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($subject->id); ?>"
                                                    <?php echo e($subject->id == $defaultPostData->subject_id ? "selected":""); ?>>
                                                    <?php echo e($subject->subject_name); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                        <?php $__errorArgs = ['subject_id'];
$__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-6 col-12 mb-2">
                                        <div class="form-group">
                                            <label for="chapter_id">অধ্যায়ের নাম <span
                                                    class=" text-danger">(required)</span> </label>
                                            <select id="chapter_id" name="chapter_id" class="form-select select2">
                                                <option selected disabled> অধ্যায় সিলেক্ট করুন </option>
                                                <?php $__currentLoopData = $chapters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $chapter): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($chapter->id); ?>"
                                                    <?php echo e($chapter->id == $defaultPostData->chapter_id ? "selected":""); ?>>
                                                    <?php echo e($chapter->chapter_name); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                        <?php $__errorArgs = ['chapter_id'];
$__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>
                                <?php else: ?>
                                <div class="row">

                                    <div class="col-md-6 col-12 mb-2">
                                        <div class="form-group">
                                            <label for="name">শ্রেণীর নাম <span class=" text-danger">(required)</span>
                                            </label>
                                            <select id="classname_id" name="classname_id" class="form-select select2">
                                                <option selected disabled> শ্রেণী সিলেক্ট করুন </option>
                                                <?php $__currentLoopData = $classes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $class): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($class->id); ?>"><?php echo e($class->class_name); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                        <?php $__errorArgs = ['classname_id'];
$__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-6 col-12 mb-2">
                                        <div class="form-group">
                                            <label for="department_id">বিভাগের নাম <span
                                                    class=" text-danger">(required)</span> </label>
                                            <select id="department_id" name="department_id" class="form-select select2">
                                                <option selected disabled> বিভাগ সিলেক্ট করুন </option>

                                            </select>
                                        </div>
                                        <?php $__errorArgs = ['department_id'];
$__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-6 col-12 mb-2">
                                        <div class="form-group">
                                            <label for="subject_id">বিষয়ের নাম <span
                                                    class=" text-danger">(required)</span> </label>
                                            <select id="subject_id" name="subject_id" class="form-select select2">
                                                <option selected disabled> বিষয় সিলেক্ট করুন </option>

                                            </select>
                                        </div>
                                        <?php $__errorArgs = ['subject_id'];
$__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-6 col-12 mb-2">
                                        <div class="form-group">
                                            <label for="chapter_id">অধ্যায়ের নাম <span
                                                    class=" text-danger">(required)</span> </label>
                                            <select id="chapter_id" name="chapter_id" class="form-select select2">
                                                <option selected disabled> অধ্যায় সিলেক্ট করুন </option>

                                            </select>
                                        </div>
                                        <?php $__errorArgs = ['chapter_id'];
$__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>
                                <?php endif; ?>
                            </div>

                            <div class="col-md-6 col-12 p-1" style="border-left: 1px solid #EBE9F1">
                                <div class="rounded p-2">
                                    <div class="media flex-column flex-md-row custom-question-image-body"
                                        style="display: flex;">
                                        <img src="<?php echo e(asset('backend/app-assets/images/avatars/12.png')); ?>"
                                            id="blog-feature-image"
                                            class="rounded mr-2 mb-1 mb-md-0 custom-question-image" width="170"
                                            height="110" alt="Blog Featured Image">

                                        <div class="media-body" style="margin-left: 15px;">
                                            <p class="my-50">

                                            </p>
                                            <div class="d-inline-block custom-question-image-block">
                                                <div class="form-group mb-0">
                                                    <div class="custom-file">
                                                        <input type="file" name="post_image" class="custom-file-input"
                                                            id="blogCustomFile" accept="image/*">
                                                        <label class="custom-file-label" for="blogCustomFile">Choose
                                                            file</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                    <div class="row">
                        <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 mt-2">
                            <div class="form-group mt-2">
                                <label for="tag_id">ট্যাগের নাম <span class=" text-danger">(required)</span> </label>
                                <select id="tag_id" name="tag_id[]" class="form-select select2" multiple required>
                                    <?php $__currentLoopData = $tags; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tag): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($tag->id); ?>"><?php echo e($tag->tag_name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>

                        <?php $__errorArgs = ['tag_id'];
$__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 class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 mt-2">
                            <div class="form-group">
                                <label for="post_title">শিরোনাম <span class=" text-danger">(required)</span> </label>
                                <textarea class=" form-control" name="post_title" id="post_title" cols="2" rows="2"
                                    placeholder=" শিরোনাম"></textarea>
                            </div>
                            <?php $__errorArgs = ['post_title'];
$__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-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 mt-2">
                            <div class="form-group">
                                <label for="post_description">ডেসক্রিপসন <span class=" text-danger">(required)</span>
                                </label>
                                <textarea class="form-control" name="post_description" id="post_description" cols="30"
                                    rows="15" placeholder=" পোস্ট ডেসক্রিপসন"></textarea>
                            </div>

                            <?php $__errorArgs = ['post_description'];
$__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-12 col-sm-12 col-md-2 col-lg-2 col-xl-2 d-flex align-items-center"
                            style="margin-top: 35px;">
                            <input type="submit" name="submit" class="btn btn btn-success" value="Save">
                        </div>

                    </div>

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

    </div>

</div>
<!-- END: Content-->


<?php echo $__env->make('admin.post.partial.script', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<?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\testpaper-final\resources\views/admin/post/create.blade.php ENDPATH**/ ?>