<?php $__env->startSection('content_header'); ?>
    <?php echo notifyCss(); ?>
    <?php echo notifyJs(); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-12">
            <div class="card card-primary">
                    <div class="card-header">
                        <h3 class="card-title">Assign Content</h3>
                    </div>
                    <?php echo $__env->make('notify::messages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    <!-- /.card-header -->
                    <!-- form start -->
                        <div class="card-body">
                            <div class="col-12">
                                <div id="listroledata" style="padding: 10px;">
                                    <table class="table table-hover table-bordered table-striped datatable" id="dept_details" width="100%">
                                        <thead>
                                            <tr>
                                              <th>Slno</th>
                                              <th>Content Type</th>
                                              <th>Content Subject</th>
                                              <th>Description</th>
                                              <th>Topics Assigned</th>
                                              <th>Actions</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                          <?php
                                            $n= 0;
                                          ?>
                                          <?php $__currentLoopData = $contents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $content): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php
                                              $n++;
                                              $content_topic_name ="";
                                              $topic_name ="";
                                            ?>
                                            <tr>
                                              <td><?php echo e($n); ?></td>
                                              <td><?php echo e($content->content_type->content_type_name); ?></td>
                                              <td><?php echo e($content->content_subject); ?></td>
                                              <td><?php echo e($content->description); ?></td>
                                              <td>
                                                <?php if(isset($content->content_assignment)): ?>
                                                  <?php $__currentLoopData = $content->content_assignment; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $content_assignment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <?php
                                                      $topic_name = $content_assignment->topic->topic_name;
                                                      if($content_topic_name)
                                                      {
                                                          $content_topic_name = $content_topic_name.", ".$topic_name;
                                                      }
                                                      else
                                                      {
                                                          $content_topic_name = $topic_name;
                                                      }
                                                    ?> 
                                                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                                <?php echo e($content_topic_name); ?>

                                              </td>
                                              <td>
                                                <form action="<?php echo e(URL::to('/assign_content_show')); ?>" method="post" autocomplete="off">
                                                  <?php echo e(csrf_field()); ?>

                                                    <input type="hidden" name="content_id" id="content_id" value="<?php echo e($content->id); ?>">
                                                    <button type="submit" class="btn btn-xs btn-primary">Assign</button>
                                                </form>
                                                <a href="<?php echo e(URL::to('/view_content_assignments')); ?>/<?php echo e($content->id); ?>" class="btn btn-xs btn-info">View</a>
                                              </td>
                                            </tr>
                                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </tbody>
                                    </table>
                                </div>
                          </div>
                        </div>
                        <!-- /.card-body -->
                   
            </div>
        </div>
    </div>
    <script type="text/javascript">
      $(document).ready(function(){  
          $('#dept_details').DataTable();  
     }); 
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('adminlte::page', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\xampp7.3\htdocs\kmportal\resources\views/Content/assign_content.blade.php ENDPATH**/ ?>