This commit is contained in:
Suvodip
2025-03-19 17:46:05 +05:30
parent 6e69bf9f35
commit 8bcf5c055d
13 changed files with 58 additions and 43 deletions

View File

@@ -5,7 +5,7 @@
<h2 class="mb-3 text-center">Customer List</h2>
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead class="bg-primary text-white text-center">
<thead class="text-white text-center" style="background-color: #374151;">
<tr>
<th>Sl No</th>
<th>Name</th>
@@ -19,6 +19,9 @@
</thead>
<tbody>
<?php
// var_dump($_SESSION);
$customerId = $_SESSION['customerId'];
// echo $customerId;
try {
// Connect to the database
$db = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
@@ -26,15 +29,14 @@
// Fetch customer data
$stmt = $db->prepare("SELECT * FROM customers WHERE customerId = :customerId ORDER BY regDate DESC");
$stmt->bindParam(':customerId', $_SESSION['customerId']);
$stmt->bindParam(':customerId', $customerId);
$stmt->execute();
$content = $stmt->fetchAll(PDO::FETCH_ASSOC);
// Fetch invoice data
$stmt2 = $db->prepare("SELECT * FROM invoice");
$stmt2->execute();
$invoiceContent = $stmt2->fetchAll(PDO::FETCH_ASSOC);
// Loop through each customer
$customerSerial = 1;
foreach ($content as $customer) {
@@ -59,8 +61,8 @@
<td><?php echo htmlspecialchars($invoice['totalAmount']); ?></td>
<td>
<a href="/my-account/emi-details/?customerId=<?php echo $customer['customerId'] . '&invoiceId=' . $invoice['invoiceId']; ?>" class="btn btn-primary btn-sm">EMI Details</a>
<a href="/my-account/print-invoice/?customerId=<?php echo $customer['customerId'] . '&invoiceId=' . $invoice['invoiceId']; ?>" class="btn btn-primary btn-sm">Print</a>
<a href="/my-account/emi-details/?customerId=<?php echo $customer['customerId'] . '&invoiceId=' . $invoice['invoiceId']; ?>" class="btn text-white btn-sm" style="background-color: #374151;">EMI Details</a>
<a href="/my-account/print-invoice/?customerId=<?php echo $customer['customerId'] . '&invoiceId=' . $invoice['invoiceId']; ?>" class="btn text-white btn-sm" style="background-color: #374151;">Print</a>
</td>
</tr>
<?php
@@ -75,7 +77,7 @@
<td><?php echo htmlspecialchars($customer['email']); ?></td>
<td colspan="3">No invoice available</td>
<td>
<a href="/my-account/emi-details/?customerId=<?php echo $customer['customerId'] . '&invoiceId=' . $invoice['invoiceId']; ?>" class="btn btn-primary btn-sm">EMI Details</a>
<a href="/my-account/emi-details/?customerId=<?php echo $customer['customerId'] . '&invoiceId=' . $invoice['invoiceId']; ?>" class="btn text-white btn-sm" style="background-color: #374151;">EMI Details</a>
</td>
</tr>
<?php

View File

@@ -71,7 +71,7 @@ try {
</div>
<table class="table table-striped table-bordered">
<thead class="bg-primary text-white text-center">
<thead class="text-white text-center" style="background-color: #374151;">
<tr>
<th>Number of EMI</th>
<th>EMI Amount</th>

View File

@@ -22,7 +22,7 @@ if ($invoiceInfo['tenure'] > 1) {
<div class="container my-5">
<div class="invoice-box">
<h2 class="text-center text-blue">Invoice</h2><hr>
<h2 class="text-center fw-bold" style="color: #374151;">Invoice</h2><hr>
<div class="d-flex justify-content-between">
<div class="w-100">
<h6>Invoice ID: <?= $invoiceInfo['invoiceId'] ?></h6>
@@ -64,12 +64,13 @@ if ($invoiceInfo['tenure'] > 1) {
https://center.rgyci.org/printresult_admin.php?sid=&reg=WB180Y2021R11308&sem=1 -->
<!-- EMI Table (if tenure > 1) -->
<?php if ($invoiceInfo['tenure'] > 1): ?>
<h4 class="mt-4 text-blue">EMI Payment Plan</h4>
<h4 class="mt-4" style="color: #374151;">EMI Payment Plan</h4>
<table class="table table-striped">
<thead>
<tr>
<th>EMI No.</th>
<th>EMI Date</th>
<th>Payment Date</th>
<th>EMI Amount</th>
<th>Outstanding</th>
<th>Status</th>
@@ -80,6 +81,7 @@ if ($invoiceInfo['tenure'] > 1) {
<tr>
<td><?= $emi['emiNumber'] ?></td>
<td><?= $emi['emiDate'] ?></td>
<td><?= $emi['payStatus'] == 1 ? $emi['paymentDate'] : 'Unpaid' ?></td>
<td>$<?= number_format($emi['emiAmount'], 2) ?></td>
<td>$<?= number_format($emi['outstanding'], 2) ?></td>
<td>
@@ -94,7 +96,7 @@ if ($invoiceInfo['tenure'] > 1) {
<p class="text-muted mt-3"><strong>Admin Note:</strong> <?= $invoiceInfo['adminNote'] ?></p>
<!-- Print Button -->
<button onclick="window.print()" class="btn btn-primary btn-print w-100">Print Invoice</button>
<button onclick="window.print()" class="btn text-white btn-print w-100" style="background-color: #374151;">Print Invoice</button>
</div>
</div>