Server : LiteSpeed System : Linux in-mum-web1743.main-hosting.eu 5.14.0-570.62.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 10:10:59 EST 2025 x86_64 User : u993087259 ( 993087259) 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/u993087259/domains/naturalsveda.in/public_html/admin/ |
<!DOCTYPE html>
<html lang="en">
<head>
<?php
include 'header-script.php';
?>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
/* Initially hide all table rows */
tr {
display: none;
}
</style>
</head>
<body class="">
<div class="wrapper ">
<?php
include 'side-bar.php';
?>
<div class="main-panel">
<!-- Navbar -->
<?php
include 'nav-bar.php';
?>
<!-- End Navbar -->
<div class="panel-header panel-header-sm">
</div>
<div class="content">
<div class="row">
<div class="col-md-12">
<div class="card px-3">
<div class="card-header">
<h4 class="card-title"> Contact Data</h4>
</div>
<!--<button onclick="downloadExcel()" style="margin: 20px;">Download</button>-->
<div class="header_wrap w-25 px-3">
<div class="num_rows">
<div class="form-group"> <!-- Show Numbers Of Rows -->
<select class="form-control" name="state" id="maxRows">
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="50">50</option>
<option value="70">70</option>
<option value="100">100</option>
<option value="5000">Show ALL Rows</option>
</select>
</div>
</div>
<!-- <div class="tb_search">
<input type="text" placeholder="Search.." class="form-control">
</div> -->
</div>
<div class="table-overflow-auto">
<table class="table" id="table-id">
<thead class="text-primary">
<!--<tr class="d-block"> -->
<th class="d-block">OrderID</th>
<th>Name</th>
<th>Email</th>
<th>Phone No</th>
<th>House No</th>
<th>Street </th>
<th>PIN Code </th>
<th>State </th>
<th>City</th>
<th>Total</th>
<!--</tr>-->
</thead>
<?php
$query = "select * from users";
$rows = mysqli_query($con, $query);
while ($row = mysqli_fetch_array($rows)) {
?>
<tbody>
<tr>
<td>
<?php echo "" . $row['orderID'] . "" ?>
</td>
<td>
<?php echo "" . $row['name'] . " " ?>
</td>
<td>
<?php echo "" . $row['email'] . "" ?>
</td>
<td>
<?php echo "" . $row['phone'] . "" ?>
</td>
<td>
<?php echo "" . $row['houseNo'] . "" ?>
</td>
<td>
<?php echo "" . $row['street'] . "" ?>
</td>
<td>
<?php echo "" . $row['pincode'] . "" ?>
</td>
<td>
<?php echo "" . $row['state'] . "" ?>
</td>
<td>
<?php echo "" . $row['city'] . "" ?>
</td>
<td>
<?php echo "" . $row['totalAmount'] . "" ?>
</td>
</tr>
</tbody>
<?php
}
?>
</table>
</div>
<!-- Start Pagination -->
<div class='pagination-container'>
<nav>
<ul class="pagination">
<!-- Here the JS Function Will Add the Rows -->
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
include 'footer.php';
?>
<!-- <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery Show Rows with Order ID</title>
</head>
<body>
<table border="1">
<thead>
<tr style="display: table-row;">
<th>Order ID</th>
<th>Customer</th>
</tr>
</thead>
<tbody>
<tr>
<td>1234</td>
<td>John Doe</td>
</tr>
<tr>
<td></td>
<td>Empty Order</td>
</tr>
<tr>
<td>5678</td>
<td>Jane Smith</td>
</tr>
</tbody>
</table> -->
<script>
$(document).ready(function() {
// Show only rows that have a non-empty Order ID
$("tbody tr").each(function() {
if ($(this).find("td:first").text().trim() !== "") {
$(this).css("display", "table-row");
}
});
});
</script>
<!-- </body>
</html> -->
<script>
function downloadExcel() {
// Create a new Workbook
var wb = XLSX.utils.book_new();
wb.Props = {
Title: "Employee Data",
Subject: "Exported Table",
Author: "Your Name",
CreatedDate: new Date()
};
// Get table data
var ws = XLSX.utils.table_to_sheet(document.getElementById('table-id'));
// Append sheet to workbook
XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
// Export to Excel
XLSX.writeFile(wb, "EmployeeData.xlsx");
}
</script>
<?php
// include 'footer-script.php';
?>
<!-- <script>
$(document).ready(function() {
$('#table-id').DataTable({
dom: 'Bfrtip',
buttons: [{
extend: 'excelHtml5',
customize: function(xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
$('row c[r^="C"]', sheet).attr('s', '2');
}
}]
});
});
</script> -->
<script>
// function hideRowsWithoutOrderID() {
// let table = document.getElementById("table-id");
// let rows = table.getElementsByTagName("tr");
// for (let i = 1; i < rows.length; i++) { // Start from 1 to skip the header row
// let cells = rows[i].getElementsByTagName("td");
// if (cells.length > 0) {
// let orderID = cells[0].innerText.trim();
// if (orderID === "") {
// rows[i].classList.add("hidden"); // Hide row if Order ID is missing
// }
// }
// }
// }
// // Auto-execute when page loads
// window.onload = hideRowsWithoutOrderID;
</script>
</body>
</html>