<?php $__env->startSection('content_header'); ?>
    <h1>Capture <?php echo e(request()->session()->get('session_tname')); ?></h1>
<?php $__env->stopSection(); ?>


<script src="//code.jquery.com/jquery.js"></script>

<?php $__env->startSection('content'); ?>
    
        <?php if($errors->any()): ?>
            <div class="alert alert-danger">
                <ul>
                    <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li><?php echo e($error); ?></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </div>
        <?php endif; ?>

              <?php if(session('status')): ?>
            <div class="alert alert-success">
                <?php echo e(session('status')); ?>

            </div>
            <?php endif; ?>

            <div class="row">
            <!--row starts-->

            <div class="col-md-12">
               
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">
                           Capture <?php echo e(request()->session()->get('session_tname')); ?>

                        </h3>
                </div>

                <div class="panel-body">
                       
                            <!-- CSRF Token -->
                             <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                                <!-- Name input-->
                              
                                <br>
                                 <div class="form-group">
                                    <label class="col-md-3 control-label" for="email">Capture the <?php echo e(request()->session()->get('session_tname')); ?>s of seat<span style="color: red;">*</span></label>
                                    <div class="col-md-9">
                                      <select name="seatname" id="seatname" class="form-control">
                                        <option value="0">Select One</option>
                                       <?php $__currentLoopData = $allseats; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $seat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                       <?php if(in_array($seat->id,$charray)): ?>
                                        <option value="<?php echo e($seat->id); ?>"><?php echo e($seat->seat_name); ?></option>
                                        <?php endif; ?>

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

                                      </select>
                                      </div>
                                </div>
                               
                                <!-- Form actions -->
                                <div class="form-position">
                                    <div class="col-md-12 text-right">
                                    <br>
                                        <button type="submit" class="btn btn-responsive btn-primary btn-sm" id="btn"  onclick="getlistoftapal();">Fetch <?php echo e(request()->session()->get('session_tname')); ?>s</button>
                                    </div>
                                </div>
                       
                    </div>
                </div>
               
            </div>
            <!--md-12 ends-->
        </div>


        



<table class="table table-bordered" id="tapallistdiv">
        <thead>
            <tr>
                 <th>Number</th>
                 <th>Date</th>
                 <th>Title</th>
                 <th>SUbject Group</th>
                 <th>Actions</th>
            </tr>
        </thead>
    </table>

<script>
  
             function getlistoftapal(){

                var id = document.getElementById("seatname").value;

                $('#tapallistdiv').DataTable({
                    processing: true,
                    serverSide: true,
                    destroy: true,
                    ajax: '<?php echo url('gettapallist'); ?>'+"/"+id,
                    columns: [
                        { data: 'tapal_no', name: 'tapal_no' },
                        { data: 'created_at', name: 'created_at' },
                        { data: 'title', name: 'title' },
                        { data: 'subject_group', name: 'subject_group' },
                        { data: 'action', name: 'action' }

                       
                    ]
                });      
               
             }


        </script>
                      
<?php $__env->stopSection(); ?>

<?php echo $__env->make('adminlte::page', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>