

<?php $__env->startSection('title'); ?> পোষ্ট | TESTPAPER <?php $__env->stopSection(); ?>
<?php $__env->startSection('department'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('department.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 heading-margin-bottom-minus">
    <h3 class="mb-0 pb-0"><span>পোষ্টের তালিকা</span><span> <a class="heading-font" href="<?php echo e(route('admin.dashboard')); ?>"> । এডমিন</a></span></h3>  
  </div>
</div>

<div class="table_wrapper py-1 card">
  <div class="row my-2 aggregate-section-div">
    <div class="px-3 ">
      <div class=" d-flex justify-content-between align-items-center aggregate-section border">
        <div class="d-flex align-items-center  py-1">
          <p class="mb-0"><a href="<?php echo e(route('post')); ?>" class="text-primary py-2 px-3">সব (<?php echo e($postCount->count()); ?>)</a>
          </p>
          <p class="mb-0"><a href="<?php echo e(route('active-post-list')); ?>"
              class="text-primary py-2 px-3 active">সক্রিয় (<?php echo e($activePostCount); ?>)</a></p>
          <p class="mb-0"><a href="<?php echo e(route('inactive-post-list')); ?>"
              class="text-primary py-2 px-3">নিষ্ক্রিয় (<?php echo e($inactivePostCount); ?>)</a></p>
        </div>
        <div class="d-none d-sm-block">
          <?php if(Auth::user()->can('post-create')): ?> 
            <a href="<?php echo e(route('post.create')); ?>" class="btn btn-success rounded-0 d-flex align-items-center px-2 border-0"><span class="">নতুন পোষ্ট</span></a>
          </div>
          <?php endif; ?>
      </div>

      <?php if(Auth::user()->can('post-create')): ?> 
        <div class="mt-2 btn btn-success d-block rounded-0 d-sm-none"><a class="text-white" href="<?php echo e(route('post.create')); ?>"> নতুন পোষ্ট</a></div>
      <?php endif; ?>
    </div>
  </div>



  <div class="row px-3">
    <div class="table-container table-responsive">
      <table id="" class="table table-bordered">
        <thead class="text-uppercase">
          <tr class="me-3">
            <th class="text-center" scope="col"><span>পোষ্ট</span></th> 
            <th class="text-center" scope="col"><span>ছবি</span></th> 
            <th class="text-center" scope="col"><span>আইডি</span></th> 
            <th class="text-center" scope="col"><span>বর্তমান অবস্থা</span></th>
          </tr>
        </thead>
        <tbody class="text-center">

          <?php $__currentLoopData = $posts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
          <?php if(isset($item) && $item != null): ?>
          <?php
          $postTagData = App\Models\PostTag::getExamListWithPostId($item->id);
          ?>
          <tr class="">
            <td style="text-align: left;">
                    <div class="row_title">

                    <b class=" d-flex text-primary">শিরোনাম: <span class=" text-dark"
                    style="font-weight: 100 !important;padding-left: 10px;" class=" pl-1 ml-2"> <?php echo $item->post_title; ?></span></b><br>

                    <b class=" d-flex text-primary">ডেসক্রিপসন: <span class=" text-dark"
                    style="font-weight: 100 !important;padding-left: 10px;"><?php echo Str::limit($item->post_description, 250); ?></span></b> <br>

                    <b class="text-primary">রেফারেন্স: </b>
                    <span class=" text-violet" style="font-weight:600;">শ্রেণি:</span>
                    <?php echo e($item->classData->class_name); ?>,
                    <span class=" text-violet" style="font-weight:600;"> বিভাগ: </span>
                    <?php echo e($item->departmentData->department_name); ?>,
                    <span class=" text-violet" style="font-weight:600;">বিষয়: </span>
                    <?php echo e($item->subjectData->subject_name); ?>,
                    <span class=" text-violet" style="font-weight:600;">অধ্যায়: </span>
                    <?php echo e($item->chapterData->chapter_name); ?>

                    <span class=" text-violet" style="font-weight:600;"> ট্যাগের নাম: </span>
                    <?php $__currentLoopData = $postTagData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $result): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if(isset($result)): ?>
                    <span class=""><?php echo e($result->tagData->tag_name); ?></span>,
                    <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </b>
              </div>
              <div class="row-actions mt-3 text-center">
                <?php if(Auth::user()->can('post-edit')): ?> 
                  <a href="<?php echo e(route('post.edit', ['id'=>$item->id])); ?>"><button class="edit_class_modal border-0 bg-transparent" value="<?php echo e($item->id); ?>"
                      onclick="updateDepartment(<?php echo e($item->id); ?>)"><span class="text-primary">সম্পাদন</span>  |  </button></a>
                <?php endif; ?>

                <?php if($item->status == true): ?>
                <span><a class="text-warning" href="<?php echo e(route('post-inactive', $item->id)); ?>">নিস্ক্রিয়</a></span>
                <?php else: ?>
                <span><a class="text-success" href="<?php echo e(route('post-active', $item->id)); ?>">সক্রিয়</a></span>
                <?php endif; ?>
              </div>
            </td>
            <td>
                <?php if($item->post_image != null): ?>
                <img src="<?php echo e(asset('backend/images/posts/thumbnail/'.$item->post_image)); ?>" height="50" width="70"
                    alt="">
                <?php else: ?>
                <img src="<?php echo e(asset('backend/images/subject/default/default.jpg')); ?>" height="50" width="70"
                    alt="">
                <?php endif; ?>
            </td>

            <td>
                <span class=" text-primary" style=" font-weight:600;">C:
                </span><?php echo e($item->classData->id); ?>,
                <span class=" text-primary" style=" font-weight:600;">D:
                </span><?php echo e($item->departmentData->id); ?>,
                <span class=" text-primary" style=" font-weight:600;">S:
                </span><?php echo e($item->subjectData->id); ?>,
                <span class=" text-primary" style=" font-weight:600;">Ch:
                </span><?php echo e($item->chapterData->id); ?>,
            </td>

            <td>
              <?php if($item->status == true): ?>
              <span class="badge bg-success">সক্রিয়</span>
              <?php else: ?>
              <span class="badge bg-danger">নিষ্ক্রিয়</span>
              <?php endif; ?>
            </td>

          </tr>

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


        </tbody>
      </table>
    </div>
  </div>


</div>








<?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/post/activeList.blade.php ENDPATH**/ ?>