<?php $__env->startSection('styles'); ?>

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



<?php $__env->startSection('content'); ?>

<!-- ============================================================== -->

<!-- Start right Content here -->

<!-- ============================================================== -->

<div class="content-page">

    <!-- Start content -->

    <div class="content">

        <div class="container-fluid">

          <div class="row">

              <div class="col-sm-12">

                  <div class="page-title-box">

                      <div class="row align-items-center">

                          <div class="col-md-8">

                              <h4 class="page-title mb-0">Grades</h4>

                              <ol class="breadcrumb m-0">

                                  <li class="breadcrumb-item"><a href="#">Dashboard</a></li>

                                  <li class="breadcrumb-item active" aria-current="page">Grades</li>

                              </ol>

                          </div>

                          <div class="col-md-4">

                              

                          </div>

                      </div>



                  </div>

              </div>

          </div>

          <!-- end row -->

            <div class="row">

                <div class="col-lg-6">

                    <div class="card">

                        <div class="card-body">

                            <h4 class="mt-0 header-title">Grades List</h4>

                            <div class="table-responsive mt-4">

                                <table class="table  table-striped table-hover mb-0">

                                    <thead>

                                        <tr>

                                            <th scope="col">(#)</th>

                                            <th scope="col">Name</th>


                                            <th scope="col" colspan="2">Actions</th>

                                        </tr>

                                    </thead>

                                    <tbody>

                                      <?php $__currentLoopData = $grades; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $grade): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                        <tr>

                                            <th scope="row"><?php echo e($loop->iteration); ?></th>

                                            <td><?php echo e($grade->name); ?></td>

                                            <td><?php echo e($grade->description); ?></td>

                                            <td>

                                                <div>

                                                    <a  class="btn btn-success btn-sm"><i class="ion-edit text-white"></i></a>

                                                    <a data-toggle="modal" data-target="#deleteGradeModal" class="btn btn-danger btn-sm" onclick="setgradeid(<?php echo e($grade->id); ?>)"><i class="ion-trash-a text-white"></i></a>

                                                </div>

                                            </td>

                                        </tr>

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

                                    </tbody>

                                </table>

                            </div>

                        </div>

                    </div>

                </div>
				
				<div class="col-lg-6">

                    <div class="card">

                        <div class="card-body">

                             <h5 class="modal-title mt-0" id="myModalLabel">Add New Grade</h5>

                            <form action="<?php echo e(route('admin.addGrade')); ?>" method="post">

                <div class="row">

                  <div class="col-md-12 mt-10">

                    <label>Grade Name</label>

                    <input class="form-control" required name="name" placeholder="Enter name here ..."/>

                  </div>



                  

                </div>





            </div>

            <div class="modal-footer">

                <button type="button" class="btn btn-secondary btn-sm waves-effect" data-dismiss="modal">Close</button>

                <button type="submit" class="btn btn-primary btn-sm waves-effect waves-light" >Add Grade</button>

            </div>

            <?php echo e(csrf_field()); ?>


            </form>

                        </div>

                    </div>

                </div>

            </div>

            <!-- end row -->



        </div> <!-- container-fluid -->



    </div> <!-- content -->



    <footer class="footer">

        © 2020 - 2021  The Educators Academy

    </footer>

</div>





<!-- ============================================================== -->

<!-- End Right content here -->

<!-- ============================================================== -->

<!-- sample modal content -->



<div id="deleteGradeModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

    <div class="modal-dialog">

        <div class="modal-content">

            <div class="modal-header">

                <h5 class="modal-title mt-0" id="myModalLabel">Delete Grade</h5>

                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

            </div>

            <div class="modal-body">

              <form action="<?php echo e(route('admin.deleteGrade')); ?>" method="post">

                <div class="col-md-12 mt-10 mb-10">



<p>Are you sure you want to delete this grade ?</p>

<input type="hidden" name="grade_id" required id="grade_id"/>

            </div>

            <div class="modal-footer">

                <button type="button" class="btn btn-secondary btn-sm waves-effect" data-dismiss="modal">Close</button>

                <button type="submit" class="btn btn-danger btn-sm waves-effect waves-light" >Delete Grade</button>

            </div>

            <?php echo e(csrf_field()); ?>


            </form>

        </div><!-- /.modal-content -->

    </div><!-- /.modal-dialog -->

</div>

<!-- /.modal -->

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



<?php $__env->startSection('scripts'); ?>

<script>

function setgradeid(id)

{

  $("#grade_id").val(id);

}

</script>

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


<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\freelance\school\school\resources\views/admin/grades.blade.php ENDPATH**/ ?>