
<?php $__env->startSection('title'); ?> বিষয়ে <?php $__env->stopSection(); ?>
<?php $__env->startSection('subject'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('subject.index'); ?> 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">
			<div class="head-label">
				<h4>বিষয়ে তালিকা</h4>
			</div>
			<div class="dt-action-buttons text-right">
				<div class="dt-buttons d-inline-flex">

					<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('subject-create')): ?>
					<a href="<?php echo e(route('subject.create')); ?>" class="btn btn-primary">নতুন বিষয়</a>
					<?php endif; ?>
				</div>
			</div>
		</div>
		<div class="card-body">
			<div class="table-responsive custom-table-modify">
				<table id="myTable" class="table table-bordered">
					<thead>
						<tr>
							<th scope="col">সিরিয়াল</th>
							<th scope="col">আইডি</th>
							<th scope="col">ছবি</th>
							<th scope="col">নাম</th>
							<th scope="col">বিভাগের নাম</th>
							<th scope="col">শ্রেণীর নাম</th>
							<th scope="col">একশন</th>
						</tr>
					</thead>
					<tbody>

						<?php $__currentLoopData = $subjects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subject): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
							<?php if(isset($subject) && $subject != null): ?>
								<tr>
									<?php
									$totalChapters = App\Models\Subject::getAllChapters($subject->id);
									?>
									<td><?php echo e($loop->index+1); ?></td>
									<td><span class=" text-primary" style=" font-weight:600;">C:
										</span><?php echo e($subject->classData->id); ?>, <span class=" text-primary"
											style=" font-weight:600;">D: </span><?php echo e($subject->departmentData->id); ?></td>
									<td>

										<?php if($subject->subject_image != null): ?>
										<img src="<?php echo e(asset('admin/images/subject/'.$subject->subject_image)); ?>" height="100"
											width="100" alt="">
										<?php else: ?>
										<img src="<?php echo e(asset('admin/images/subject/default/default.jpg')); ?>" height="100" width="100" alt="">
										<?php endif; ?>

									</td>
									<td><?php echo e($subject->subject_name); ?> <span class=" text-primary"><?php echo e($totalChapters); ?></span></td>
									<td><?php echo e($subject->departmentData->department_name); ?> </td>
									<td><?php echo e($subject->classData->class_name); ?></td>

									<td>
										<div class="dropdown">
											<button type="button" class="btn btn-sm dropdown-toggle hide-arrow py-0"
												data-bs-toggle="dropdown">
												<i data-feather="more-vertical"></i>
											</button>
											<div class="dropdown-menu dropdown-menu-end">

												<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('subject-edit')): ?>
												<a class="dropdown-item" href="<?php echo e(url('/subject-edit/'.$subject->id)); ?>">
													<i data-feather="edit-2" class="me-50"></i>
													<span>Edit</span>
												</a>
												<?php endif; ?>

												<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('subject-delete')): ?>
												<a class="dropdown-item" href="<?php echo e(route('subject.delete', $subject->id)); ?>">
													<i data-feather="trash" class="me-50"></i>
													<span>Delete</span>
												</a>
												<?php endif; ?>

											</div>
										</div>
									</td>

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

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

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

<?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/subject/index.blade.php ENDPATH**/ ?>