<?php $__env->startSection('content_header'); ?>
    <h1>Subject</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">
                           Subject
                        </h3>
                </div>

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

                            <!-- CSRF Token -->
                             <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                                <!-- Name input-->
                              
                                <div class="form-group">
                                    <label class="col-md-3 control-label" for="name">Subject<span style="color: red;">*</span></label>
                                    <div class="col-md-9">
                                        <input id="subject" name="subject" type="text" placeholder="Enter the subject" class="form-control"></div>
                                </div>
                               
                                <!-- Form actions -->
                                <div class="form-position">
                                    <div class="col-md-12 text-right">
                                        <button type="submit" class="btn btn-responsive btn-primary btn-sm" id="btn">Submit</button>
                                    </div>
                                </div>
                        </form>
                    </div>
                </div>
               



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


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



<script>
$(function() {

    $('#subject_table').DataTable({
        processing: true,
        serverSide: true,
        ajax: '<?php echo url('subjectpostdata'); ?>',
        columns: [
            { data: 'id', name: 'id' },
            { data: 'subject', name: 'subject' },
            { data: 'updated_at', name: 'updated_at' },
            { data: 'action', name: 'action' }
        ]
    });
});

</script>


<script>
function validation()
    {
        
        if(document.getElementById('subject').value=="")
        {
            alert(" Please enter the Subject");
            document.getElementById('subject').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(); ?>