bakit kaya lagi No matching records found kahit meron naman laman sa table ko ito code ko
<?php
include 'superusernewnav.php';
?>
<?php
include '../partials/header.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="You do not have permission to view the full content of this post. Log in or register now." rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
<link rel="stylesheet" href= "You do not have permission to view the full content of this post. Log in or register now.">
<link rel= "stylesheet" href="../css/superuser.css">
</head>
<body class="body-background">
<Caption>Accounting Voucher</Caption>
<div class="container-fluid mt-3">
<form method="POST" class="row g-3 needs-validation" novalidate action="vouchercode.php">
<div class="datetime-superuser">
<input type="hidden" name="time_hidden" id="time_hidden">
<input type="datetime-local" class="form-control w-25" name="time" id="time1" aria-label="Disabled input example" readonly>
</div>
<div class="col-md-2">
<label for="validationCustom01" class="form-label"></label>
<input type="text" class="form-control" name="tracking_no" id="validationCustom01" value="" placeholder="Tracking No." required>
<div class="invalid-feedback">
Please input d.v number.
</div>
</div>
<input type="hidden" class="form-control" name="division" id="validationCustom01" value="Accounting" placeholder="" required>
<div class="col-md-3">
<label for="validationCustom01" class="form-label"></label>
<input type="text" class="form-control" name="payeename" id="validationCustom01" value="" placeholder="Payee Name" required>
<div class="invalid-feedback">
Please input d.v number.
</div>
</div>
<div class="col-md-3">
<label for="validationCustom01" class="form-label"></label>
<input type="text" class="form-control" name="particular" id="validationCustom01" value="" placeholder="Particular" required>
<div class="invalid-feedback">
Please input d.v number.
</div>
</div>
<div class="col-md-2">
<label for="validationCustom01" class="form-label"></label>
<input type="text" class="form-control" name="amount" id="validationCustom01" value="" placeholder="Amount" required>
<div class="invalid-feedback">
Please input d.v number.
</div>
</div>
<div class="col-md-2">
<label for="validationCustom03" class="form-label"></label>
<select class="form-select" name="fundname" aria-label="Default select example " required>
<option selected>Select Fund</option>
<option value="Regular Fund">Regular Fund</option>
<option value="Trust Fund">Trust Fund</option>
<option value="Afaci Fund">Afaci Fund</option>
<option value="Revolving Fund">Revolving Fund</option>
<option value="MDS Trust Fund">MDS Trust Fund</option>
</select>
<div class="invalid-feedback">
Please provide a valid city.
</div>
</div>
<div class="col-12">
<button class="btn btn-primary w-100" type="submit" name="btn-submit">Submit form</button>
</div>
</form>
</div>
<br>
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>
S.no.
</th>
<th>
Date
</th>
<th>
Tracking no.
</th>
<th>
Payee Name.
</th>
<th>
Particular.
</th>
<th>
Amount.
</th>
<th>
Fund.
</th>
</tr>
</thead>
<?php
$stmtDailyCount = $con->prepare("SELECT DATE(datetime) AS entry_date, COUNT(*) AS daily_count
FROM voucherinput
WHERE division = 'Accounting'
GROUP BY entry_date
ORDER BY entry_date DESC");
if ($stmtDailyCount->execute()) {
$resultDailyCount = $stmtDailyCount->get_result();
$daily_counts = array();
while ($row = $resultDailyCount->fetch_assoc()) {
$entry_date = date('m/d/Y', strtotime($row['entry_date']));
$daily_count = $row['daily_count'];
$daily_counts[$entry_date] = $daily_count;
}
}
$stmt = $con->prepare("SELECT * FROM voucherinput WHERE division = 'Accounting' ORDER BY datetime DESC ");
if ($stmt->execute()) {
$result = $stmt->get_result();
$number = 1;
$countnumber = 0;
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$countnumber++;
$dbtime_id = date('m/d/Y g:i a', strtotime($row['datetime']));
$dbtracking_Id = $row['tracking_number'];
$dbpayee_Id = $row['payee_name'];
$dbparticular_id = $row['particular'];
$dbamount_id = $row['amount'];
$dbfund_id = $row['fundname'];
?>
<tbody>
<tr class="trldap">
<td>
<?= $number++ ?>
</td>
<td>
<?= $dbtime_id ?>
</td>
<td>
<?= $dbtracking_Id ?>
</td>
<td>
<?= $dbpayee_Id ?>
</td>
<td>
<?= $dbparticular_id ?>
</td>
<td>
<?= $dbamount_id ?>
</td>
<td>
<?php echo $dbfund_id; ?>
</td>
</tr>
</tbody>
<?php
}
}
}
echo "Total records in Accounting division: " . $countnumber;
// Display the daily counts
echo "Daily Counts: ";
foreach ($daily_counts as $entry_date => $daily_count) {
if ($entry_date != '01/01/1970') {
echo $daily_count;
}
}
?>
</table>
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<script>
// Kunin ang oras mula sa datetime-local field at ilagay ito sa hidden field
document.addEventListener('DOMContentLoaded', function () {
var datetimeLocalInput = document.getElementById('time1');
var hiddenInput = Document.getElementById('time_hidden');
datetimeLocalInput.addEventListener('change', function(){
hiddenInput.value = datetimeLocalInput.value;
});
});
</script>
<script>
function updateDatetime() {
const datetimeLocalInput = document.getElementById('time1');
const now = new Date();
// Extract date and time components
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
// Create the formatted datetime string in the desired format
const formattedDatetime =
datetimeLocalInput.value = formattedDatetime;
}
// Call the updateDatetime function initially
updateDatetime();
// Set up an interval to update the datetime every second (adjust the interval as needed)
setInterval(updateDatetime, 1000);
</script>
<script>
const eventSource = new EventSource('voucherrealtime.php');
eventSource.onmessage = function(event) {
const newData = JSON.parse(event.data);
// Dito mo ilalagay ang code para i-update ang iyong web page
// Halimbawa, i-display ang mga updates sa isang div element na may id "data"
document.getElementById('data').innerHTML = `
<p>Date: ${newData.oras}</p>
`;
};
</script>
<script>
let table = new DataTable('#example');
table.on('click', 'tbody tr', function () {
let data = table.row(this).data();
alert('You clicked on ' + data[0] + "'s row");
});
</script>
</body>
</html>
<?php
include 'superusernewnav.php';
?>
<?php
include '../partials/header.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="You do not have permission to view the full content of this post. Log in or register now." rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
<link rel="stylesheet" href= "You do not have permission to view the full content of this post. Log in or register now.">
<link rel= "stylesheet" href="../css/superuser.css">
</head>
<body class="body-background">
<Caption>Accounting Voucher</Caption>
<div class="container-fluid mt-3">
<form method="POST" class="row g-3 needs-validation" novalidate action="vouchercode.php">
<div class="datetime-superuser">
<input type="hidden" name="time_hidden" id="time_hidden">
<input type="datetime-local" class="form-control w-25" name="time" id="time1" aria-label="Disabled input example" readonly>
</div>
<div class="col-md-2">
<label for="validationCustom01" class="form-label"></label>
<input type="text" class="form-control" name="tracking_no" id="validationCustom01" value="" placeholder="Tracking No." required>
<div class="invalid-feedback">
Please input d.v number.
</div>
</div>
<input type="hidden" class="form-control" name="division" id="validationCustom01" value="Accounting" placeholder="" required>
<div class="col-md-3">
<label for="validationCustom01" class="form-label"></label>
<input type="text" class="form-control" name="payeename" id="validationCustom01" value="" placeholder="Payee Name" required>
<div class="invalid-feedback">
Please input d.v number.
</div>
</div>
<div class="col-md-3">
<label for="validationCustom01" class="form-label"></label>
<input type="text" class="form-control" name="particular" id="validationCustom01" value="" placeholder="Particular" required>
<div class="invalid-feedback">
Please input d.v number.
</div>
</div>
<div class="col-md-2">
<label for="validationCustom01" class="form-label"></label>
<input type="text" class="form-control" name="amount" id="validationCustom01" value="" placeholder="Amount" required>
<div class="invalid-feedback">
Please input d.v number.
</div>
</div>
<div class="col-md-2">
<label for="validationCustom03" class="form-label"></label>
<select class="form-select" name="fundname" aria-label="Default select example " required>
<option selected>Select Fund</option>
<option value="Regular Fund">Regular Fund</option>
<option value="Trust Fund">Trust Fund</option>
<option value="Afaci Fund">Afaci Fund</option>
<option value="Revolving Fund">Revolving Fund</option>
<option value="MDS Trust Fund">MDS Trust Fund</option>
</select>
<div class="invalid-feedback">
Please provide a valid city.
</div>
</div>
<div class="col-12">
<button class="btn btn-primary w-100" type="submit" name="btn-submit">Submit form</button>
</div>
</form>
</div>
<br>
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>
S.no.
</th>
<th>
Date
</th>
<th>
Tracking no.
</th>
<th>
Payee Name.
</th>
<th>
Particular.
</th>
<th>
Amount.
</th>
<th>
Fund.
</th>
</tr>
</thead>
<?php
$stmtDailyCount = $con->prepare("SELECT DATE(datetime) AS entry_date, COUNT(*) AS daily_count
FROM voucherinput
WHERE division = 'Accounting'
GROUP BY entry_date
ORDER BY entry_date DESC");
if ($stmtDailyCount->execute()) {
$resultDailyCount = $stmtDailyCount->get_result();
$daily_counts = array();
while ($row = $resultDailyCount->fetch_assoc()) {
$entry_date = date('m/d/Y', strtotime($row['entry_date']));
$daily_count = $row['daily_count'];
$daily_counts[$entry_date] = $daily_count;
}
}
$stmt = $con->prepare("SELECT * FROM voucherinput WHERE division = 'Accounting' ORDER BY datetime DESC ");
if ($stmt->execute()) {
$result = $stmt->get_result();
$number = 1;
$countnumber = 0;
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$countnumber++;
$dbtime_id = date('m/d/Y g:i a', strtotime($row['datetime']));
$dbtracking_Id = $row['tracking_number'];
$dbpayee_Id = $row['payee_name'];
$dbparticular_id = $row['particular'];
$dbamount_id = $row['amount'];
$dbfund_id = $row['fundname'];
?>
<tbody>
<tr class="trldap">
<td>
<?= $number++ ?>
</td>
<td>
<?= $dbtime_id ?>
</td>
<td>
<?= $dbtracking_Id ?>
</td>
<td>
<?= $dbpayee_Id ?>
</td>
<td>
<?= $dbparticular_id ?>
</td>
<td>
<?= $dbamount_id ?>
</td>
<td>
<?php echo $dbfund_id; ?>
</td>
</tr>
</tbody>
<?php
}
}
}
echo "Total records in Accounting division: " . $countnumber;
// Display the daily counts
echo "Daily Counts: ";
foreach ($daily_counts as $entry_date => $daily_count) {
if ($entry_date != '01/01/1970') {
echo $daily_count;
}
}
?>
</table>
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<script>
// Kunin ang oras mula sa datetime-local field at ilagay ito sa hidden field
document.addEventListener('DOMContentLoaded', function () {
var datetimeLocalInput = document.getElementById('time1');
var hiddenInput = Document.getElementById('time_hidden');
datetimeLocalInput.addEventListener('change', function(){
hiddenInput.value = datetimeLocalInput.value;
});
});
</script>
<script>
function updateDatetime() {
const datetimeLocalInput = document.getElementById('time1');
const now = new Date();
// Extract date and time components
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
// Create the formatted datetime string in the desired format
const formattedDatetime =
${year}-${month}-${day}T${hours}:${minutes}
;datetimeLocalInput.value = formattedDatetime;
}
// Call the updateDatetime function initially
updateDatetime();
// Set up an interval to update the datetime every second (adjust the interval as needed)
setInterval(updateDatetime, 1000);
</script>
<script>
const eventSource = new EventSource('voucherrealtime.php');
eventSource.onmessage = function(event) {
const newData = JSON.parse(event.data);
// Dito mo ilalagay ang code para i-update ang iyong web page
// Halimbawa, i-display ang mga updates sa isang div element na may id "data"
document.getElementById('data').innerHTML = `
<p>Date: ${newData.oras}</p>
`;
};
</script>
<script>
let table = new DataTable('#example');
table.on('click', 'tbody tr', function () {
let data = table.row(this).data();
alert('You clicked on ' + data[0] + "'s row");
});
</script>
</body>
</html>