|
Server IP : 2a02:4780:8:613:0:1a7d:6e18:10 / Your IP : 216.73.217.87 Web Server : LiteSpeed System : Linux nl-srv-web513.main-hosting.eu 5.14.0-503.34.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 27 06:00:50 EDT 2025 x86_64 User : u444427800 ( 444427800) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u444427800/domains/sahyogwelfarefoundation.com/public_html/admin/gallery/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include "connect.php";
if (empty($_SESSION['admin'])) {
?>
<script>
location.replace('./index.php')
</script>
<?php
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" />
<title>Admin Panel</title>
</head>
<body>
<?php include("menu.php");?>
<!-- On tables -->
<div class=" alert-success p-4 border rounded">
<h2 class="text-center mt-3 mb-2">Enquiry Data</h2>
<div class="d-flex justify-content-end">
<button id="printTable" class="btn btn-success mb-2 btn-sm">Export Table</button>
</div>
<table class="table table-bordered table-success table-striped" id="table" >
<thead class="alert-secondary">
<tr>
<th class="align-middle" style="width:5%">Sr No.</th>
<th class="align-middle" style="width:15%">Name</th>
<th class="align-middle" style="width:15%">Email</th>
<th class="align-middle" style="width:10%">Mobile</th>
<th class="align-middle" style="width:20%">Subject</th>
<th class="align-middle" style="width:20%">Message</th>
<th class="align-middle" style="width:10%">Date</th>
<th class="align-middle" style="width:10%"></th>
</tr>
</thead>
<tbody>
<?php
$result = $conn->query("SELECT * FROM `contact` ");
$i = 1;
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
?>
<tr>
<td class="align-middle">
<?php echo $i ?>
</td>
<td class="align-middle">
<?php echo $row['name'] ?>
</td>
<td class="align-middle">
<?php echo $row['email'] ?>
</td>
<td class="align-middle">
<?php echo $row['phone'] ?>
</td>
<td class="align-middle">
<?php echo $row['subject'] ?>
</td>
<td class="align-middle">
<?php echo $row['message'] ?>
</td>
<td class="align-middle">
<?php echo date("d M Y",$row['create_on']) ?><br>
<?php echo date("h:i A",$row['create_on']) ?>
</td>
<td class="align-middle">
<a href="contact_delete.php?id=<?php echo $row['contact_id'];?>" class="btn btn-sm btn-danger">
<i class="fa-solid fa-trash-can"></i>
</a>
</td>
</tr>
<?php
$i++;
}
} else {
?>
<tr>
<td colspan="12" class="text-center">
<img src="./Assets/noData.jpg" alt="" style="width: 300px;">
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js" integrity="sha512-3gJwYpMe3QewGELv8k/BX9vcqhryRdzRMxVfq6ngyWXwo03GFEzjsUm8Q7RZcHPHksttq7/GFoxjCVUjkjvPdw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="//cdn.rawgit.com/rainabba/jquery-table2excel/1.1.0/dist/jquery.table2excel.min.js">
</script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script>
document.getElementById('logout').addEventListener('click', (e) => {
e.preventDefault()
Swal.fire({
title: "Are you sure ?",
text: "You want to logout",
icon: "warning",
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: "OK",
showCancelButton: true,
}).then((result) => {
if (result.isConfirmed) {
location.replace('./logout.php');
}
});
})
document.getElementById('printTable').addEventListener('click', (e) => {
$("#table").table2excel({
filename: "contact_users.xls"
});
})
</script>
</body>
</html>