diff --git a/app/Controllers/Books.php b/app/Controllers/Books.php index 74cd3020..ff9abcd1 100755 --- a/app/Controllers/Books.php +++ b/app/Controllers/Books.php @@ -127,10 +127,10 @@ class Books extends BaseController // print_r($bookId); print_r($imageData); print_r($category_id);die; if ($BooksModel->insert($data)) { - session()->setFlashdata('success', 'Book has been added successfully.'); + session()->setFlashdata('success', 'product successfully created.'); $this->logger->info("Books: has been added successfully. Inserted ID = " . $BooksModel->insertID()); } else { - session()->setFlashdata('error', 'Book could not be added. Please try again..'); + session()->setFlashdata('error', 'product could not be created. Please try again..'); $this->logger->error("Books: Err could not be added. Please try again."); } } else { @@ -151,10 +151,10 @@ class Books extends BaseController $BooksModel->db->table('book_categories')->insert(['book_id' => $book_id, 'category_id' => $category_id]); } if ($BooksModel->update($book_id, $data)) { - session()->setFlashdata('success', 'Book has been updated successfully.'); + session()->setFlashdata('success', 'product successfully updated.'); $this->logger->info("Books: has been updated successfully. Updated Book ID = " . $book_id); } else { - session()->setFlashdata('error', 'Book update failed. Please try again.'); + session()->setFlashdata('error', 'product updation failed. Please try again.'); $this->logger->error("Books: Err Failed to update ID =" . $book_id); } } @@ -205,7 +205,7 @@ class Books extends BaseController } } - session()->setFlashdata('success', 'Deleted successfully.'); + session()->setFlashdata('success', 'product successfully deleted.'); $this->logger->info("BOOK: has been Inactived successfully. Inactived ID = " . $id); } else { $this->logger->error("BOOK: Not able to Inactive ID =" . $id); diff --git a/app/Controllers/Customer.php b/app/Controllers/Customer.php index 11c05924..a9a6f1e3 100644 --- a/app/Controllers/Customer.php +++ b/app/Controllers/Customer.php @@ -109,7 +109,7 @@ class Customer extends BaseController $data['isactive'] = 1; $data['created_by'] = $session_uid; if ($model->insert($data)) { - session()->setFlashdata('success', 'Customer has been added successfully.'); + session()->setFlashdata('success', 'Customer successfully created.'); $this->logger->info("Customer : has been added successfully. Inserted ID = " . $model->insertID()); $customer_id_for_addresses = $model->insertID();// for Customer ADDRESS Table } else { @@ -126,10 +126,10 @@ class Customer extends BaseController $data['updated_by'] = $session_uid; $customer_id_for_addresses = $customer_id; // for Customer ADDRESS Table if ($model->update($customer_id, $data)) { - session()->setFlashdata('success', 'Customer has been updated successfully.'); + session()->setFlashdata('success', 'Customer successfully updated'); $this->logger->info("Customer: has been updated successfully. Updated Customer ID = " . $customer_id_for_addresses); } else { - session()->setFlashdata('error', 'Customer update failed. Please try again.'); + session()->setFlashdata('error', 'Customer updation failed. Please try again.'); $this->logger->error("Customer: Err Failed to update ID =" . $customer_id_for_addresses); } } @@ -248,7 +248,7 @@ class Customer extends BaseController } $CustomerModel->inactiveMissingAddressDetails($where, $shipAddressIds); } - session()->setFlashdata('success', 'Deleted successfully.'); + session()->setFlashdata('success', 'Customer successfully deleted.'); $this->logger->info("Customer: has been Inactived successfully. Inactived ID = " . $id); } else { $this->logger->error("Customer: Not able to Inactive ID =" . $id); diff --git a/app/Models/HomeModel.php b/app/Models/HomeModel.php index 12ed53b2..f7805c28 100644 --- a/app/Models/HomeModel.php +++ b/app/Models/HomeModel.php @@ -70,7 +70,7 @@ class HomeModel extends Model ->where('S.to_subscription >=', $now) ->where('S.to_subscription <=', $last30days) // ->where('BC.category_id', 5) - ->where('LOWER(BC.category_name)', strtolower('Membership'), FALSE) + ->where('LOWER(CM.name)', strtolower("Membership")) ->groupBy('S.sub_id') ->get() ->getResultArray(); diff --git a/app/Models/InvoiceModel.php b/app/Models/InvoiceModel.php index 2b7190f4..56ab70d0 100644 --- a/app/Models/InvoiceModel.php +++ b/app/Models/InvoiceModel.php @@ -117,28 +117,6 @@ public function updateData($table, $data, $where) return $query->get()->getResult(); } - public function generate_invoice_pdf($id) - { - // Load the mPDF library - $mpdf = new \Mpdf\Mpdf(); - - // Fetch invoice data - $invoice = $this->find($id); - - if ($invoice) { - // Create the HTML content for the PDF - - // Load HTML content into mPDF - $mpdf->WriteHTML($html); - - // Set PDF filename - $pdfFileName = 'invoice_' . $invoice->invoice_number . '.pdf'; - - // Output the PDF for download - $mpdf->Output($pdfFileName, 'D'); - } - } - public function getInvoiceData($id) { // Fetch invoice data @@ -172,21 +150,20 @@ public function updateData($table, $data, $where) } - public function getMembershipListForCustomer($category,$id) + public function getMembershipListForCustomer($category, $id) { $data = $this->db->table('subscription as S') - ->join('customers as C','C.customer_id = S.customer_id','left') + ->join('customers as C', 'C.customer_id = S.customer_id', 'left') ->join('category as CM', 'CM.id = S.scheme_id', 'left') ->join('book_categories as BC', 'BC.category_id = S.scheme_id', 'left') ->join('books as BK', 'BC.book_id = BK.book_id', 'left') - ->select('S.customer_id,concat(C.first_name, " ", C.last_name) as customer_name,S.sub_id,S.scheme_id,DATE_FORMAT(S.from_subscription, "%d/%m/%Y") AS formatted_from_subscription,DATE_FORMAT(S.to_subscription, "%d/%m/%Y") AS formatted_to_subscription,S.from_subscription,S.to_subscription,S.created_on,CM.name,BK.title,BK.book_id') - ->where('LOWER(CM.name)', strtolower("'".$category."'"), FALSE) + ->select('S.customer_id, CONCAT(C.first_name, " ", C.last_name) as customer_name, S.sub_id, S.scheme_id, DATE_FORMAT(S.from_subscription, "%d/%m/%Y") AS formatted_from_subscription, DATE_FORMAT(S.to_subscription, "%d/%m/%Y") AS formatted_to_subscription, S.from_subscription, S.to_subscription, S.created_on, CM.name, BK.title, BK.book_id') + ->where('CM.name', strtolower($category)) ->where('S.customer_id', $id) ->groupBy('S.sub_id') - ->orderBy('S.created_on','ASC') + ->orderBy('S.created_on', 'ASC') ->get() ->getResultArray(); - // print_r($this->db->getLastQuery());die; return $data; } diff --git a/app/Views/book_form.php b/app/Views/book_form.php index fcf1e112..18b3fc6b 100644 --- a/app/Views/book_form.php +++ b/app/Views/book_form.php @@ -166,7 +166,7 @@
-
- \ No newline at end of file + + \ No newline at end of file diff --git a/app/Views/campaign_creation_form.php b/app/Views/campaign_creation_form.php index a3cadf71..2d98c12a 100644 --- a/app/Views/campaign_creation_form.php +++ b/app/Views/campaign_creation_form.php @@ -3,7 +3,7 @@

