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 @@