Server : LiteSpeed System : Linux in-mum-web983.main-hosting.eu 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : u520472703 ( 520472703) PHP Version : 8.2.29 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail Directory : /home/u520472703/domains/gadhiaassociate.com/public_html/admin/ |
<?php
include "components/header.php";
?>
<?php
if (isset($_POST['delete'])) {
$checkbox = $_POST['check'];
$n = 0;
for ($i = 0; $i < count($checkbox); $i++) {
$del_id = $checkbox[$i];
$msg = $checkbox[$i] . "Data deleted successfully !";
$sql = "DELETE FROM contact WHERE id =" . $del_id;
mysqli_query($conn, $sql);
$n++;
// $msg = "Data deleted successfully !";
}
$msg = $n . " Items deleted successfully !";
// mysqli_query($conn,"DELETE FROM employee WHERE userid='".$del_id."'");
}
?>
<h1>Contacts</h1>
<p>This table includes
<?php echo counting("contact", "id"); ?> Contacts.
</p>
<form method="post" action="">
<table id="sorted" class="table table-striped table-bordered">
<thead>
<tr>
<th colspan="2">
<button type="submit" onclick="return confirm('Are you sure you want to proceed?');" class="btn btn-danger btn-sm me-2" name="delete">DELETE SELECTED</button>
<button type="button" onclick="toggleSelection()" class="btn btn-primary btn-sm" name="selectall">SELECT ALL</button>
</th>
</tr>
<tr>
<th class="not">Id</th>
<th>Name</th>
<th>Mobile</th>
<th>Email</th>
<th>Message</th>
<th>Time</th>
<th class="not">Action</th>
<th class="not">Select</th>
</tr>
</thead>
<?php
$contacts = getAll("contact");
if ($contacts)
foreach ($contacts as $contact):
?>
<tr>
<td >
<?php echo $contact['id']; ?>
</td>
<td>
<?php echo $contact['name']; ?>
</td>
<td>
<?php echo $contact['number']; ?>
</td>
<td>
<?php echo $contact['email']; ?>
</td>
<td >
<?php echo $contact['message']; ?>
</td>
<td>
<?php echo $contact['created']; ?>
</td>
<td style="text-align: center">
<a class="btn" href="save.php?act=delete&id=<?php echo $contact['id'] ?>&cat=contact"
onclick="return navConfirm(this.href);"><i class="glyphicon glyphicon-trash"></i></a>
</td>
<td style="text-align: center"><input style="height: 20px;
width: 20px;
text-align: center;" type='checkbox' id='checkItem' name='check[]' value='<?php echo $contact['id'] ?>'></td>
</tr>
<?php endforeach; ?>
</table>
</form>
<?php include "components/footer.php"; ?>
<script type="text/javascript">
$("#checkAl").click(function () {
$('input:checkbox').not(this).prop('checked', this.checked);
});
</script>