- " method="post" enctype="multipart/form-data"> + " method="post" enctype="multipart/form-data" id="myForm">
@@ -78,7 +78,7 @@
-
@@ -249,7 +250,8 @@
- + + " class="btn btn-secondary waves-effect">Cancel @@ -262,8 +264,11 @@ - + +
@@ -508,16 +513,19 @@ } + \ No newline at end of file diff --git a/app/Views/customer_group_form.php b/app/Views/customer_group_form.php index 3c3198d1..2937a3e1 100644 --- a/app/Views/customer_group_form.php +++ b/app/Views/customer_group_form.php @@ -149,7 +149,7 @@
@@ -569,6 +569,21 @@ function restriction(event,temporary_flag) { // var selectedOperator = selectElement.value; // } + diff --git a/app/Views/event_form.php b/app/Views/event_form.php index c4b79301..dbdeea5b 100644 --- a/app/Views/event_form.php +++ b/app/Views/event_form.php @@ -4,13 +4,13 @@

-
" > + " id="myForm">
- +
Please provide.
@@ -29,17 +29,17 @@
- +
Please provide.
- +
-
-
-
- \ No newline at end of file +
+ \ No newline at end of file diff --git a/app/Views/invoice_form.php b/app/Views/invoice_form.php index 8428f094..700e287d 100644 --- a/app/Views/invoice_form.php +++ b/app/Views/invoice_form.php @@ -4,7 +4,7 @@


- "> + " id="myForm">
@@ -17,6 +17,7 @@
Please select customer.
+
@@ -27,70 +28,7 @@
- - - +
@@ -332,7 +270,7 @@
- +
@@ -344,7 +282,6 @@ -
@@ -716,23 +653,14 @@ }); } if (cm.length > 0) { - $("#subscribedetails").show(); - $("#schemeName").text(cm[0].title); - $("#fromDate").text(cm[0].formatted_from_subscription); - $("#toDate").text(cm[0].formatted_to_subscription); - // $.each(cm, function(k, v) {}); - // "formatted_from_subscription": "12/10/2023", - // "formatted_to_subscription": "12/11/2023", - // "from_subscription": "2023-10-12", - // "to_subscription": "2023-11-12", - // "title": "First Std Tamil Book", - }else{ - $("#subscribedetails").hide(); - $("#schemeName").text(''); - $("#fromDate").text(''); - $("#toDate").text(''); + $(".subscribedetails").show(); // Change this line to use the class selector + $("#schemeName").text(cm[0].title + " ( From: " + cm[0].formatted_from_subscription + " To: " + cm[0].formatted_to_subscription+" )"); + } else { + $(".subscribedetails").show(); // Change this line to use the class selector + $("#schemeName").text("No Earlier Membership found"); } + // var address_compare = bill_addr == customer_billing ? customer_billing : bill_addr // if ((bill_addr != "") && (bill_addr != customer_billing)) { @@ -886,4 +814,19 @@ // Replicate the balance amount value to the paid amount document.getElementById('paidAmount').value = balanceAmount; }); - \ No newline at end of file + + diff --git a/app/Views/notifications_form.php b/app/Views/notifications_form.php index 8584e726..064b4f04 100644 --- a/app/Views/notifications_form.php +++ b/app/Views/notifications_form.php @@ -83,7 +83,7 @@
-->
-
"> + " id="myForm2">
@@ -266,4 +266,19 @@ document.getElementById("group_id").value = ""; } }); + + \ No newline at end of file diff --git a/app/Views/scheme_form.php b/app/Views/scheme_form.php index dbe4e4a4..cd8952ac 100644 --- a/app/Views/scheme_form.php +++ b/app/Views/scheme_form.php @@ -4,7 +4,7 @@

- "> + " id="myForm">
@@ -54,7 +54,7 @@
-
- \ No newline at end of file + + \ No newline at end of file diff --git a/app/Views/setting_form.php b/app/Views/setting_form.php index 49a1f2c4..9d9ba00d 100644 --- a/app/Views/setting_form.php +++ b/app/Views/setting_form.php @@ -237,7 +237,7 @@
-
- \ No newline at end of file + + \ No newline at end of file diff --git a/app/Views/subscription_form.php b/app/Views/subscription_form.php index 811494e5..b11ecd53 100644 --- a/app/Views/subscription_form.php +++ b/app/Views/subscription_form.php @@ -5,7 +5,7 @@

" > + action="" id="myForm">
@@ -80,7 +80,7 @@
-