
<?php 
  include 'connection.php';
  if (isset($_POST['change'])) {

    mysqli_query($conn,"UPDATE students SET class_status = 'in-active' where cl='NURSERY'");
  }
 ?>
<?php include 'includes/header.php'; ?>
<?php include 'includes/sidebar.php' ?>

<?php include 'includes/topbar.php'; ?>

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">

            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 ">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Nursery Student Report</h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                        <br>
                        <form method="post" action="">
                      <li><button type="submit" name="change" class="btn btn-info"><i class="fa fa-edit">MOVE STUDENTS TO INACTIVE STATUS</i></button>
                        </form>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                      <div class="row">
                          <div class="col-sm-12">
                            <div class="card-box table-responsive">
                    <table  id="datatable-buttons" class="table table-striped table-bordered" style="width:100%">
                      <thead>
                        <tr>
                          <th>Full Name</th>
                          <th>Class</th>
                          <th>Bording/Day</th>
                          <th>Status</th>
                          <th>Registered Date</th>
                          <th>Action</th>
                        </tr>
                      </thead>
                      <tbody>
                      	<?php  
							
							$select = "SELECT * FROM students WHERE cl= 'NURSERY' AND  class_status='active'";
							$sql = mysqli_query($conn,$select);
							$k=1;
							while ($fetch = mysqli_fetch_object($sql)) {
						?>
                        <tr>
                          <td><?php echo $fetch->fn ?></td>
                          <td><?php echo $fetch->cl ?></td>
                          <td><?php echo $fetch->lp ?></td>
                          <td><?php echo $fetch->st ?></td>
                          <td><?php echo $fetch->dt ?></td>
                          <td style="color: red;"><i style="color: red;" class="fa fa-file-pdf-o"></i> <a style="font-weight:bold; color: blue;" href="reports/pdf.php?p=<?php echo $fetch->id; ?>">Print Student Details</a></td>
                        </tr>
                        <?php 
                        	$k++;
                        	}
                         ?>                       
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>
                </div>
              </div>


        <!-- /page content -->

<?php include 'includes/footer.php'; ?>