From 8eae9e3ba75d03b54e1d59616f81d1bd73413517 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Fri, 29 Mar 2024 08:38:11 +0530 Subject: [PATCH 1/4] CHANGE_POLICY_MODEL : RV --- app/Models/PolicesModel.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Models/PolicesModel.php b/app/Models/PolicesModel.php index 9f0a2718..d6a8182e 100644 --- a/app/Models/PolicesModel.php +++ b/app/Models/PolicesModel.php @@ -1,13 +1,11 @@ Date: Fri, 29 Mar 2024 10:18:24 +0530 Subject: [PATCH 2/4] FIX_CLIENT_LOGO_PREVIEW_AND_CLIENT_DEPOSIT_VIEW_ALIGNMENT : RV --- app/Views/client_basic_info.php | 115 ++++---- app/Views/client_deposit_list.php | 96 ++++--- app/Views/layout/header.php | 8 +- app/Views/view_deposit.php | 404 +++++++++++++++-------------- public/assets/images/avatar_2x.png | Bin 0 -> 626 bytes 5 files changed, 306 insertions(+), 317 deletions(-) create mode 100644 public/assets/images/avatar_2x.png diff --git a/app/Views/client_basic_info.php b/app/Views/client_basic_info.php index 696897b5..8a4084ce 100644 --- a/app/Views/client_basic_info.php +++ b/app/Views/client_basic_info.php @@ -172,7 +172,7 @@ input:checked + .slider:before { ( Image dimensions 100 x 100 pixels and size of 200KB. )
- " width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar"/> + " width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar"/>
@@ -364,77 +364,68 @@ input:checked + .slider:before { return false; } - function PreviewImage() { - var file = document.getElementById("client_logo").files[0]; - - if (file) { - if (file.size <= 200 * 1024) { // 200kb in bytes - var oFReader = new FileReader(); - oFReader.readAsDataURL(file); - oFReader.onload = function (oFREvent) { - document.getElementById("uploadPreview").src = oFREvent.target.result; + function PreviewImage() { + console.log('function called'); + var fileInput = document.getElementById("client_logo"); + var file = fileInput.files[0]; + + if (file) { + var allowedExtensions = ["jpg", "jpeg", "png"]; + var fileExtension = file.name.split('.').pop().toLowerCase(); + + if (!allowedExtensions.includes(fileExtension) || file.size > 200 * 1024) { + fileInput.value = ""; // Clear the file input + document.getElementById("uploadPreview").src = "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"; // Remove the preview image + } else { + var reader = new FileReader(); + reader.readAsDataURL(file); + + reader.onload = function (event) { + document.getElementById("uploadPreview").src = event.target.result; }; } - } - }; + } + } - - // function validateFile(input) { - // const file = input.files[0]; - // const allowedExtensions = ["jpg", "jpeg", "png"]; - // const fileExtension = file.name.split(".").pop().toLowerCase(); - - // if (!allowedExtensions.includes(fileExtension)) { - // toastr.warning('Only JPG, JPEG, PNG files are allowed.', 'Invalid file type.'); - // document.getElementById("uploadPreview").src = "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"; - // input.value = ""; - // return; - // } - // } - function validateFile(input) { - const file = input.files[0]; - const allowedExtensions = ["jpg", "jpeg", "png"]; - const fileExtension = file.name.split(".").pop().toLowerCase(); - // Check if the file extension is allowed - if (!allowedExtensions.includes(fileExtension)) { - toastr.warning('Only JPG, JPEG, PNG files are allowed.', 'Invalid file type.'); - document.getElementById("uploadPreview").src = ""; - $("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"); - // input.value = ""; - // return; - } + const file = input.files[0]; + const allowedExtensions = ["jpg", "jpeg", "png"]; + const fileExtension = file.name.split(".").pop().toLowerCase(); - // Check file size - const fileSize = file.size / 1024; // in KB - if (fileSize > 200) { - toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.'); - $("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"); - // input.value = ""; - // return; - } - - // Check image dimensions - const img = new Image(); - img.onload = function() { - if (this.width !== 100 || this.height !== 100) { - toastr.warning('Image dimensions should be 100x100 pixels.', 'Invalid image dimensions.'); - $("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"); - // input.value = ""; - // return; + // Check if the file extension is allowed + if (!allowedExtensions.includes(fileExtension)) { + toastr.warning('Only JPG, JPEG, PNG files are allowed.', 'Invalid file type.'); + $("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"); + input.value = ""; } - // If both size and dimensions are valid, you can proceed with your logic here - // For example, you can display the image - const reader = new FileReader(); - reader.onload = function(e) { - document.getElementById("uploadPreview").src = e.target.result; + + + // Check file size + const fileSize = file.size / 1024; // in KB + if (fileSize > 200) { + toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.'); + $("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"); + } + + // Check image dimensions + const img = new Image(); + img.onload = function() { + if (this.width !== 100 || this.height !== 100) { + toastr.warning('Image dimensions should be 100x100 pixels.', 'Invalid image dimensions.'); + $("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"); + } + // If both size and dimensions are valid, you can proceed with your logic here + // For example, you can display the image + const reader = new FileReader(); + reader.onload = function(e) { + document.getElementById("uploadPreview").src = e.target.result; + }; + reader.readAsDataURL(file); }; - reader.readAsDataURL(file); - }; - img.src = URL.createObjectURL(file); + img.src = URL.createObjectURL(file); } diff --git a/app/Views/client_deposit_list.php b/app/Views/client_deposit_list.php index 00a734eb..5d839d1a 100644 --- a/app/Views/client_deposit_list.php +++ b/app/Views/client_deposit_list.php @@ -2,16 +2,17 @@
-
-
- -

Client Deposit -

- -
- -
+
@@ -21,44 +22,41 @@ - + - + - + - insurer_name;?> - - - + insurer_id}?client_id={$value->client_id}"); ?>"> + View Deposit + + + - - + - +
Action
- + insurer_name;?> + ₹ - insurer_id; + insurer_id; + // Check if the balance information exists for the insurer + if (isset($balances[$insurerId])) { + $balance = $balances[$insurerId]->balance; + echo $balance; + } else { + echo "N/A"; // Display "Not Available" if balance information is not present + } + ?> - // Check if the balance information exists for the insurer - if (isset($balances[$insurerId])) { - $balance = $balances[$insurerId]->balance; - echo $balance; - } else { - echo "N/A"; // Display "Not Available" if balance information is not present - } - ?> - - insurer_id}?client_id={$value->client_id}"); ?>"> - View Deposit - -
@@ -67,22 +65,19 @@ \ No newline at end of file diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index 7e5a8568..cb0f925f 100644 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -206,12 +206,12 @@ /* color: #02a8b5 !important; */ font-size: 12px; } - .form-group { - /* margin-bottom: -0.2rem !important; */ + /* .form-group { + margin-bottom: -0.2rem !important; } .form-row{ - /* width: 84%; */ - } + width: 84%; + } */ diff --git a/app/Views/view_deposit.php b/app/Views/view_deposit.php index 2e75f579..d12fba35 100644 --- a/app/Views/view_deposit.php +++ b/app/Views/view_deposit.php @@ -1,55 +1,63 @@ - -
-
-
-
-
-
-
-
- -

Deposit Summary Of short_name?>

- -
-
- -
-
- - - -

name; ?>

-
-
- -
-
-
-

Deposits

-

total_credit?>

-
- -
-

Consumed

-

total_withdraw?>

-
-
-

Refund

-

total_refund?>

-
-
-

Current Balance

-

balance?>

-
-
-
-
-
+
+
+
+
+
+ +
+
+ +

Deposit Summary Of short_name?>

+ +
+
+ +

name; ?>

+
+
+ +
+
+ +
+

Deposits

+

total_credit?> +

+
+ +
+

Consumed

+

total_withdraw?> +

+
+ +
+

Refund

+

total_refund?> +

+
+ +
+

Current Balance

+

balance?> +

+
+ +
+
+
+
+
+
-
+ +
--> +
-
-
-
-
-
-

Transaction Details

-
-
- +
+
+
- -
- +
+
+

Transaction Details

- - +
+ +
+ + +
+ - + - - - - - - - - - - - - - - - - - - - - - - - -
Date User Description Sub Type Credit DebitBalnce
created_at)); ?>username; ?>description; ?>sub_type]) ? $subTypeOptions[$row->sub_type] : ''; ?>transaction_type == 'Credit') ? $row->amount : ''; ?>transaction_type == 'Debit') ? $row->amount : ''; ?>balance; ?>
-
+ Balnce + + + + + + + created_at)); ?> + username; ?> + description; ?> + sub_type]) ? $subTypeOptions[$row->sub_type] : ''; ?> + + transaction_type == 'Credit') ? $row->amount : ''; ?> + transaction_type == 'Debit') ? $row->amount : ''; ?> + balance; ?> + + + + +
-
-
- + +
+
+ -