<?php
include("common/header2.php");
include("common/connection.php");


 $sql="SELECT * FROM  tbl_package WHERE status='1' ORDER BY id desc  ";
$result=mysqli_query($db,$sql);
if(mysqli_num_rows($result)>0);


?>

        <div class="page-wrapper">
            <!-- ============================================================== -->
            <!-- Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
             <div class="page-breadcrumb">
                <div class="row">
                    <div class="col-12 d-flex no-block align-items-center">
                        <h4 class="page-title">Package </h4>
                        <div class="ml-auto text-right">
                             <a class="btn btn-sm btn-primary btn-round" href="deactive-member.php">
        <i class="icon md-link" aria-hidden="true"></i>
        <span class="hidden-sm-down">Block Member</span>
      </a>
                        </div>
                    </div>
                </div>
            </div>
            <!-- ============================================================== -->
            <!-- End Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- Container fluid  -->
            <!-- ============================================================== -->
            <div class="container-fluid">
                <!-- ============================================================== -->
                <!-- Start Page Content -->
                <!-- ============================================================== -->
                <div class="row">
                    <div class="col-12">
                        
                        <div class="card">
                            <div class="card-body">
                                <h5 class="card-title">All Packages</h5>
                                <div class="table-responsive">
    <table id="zero_config" class="table table-striped table-bordered">
                                        <thead>
                                            <tr>
                                                <th>Sno.</th>
                                               
                                                 <th>Package</th>
                                             <th>Action</th>  
                                            </tr>
                                        </thead>
                                        <tbody>
                          <?php 
                                             $count=0;
                                             while($row = mysqli_fetch_assoc($result)) {
                                            if($result)
                                                {    $count++; ?>
                                             <tr>
                                            <td><?php echo $count;?></td>
                                             
                                            
                                              <td><?php echo $row['price'];?></td>
                                            
                               
                                 <td> 
                                 
                                 
                                 <!--add new recode button-->
 <a  href="add-package.php">
<button type="button" class="btn btn-warning btn-sm remove"> <i class=" fas fa-plus"></i></button> 
</a>

 <!--Edit button -->
<a style="color: blue;" href="package-edit.php?id=<?php echo $row['id'];?>">  <button type="button" class="btn btn-primary btn-sm"> <i class="fas fa-edit"></i></button> </a>




<!--Delete Button-->
<!--<a  href="delete-package.php?id=<?php echo $row['id'];?>">-->
<!--<button type="button" class="btn btn-danger btn-sm remove"> <i class="fas fa-trash-alt"></i></button> -->
<!--</a>-->



  </td>
     </tr>
                                        <?php } } ?>

<tfoot>
                                          
                                        </tfoot>
                                        </tbody>
                                        
                                    </table>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
                <!-- ============================================================== -->
                <!-- End PAge Content -->
                <!-- ============================================================== -->
                <!-- ============================================================== -->
                <!-- Right sidebar -->
                <!-- ============================================================== -->
                <!-- .right-sidebar -->
                <!-- ============================================================== -->
                <!-- End Right sidebar -->
                <!-- ============================================================== -->
            </div>
            <!-- ============================================================== -->
            <!-- End Container fluid  -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- footer -->
            <!-- ============================================================== -->
                      <?php
include("common/footer.php");
?>
  <script src="assets/extra-libs/DataTables/datatables.min.js"></script>
     <link href="assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.css" rel="stylesheet">
    <link href="dist/css/style.min.css" rel="stylesheet">
     <script>
        /****************************************
         *       Basic Table                   *
         ****************************************/
        $('#zero_config').DataTable();
        
        
         $('.copy_text').click(function (e) {
   e.preventDefault();
   var copyText = $(this).attr('href');

   document.addEventListener('copy', function(e) {
      e.clipboardData.setData('text/plain', copyText);
      e.preventDefault();
   }, true);

   document.execCommand('copy');  
   
   alert('copied text: ' + copyText); 
 });
    </script>
    
   