This commit is contained in:
Suvodip
2025-03-26 11:53:18 +05:30
parent 321e617580
commit 55874583eb
7 changed files with 122 additions and 116 deletions

View File

@@ -110,12 +110,11 @@
} else {
$emi = [];
}
?>
?>
<tr>
<td><?php echo $customerSerial++; ?></td>
<td>
<a href="/customers/billing-details/?customerId=<?php echo $customer['customerId'] . '&invoiceId=' . $invoice['invoiceId']; ?>">
<a class="fw-bold" href="/customers/billing-details/?customerId=<?php echo $customer['customerId'] . '&invoiceId=' . $invoice['invoiceId']; ?>">
<?php echo htmlspecialchars($customer['name']); ?>
</a>
</td>
@@ -129,35 +128,35 @@
<td class="d-flex gap-1">
<a href="/customers/generate-invoice/?customerId=<?php echo $customer['customerId']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">New</a>
<a href="/customers/edit-invoice/?customerId=<?php echo $customer['customerId'].'&invoiceId='.$invoice['invoiceId']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">Edit</a>
<a href="/customers/print-invoice/?customerId=<?php echo $customer['customerId'].'&invoiceId='.$invoice['invoiceId']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">Print</a>
<a href="/customers/print-invoice/?customerId=<?php echo $customer['customerId'].'&invoiceId='.$invoice['invoiceId']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;" target="_blank">Print</a>
<a href="/customers/change-password/?customerId=<?php echo $customer['customerId'].'&userName='.$customer['name']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">Password</a>
<form method="post">
<input type="hidden" name="customerId" value="<?php echo htmlspecialchars($customer['customerId']); ?>" />
<input type="hidden" name="invoiceId" value="<?php echo htmlspecialchars($invoice['invoiceId']); ?>" />
<button type="submit" name="delete" class="btn btn-danger btn-sm" style="font-size: 13px;">Delete</button>
</form>
<a href="/customers/change-password/?customerId=<?php echo $customer['customerId'].'&userName='.$customer['name']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">Change Password</a>
</td>
</tr>
<?php
}
} else {
// For customers without an invoice, you can still display their info but leave invoice data empty
?>
?>
<tr>
<td><?php echo $customerSerial++; ?></td>
<td><?php echo htmlspecialchars($customer['name']); ?></td>
<td class="fw-bold"><?php echo htmlspecialchars($customer['name']); ?></td>
<td colspan="6" class="text-center">No EMI or Invoice Data</td>
<td class="d-flex gap-1">
<a href="/customers/generate-invoice/?customerId=<?php echo $customer['customerId']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">New</a>
<a href="/customers/change-password/?customerId=<?php echo $customer['customerId'].'&userName='.$customer['name']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">Password</a>
<form method="post">
<input type="hidden" name="customerId" value="<?php echo htmlspecialchars($customer['customerId']); ?>" />
<input type="hidden" name="invoiceId" value="<?php echo htmlspecialchars($invoice['invoiceId']); ?>" />
<button type="submit" name="delete" class="btn btn-danger btn-sm" style="font-size: 13px;">Delete</button>
</form>
<a href="/customers/change-password/?customerId=<?php echo $customer['customerId'].'&userName='.$customer['name']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">Change Password</a>
</td>
</tr>
<?php
<?php
}
}
} catch (PDOException $e) {