<?php $__env->startSection('content_header'); ?>
    <h1>Action Assigned To Subject_Group</h1>
<?php $__env->stopSection(); ?>


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

<?php $__env->startSection('content'); ?>
<?php echo notifyCss(); ?>
 <?php echo notifyJs(); ?>
<?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; ?>
  <?php echo $__env->make('notify::messages', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>


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

            <div class="col-md-12">
               
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">
                           Action Assigned To Subject Group
                        </h3>
                </div>

                <div class="panel-body">
                        <form class="form-horizontal" action="<?php echo e(url('action_subjectgrouppost')); ?>" method="post" id="actionsubgrp" onsubmit="return validation();">

                            <!-- CSRF Token -->
                             <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                            
                             
                                <!-- Email input-->
                                <div class="form-group">
                                    <label class="col-md-3 control-label" for="email">Action<span style="color: red;">*</span></label>
                                    <div class="col-md-9">
                                      <select name="actions" id="actions" class="form-control">
                                        <option value="0">Select One</option>
                                       <?php $__currentLoopData = $actions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $action): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                       	<option value="<?php echo e($action->id); ?>"><?php echo e($action->actions); ?></option>

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

                                      </select>
                                      </div>
                                </div>
                                
                                <div class="form-group">
                                    <label class="col-md-3 control-label" for="email">Subject_Group<span style="color: red;">*</span></label>
                                    <div class="col-md-9">
                                      <select name="subject_group" id="subject_group" class="form-control">
                                        <option value="0">Select One</option>
                                         <?php $__currentLoopData = $subject_groups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subject_group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                       	<option value="<?php echo e($subject_group->id); ?>"><?php echo e($subject_group->subject_group); ?></option>

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

                                      </select>
                                      </div>
                                </div>
                                
                                
                                <!-- Form actions -->
                                <div class="form-position">
                                    <div class="col-md-12 text-right">
                                        <button type="submit" id="btn" class="btn btn-responsive btn-primary btn-sm" >Save</button>
                                    </div>
                                </div>
                        </form>
                    </div>
                </div>
               



            </div>
            <!--md-12 ends-->
        </div>


<table class="table table-bordered" id="action_subjectgroup_table">
        <thead>
            <tr>
                <th>Id</th>
                <th>Action</th>
                <th>Subject Group</th>
                <th>Updated At</th>
                <th>Actions</th>
            </tr>
        </thead>
    </table>



<script>
$(function() {

    $('#action_subjectgroup_table').DataTable({
        processing: true,
        serverSide: true,
        ajax: '<?php echo url('action_subjectgrouppostdata'); ?>',
        columns: [
            { data: 'id', name: 'id' },
            { data: 'actions', name: 'actions' },
            { data: 'subject_group', name: 'subject_group' },
            { data: 'updated_at', name: 'updated_at' },
            { data: 'action', name: 'action' }
        ]
    });
});
</script>



<script>
function validation()
    {
        
        if(document.getElementById('actions').value=="0")
        {
            alert(" Please Select the Actions");
            document.getElementById('actions').focus();
            return false;
        }

        if(document.getElementById('subject_group').value=="0")
        {
            alert(" Please select the Subject_Group");
            document.getElementById('subject_group').focus();
            return false;
        }
        document.getElementById("btn").disabled='true';
       
        return true;
    }
</script>

			

<?php $__env->stopSection(); ?>

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