Sindbad~EG File Manager
<?php
include('dbconfig.php');
$stmt = $DB_con->prepare('SELECT * FROM tbl_dyn_pg_upd ORDER BY userID DESC');
$stmt->execute();
if(isset($_GET['delete_id']))
{
// select image from db to delete
$stmt_select = $DB_con->prepare('SELECT aimg FROM tbl_dyn_pg_upd WHERE userID =:uid');
$stmt_select->execute(array(':uid'=>$_GET['delete_id']));
$imgRow=$stmt_select->fetch(PDO::FETCH_ASSOC);
unlink("../dyn/ser/".$imgRow['aimg']);
// it will delete an actual record from db
$stmt_delete = $DB_con->prepare('DELETE FROM tbl_dyn_pg_upd WHERE userID=:uid');
$stmt_delete->bindParam(':uid',$_GET['delete_id']);
$stmt_delete->execute();
header("Location: view_upd.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Admin Area</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content=" " name="title">
<meta content=" " name="description">
<meta property="og:image" content="http:// .com/img/ss.jpg">
<link href="img/apple-touch-icon.png" rel="apple-touch-icon">
<link rel="icon" href="img/favicon.ico" type="image/ico" sizes="16x16">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="css/custom.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script src="js/custom.js"></script>
</head>
<body>
<div id="preloader">
<div id="status">
<img src="img/logo1.png" id="preloader_image" alt="loader"/>
</div>
</div>
<?php
include('nav.php'); ?>
<?php
include('ini.php'); ?>
<section class="dbgs">
<div class="container py-4">
<h3>Updates</h3>
<table class="table">
<thead>
<tr>
<th>Image</th>
<th>Title</th>
<th>Date</th>
<th>Discription</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if($stmt->rowCount() > 0)
{
while($row=$stmt->fetch(PDO::FETCH_ASSOC))
{
extract($row);
?>
<tr>
<td><img src="../dyn/upd//<?php echo $row['aimg']; ?>" class="img-rounded " width="130px" height="80px" /> </td>
<td> <?php echo $a1?></td>
<td> <?php echo $a2?> </td>
<td> <?php echo $a3?> </td>
<td>
<a href="edit_upd.php?edit_id=<?php echo $row['userID']; ?>" class="btn btn-info"></span> Edit</a>
<a href="?delete_id=<?php echo $row['userID']; ?>" class="btn btn-danger" title="click for delete" onClick="return confirm('sure to delete ?')"> Delete</a>
</td>
</tr>
<?php
}
}
else
{
?>
<tr>
<td> No Data Found ...</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</section>
<?php
include('footer.php'); ?>
<script src="js/custom.js"></script>
</body>
</html>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists