Path : /home/jpenter/conceptacademicclasses.com/admin/ |
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
Current File : /home/jpenter/conceptacademicclasses.com/admin/gallery.php |
<?php session_start(); if(!isset($_SERVER['HTTP_REFERER'])){ // redirect them to your desired location header('location:../admin/index.php'); exit; } include_once 'dbconfig.php'; if(isset($_GET['delete_id'])) { $sql_query="SELECT * FROM gallery WHERE id=".$_GET['delete_id']; $result_set=mysqli_query($con,$sql_query); $fetched_row=mysqli_fetch_array($result_set,MYSQLI_ASSOC); $old_image = $fetched_row['galllery_image']; unlink("uploads/gallery/".$old_image); $sql_query="DELETE FROM gallery WHERE id=".$_GET['delete_id']; mysqli_query($con,$sql_query); header("Location: $_SERVER[PHP_SELF]"); } if(isset($_GET['changestatus_id'])) { $sql_query="UPDATE gallery SET `status`='".$_GET['status']."' WHERE id=".$_GET['changestatus_id']; mysqli_query($con,$sql_query); header("Location: $_SERVER[PHP_SELF]"); } ?> <?php include('header.php'); ?> <script type="text/javascript"> function edt_id(id) { window.location.href='edit_gallery.php?edit_id='+id; } function view_id(id) { window.location.href='view_gallery.php?view_id='+id; } function delete_id(id) { if(confirm('Sure to Delete ?')) { window.location.href='gallery.php?delete_id='+id; } } function changestatus_id(id,status) { window.location.href='index.php?changestatus_id='+id+'&status='+status; } </script> <!-- ============================================================== --> <!-- End Left Sidebar - style you can find in sidebar.scss --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- Page wrapper --> <!-- ============================================================== --> <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">Gallery</h4> <div class="ml-auto text-right"> <button type="button" class="btn btn-success btn-sm" style="float:right;" onclick="location.href='add_gallery.php'">Add Gallery</button> </div> </div> </div> </div> <!-- ============================================================== --> <!-- End Bread crumb and right sidebar toggle --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- Container fluid --> <!-- ============================================================== --> <div class="container-fluid"> <!-- ============================================================== --> <!-- Start Page Content --> <!-- ============================================================== --> <div class="row el-element-overlay"> <?php $sql_query="SELECT * FROM gallery ORDER BY id DESC"; $result_set=mysqli_query($con,$sql_query); $i=1; while($row=mysqli_fetch_row($result_set)) { ?> <div class="col-lg-3 col-md-6"> <div class="card"> <div class="el-card-item"> <div class="el-card-avatar el-overlay-1"> <img src="uploads/gallery/<?php echo $row[1]; ?>" alt="user" style="height:250px;width:100%;" /> </div> <div class="el-card-content"> <button type="button" class="btn btn-primary btn-sm" onclick="javascript:edt_id('<?php echo $row[0]; ?>')">Edit</button> <button type="button" class="btn btn-danger btn-sm" onclick="javascript:delete_id('<?php echo $row[0]; ?>')">Delete</button> </div> </div> </div> </div> <?php $i++; } ?> </div> <!-- ============================================================== --> <!-- End PAge Content --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- Right sidebar --> <!-- ============================================================== --> <!-- .right-sidebar --> <!-- ============================================================== --> <!-- End Right sidebar --> <!-- ============================================================== --> </div> <!-- ============================================================== --> <!-- End Container fluid --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- footer --> <!-- ============================================================== --> <?php include('footer.php'); ?>