Auto commit: 2025-10-26T16:55:45.058Z
This commit is contained in:
parent
7fd4fb5808
commit
991c9b924e
60
reports.php
60
reports.php
@ -71,25 +71,7 @@ $overdue_invoices = $invoice_statuses['Overdue'] ?? 0;
|
|||||||
<i class="bi bi-journal-text"></i> Invoice Status Distribution
|
<i class="bi bi-journal-text"></i> Invoice Status Distribution
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="progress" style="height: 30px;">
|
<canvas id="invoiceStatusChart"></canvas>
|
||||||
<div class="progress-bar bg-success" role="progressbar" style="width: <?php echo ($paid_invoices / $total_invoices) * 100; ?>%" aria-valuenow="<?php echo $paid_invoices; ?>" aria-valuemin="0" aria-valuemax="<?php echo $total_invoices; ?>">Paid</div>
|
|
||||||
<div class="progress-bar bg-warning" role="progressbar" style="width: <?php echo ($pending_invoices / $total_invoices) * 100; ?>%" aria-valuenow="<?php echo $pending_invoices; ?>" aria-valuemin="0" aria-valuemax="<?php echo $total_invoices; ?>">Pending</div>
|
|
||||||
<div class="progress-bar bg-danger" role="progressbar" style="width: <?php echo ($overdue_invoices / $total_invoices) * 100; ?>%" aria-valuenow="<?php echo $overdue_invoices; ?>" aria-valuemin="0" aria-valuemax="<?php echo $total_invoices; ?>">Overdue</div>
|
|
||||||
</div>
|
|
||||||
<div class="d-flex justify-content-around mt-3 text-center">
|
|
||||||
<div>
|
|
||||||
<p class="mb-0 fs-5"><?php echo $paid_invoices; ?></p>
|
|
||||||
<span class="text-success">Paid</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p class="mb-0 fs-5"><?php echo $pending_invoices; ?></p>
|
|
||||||
<span class="text-warning">Pending</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p class="mb-0 fs-5"><?php echo $overdue_invoices; ?></p>
|
|
||||||
<span class="text-danger">Overdue</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -145,6 +127,46 @@ $overdue_invoices = $invoice_statuses['Overdue'] ?? 0;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
const ctx = document.getElementById('invoiceStatusChart').getContext('2d');
|
||||||
|
new Chart(ctx, {
|
||||||
|
type: 'doughnut',
|
||||||
|
data: {
|
||||||
|
labels: ['Paid', 'Pending', 'Overdue'],
|
||||||
|
datasets: [{
|
||||||
|
label: 'Invoice Status',
|
||||||
|
data: [<?php echo $paid_invoices; ?>, <?php echo $pending_invoices; ?>, <?php echo $overdue_invoices; ?>],
|
||||||
|
backgroundColor: [
|
||||||
|
'rgba(25, 135, 84, 0.7)',
|
||||||
|
'rgba(255, 193, 7, 0.7)',
|
||||||
|
'rgba(220, 53, 69, 0.7)'
|
||||||
|
],
|
||||||
|
borderColor: [
|
||||||
|
'rgba(25, 135, 84, 1)',
|
||||||
|
'rgba(255, 193, 7, 1)',
|
||||||
|
'rgba(220, 53, 69, 1)'
|
||||||
|
],
|
||||||
|
borderWidth: 1
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
plugins: {
|
||||||
|
legend: {
|
||||||
|
position: 'top',
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
display: false,
|
||||||
|
text: 'Invoice Status Distribution'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
require_once 'templates/footer.php';
|
require_once 'templates/footer.php';
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -10,6 +10,7 @@ $page = $page ?? '';
|
|||||||
<title><?php echo htmlspecialchars($title ?? 'Billing'); ?></title>
|
<title><?php echo htmlspecialchars($title ?? 'Billing'); ?></title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user