From 321e617580369b421e628d891571d6e72974fda5 Mon Sep 17 00:00:00 2001 From: Suvodip Date: Tue, 25 Mar 2025 20:33:59 +0530 Subject: [PATCH] s22 --- customers/.hta_slug/billing-details.php | 5 +- customers/.hta_slug/change-password.php | 127 ++++++++++++++++++++++++ customers/.hta_slug/list.php | 2 + customers/.hta_slug/new.php | 2 +- my-account/.hta_slug/_home.php | 6 +- my-account/.hta_slug/emi-details.php | 65 +++++++----- 6 files changed, 176 insertions(+), 31 deletions(-) create mode 100644 customers/.hta_slug/change-password.php diff --git a/customers/.hta_slug/billing-details.php b/customers/.hta_slug/billing-details.php index 29788f3..c3aa1ca 100644 --- a/customers/.hta_slug/billing-details.php +++ b/customers/.hta_slug/billing-details.php @@ -72,8 +72,6 @@ } - - try { $stmt = $db->prepare("SELECT * FROM invoice WHERE customerId = :customerId AND invoiceId = :invoiceId"); $stmt->bindParam(':invoiceId', $_GET['invoiceId']); @@ -159,13 +157,14 @@ $frequency = $frequency !== null ? $frequency : 0; ?>
-

EMI Details

+

Installment Details

Customer Name:

Mobile Number:

Booking Date:

Invoice Id:

+

Email:

Total Amount: $

diff --git a/customers/.hta_slug/change-password.php b/customers/.hta_slug/change-password.php new file mode 100644 index 0000000..5cb08e4 --- /dev/null +++ b/customers/.hta_slug/change-password.php @@ -0,0 +1,127 @@ + +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + // Fetch input values + $customerId = $_GET['customerId']; + $newPassword = md5($_POST['new_password']); + $confirmPassword = md5($_POST['confirm_password']); + + if ($newPassword !== $confirmPassword) { + $message = '
New passwords do not match. Please try again.
'; + } else { + // Update password + $stmt = $db->prepare("UPDATE users SET password = :password WHERE customerId = :customerId"); + $stmt->bindParam(':password', $newPassword, PDO::PARAM_STR); + $stmt->bindParam(':customerId', $customerId, PDO::PARAM_STR); + + if ($stmt->execute()) { + $message = '
Password updated successfully!
'; + } else { + $message = '
Failed to update password. Try again later.
'; + } + } + + } catch (PDOException $e) { + $message = '
Error: ' . $e->getMessage() . '
'; + } +} +?> + + + + +
+
+
+ +

Chnage 's password

+ +
+
+
Change Password

+ +
+
+ +
+
+ +
+ +
+
+
+
+ \ No newline at end of file diff --git a/customers/.hta_slug/list.php b/customers/.hta_slug/list.php index f17006f..b9a8cf5 100644 --- a/customers/.hta_slug/list.php +++ b/customers/.hta_slug/list.php @@ -135,6 +135,7 @@ + Change Password " /> + Change Password
- +
diff --git a/my-account/.hta_slug/_home.php b/my-account/.hta_slug/_home.php index abb272e..3f5e8ac 100644 --- a/my-account/.hta_slug/_home.php +++ b/my-account/.hta_slug/_home.php @@ -2,7 +2,7 @@ require('../.hta_config/conf.php'); ?>
-

Customer List

+

My Account


@@ -61,7 +61,7 @@ @@ -77,7 +77,7 @@ Error: ' . $e->getMessage() . ''); } ?> +
-

EMI Details

+

Installment Details

Customer Name:

Mobile Number:

-

EMI Booking Date:

-

EMI Booking Date:

+

Installment Start Date:

+

Booking Date:

- -

Total Amount:

-

Outstanding:

-

Tenure:

-

Frequency:

+

Total Amount: $

+

Outstanding: $

+

Tenure:

+

Frequency:

- EMI Details + Details Print
No invoice available - EMI Details + Details
- - - + + + - + @@ -93,7 +110,7 @@ try { - +
Number of EMIEMI AmountEMI DateInstallmentAmountDate Payment Status Outstanding
$ $
\ No newline at end of file