<?php
require_once("header.php");
require_once("menu.php");

if(isset($_REQUEST['del']))
{
    $gallery_id = base64_decode($_REQUEST['del']);
	$ex = $obj->delete_gallery_img($gallery_id);
   if($ex){
	   echo '<script>window.location="life_at_ethics_gallery.php"</script>';
   }
 
}

?>

<div id="layoutSidenav_content">
<main class="mt-4">
    <div class="container-fluid">        
        <div class="card mb-4">
            <div class="card-header">
                <i class="fas fa-border-style"></i>  &nbsp;life At Ethics Gallery
                <a href="add_ethics_life_gallery.php" class="add_right btn btn-primary btn-sm float-right">Add life At Ethics Gallery</a>
            </div>
            <div class="card-body">
                <div class="table-responsive">
                    <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                        <thead>
                            <tr>
                                <th>Gallery Category</th>
								<th>Gallery Image</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $ex = $obj->view_gallery();
                            while($row=mysqli_fetch_array($ex))
                            {
                            ?>
                            <tr>
                                <td><?php echo $row['life_at_ethics_title'];?></td>
								<td><img src="<?php echo $row['life_at_ethics_gallery_img'];?>"style="width: 150px;"></td>
                                <td>
                                    <a href="add_ethics_life_gallery.php?edit=<?php echo base64_encode($row['life_at_ethics_gallery_id']);?>" class="edit_right btn btn-primary btn-sm"><i class="fas fa-edit"></i></a>
                                    <a href="life_at_ethics_gallery.php?del=<?php echo base64_encode($row['life_at_ethics_gallery_id']);?>" class="btn btn-danger btn-sm delete_right"><i class="fas fa-trash"></i></a>
                                
								</td>
                            </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</main>

<script>
    var url = "life_at_ethics_gallery.php";
</script>


<?php require_once("footer.php");?>
