From 5a7d027a2b7c2260a370f4562d33afa3f23e42f5 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Fri, 13 Oct 2023 15:55:01 +0530 Subject: [PATCH 1/6] Book module Message : ps --- app/Controllers/Books.php | 81 +++++++++++++++++++++++++++++------- app/Models/BooksModel.php | 18 ++++++++ app/Models/CustomerModel.php | 5 +-- app/Views/book_form.php | 4 +- app/Views/book_list.php | 18 ++++++++ 5 files changed, 105 insertions(+), 21 deletions(-) diff --git a/app/Controllers/Books.php b/app/Controllers/Books.php index 8d51d4b0..5a165bfb 100755 --- a/app/Controllers/Books.php +++ b/app/Controllers/Books.php @@ -54,6 +54,7 @@ class Books extends BaseController ## For inserting/updating details of book public function insert_books() { + try{ helper('session'); $session_uid = get_logged_user_id(); $session_bid = get_business_id(); @@ -121,13 +122,29 @@ class Books extends BaseController $data['isactive'] = 1; $data['category'] = 1; $data['created_by'] = $session_uid; - $BooksModel->insert($data); + if ($BooksModel->insert($data)) { + session()->setFlashdata('success', 'Book has been added successfully.'); + $this->logger->info("Books: has been added successfully. Inserted ID = " . $BooksModel->insertID()); + } else { + session()->setFlashdata('error', 'Book could not be added. Please try again..'); + $this->logger->error("Books: Err could not be added. Please try again."); + } } else { // It's an update operation $isactive = $this->request->getPost('isactive'); $data['isactive'] = ($isactive == 'on') ? 1 : 0; $data['updated_by'] = $session_uid; - $BooksModel->update($book_id, $data); + if ($BooksModel->update($book_id, $data)) { + session()->setFlashdata('success', 'Book has been updated successfully.'); + $this->logger->info("Books: has been updated successfully. Updated Book ID = " . $book_id); + } else { + session()->setFlashdata('error', 'Book update failed. Please try again.'); + $this->logger->error("Books: Err Failed to update ID =" . $book_id); + } + } + } catch (\Exception $e) { + $this->logger->error("Book: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine()); + session()->setFlashdata('error', 'Message: ' . $e->getMessage()); } return redirect()->route('book_list'); } @@ -135,21 +152,55 @@ class Books extends BaseController ## For delete the book details (Which means inactive the details) public function delete_books($id) { - - helper('session'); - $session_uid = get_logged_user_id(); - - $BooksModel = new BooksModel(); - - $existingBook = $BooksModel->find($id); - if (!$existingBook) { - return redirect()->route('book_list'); + try { + helper('session'); + $session_uid = get_logged_user_id(); + $BooksModel = new BooksModel(); + $where = ['book_id' => (int)$id, 'isactive =' => 1]; + // $existingBook = $BooksModel->find($id); + $existingBook = $BooksModel->where($where)->find($id); + if ($existingBook) { + $this->logger->Info("BOOK: Going to Inactive ID = ".$id); + $data = ['isactive' => 0 , 'updated_by' => $session_uid]; + if ($BooksModel->update($id, $data)) { + $activeBookImages = $BooksModel->getData('book_images', $where); + if(!empty($activeBookImages)){ + for ($y = 0; $y < count($activeBookImages); $y++) { + $bookImgIds[$y] = $activeBookImages[$y]->book_img_id; + } + if(!empty($bookImgIds)){ + $this->logger->Info("BOOK: Images Going to Inactived = ".implode(" ",$bookImgIds)); + $inactive_img_whereIn[0] = 'book_img_id'; + $inactive_img_whereIn[1] = $bookImgIds; + $BooksModel->inactiveMissingDetails('book_images',$where, $inactive_img_whereIn); + } + } + $activeBookCategory = $BooksModel->getData('book_categories', $where); + if(!empty($activeBookCategory)){ + for ($z = 0; $z < count($activeBookCategory); $z++) { + $bookCategoryIds[$z] = $activeBookCategory[$z]->id; + } + if(!empty($bookCategoryIds)){ + $this->logger->Info("BOOK: Categories Going to Inactived = ".implode(" ",$bookCategoryIds)); + $inactive_category_whereIn[0] = 'id'; + $inactive_category_whereIn[1] = $bookCategoryIds; + $BooksModel->inactiveMissingDetails('book_categories',$where, $inactive_category_whereIn); + } + } + + session()->setFlashdata('success', 'Deleted successfully.'); + $this->logger->info("BOOK: has been Inactived successfully. Inactived ID = " . $id); + } else { + $this->logger->error("BOOK: Not able to Inactive ID =" . $id); + throw new \Exception("Data Not able to Deleted"); + } + } + } catch (\Exception $e) { + $this->logger->error("Book: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine()); + session()->setFlashdata('error', 'Message: ' . $e->getMessage()); } - - $data['isactive'] = 0; - $data['updated_by'] = $session_uid; - $BooksModel->update($id, $data); return redirect()->route('book_list'); } + } diff --git a/app/Models/BooksModel.php b/app/Models/BooksModel.php index 80dfc8d6..4a7d9ca2 100644 --- a/app/Models/BooksModel.php +++ b/app/Models/BooksModel.php @@ -58,4 +58,22 @@ class BooksModel extends Model return $books; } +public function getData($table, $where = null,$whereIn = null) +{ + $query = $this->db->table($table); + if ($where) { + $query->where($where); + } + if($whereIn){ + // $query->whereIn($column_name,$missingValues) + $query->whereIn($whereIn[0],$whereIn[1]); + } + return $query->get()->getResult(); +} + +public function inactiveMissingDetails($table_name,$where,$whereIn){ + $dataToUpdate = ['isactive' => 0]; + $this->db->table($table_name)->where($where)->whereIn($whereIn[0],$whereIn[1])->update($dataToUpdate); +} + } diff --git a/app/Models/CustomerModel.php b/app/Models/CustomerModel.php index 79a7a894..7afe40a5 100644 --- a/app/Models/CustomerModel.php +++ b/app/Models/CustomerModel.php @@ -9,11 +9,8 @@ class CustomerModel extends Model { protected $table = 'customers'; protected $primaryKey = 'customer_id '; -<<<<<<< HEAD - protected $allowedFields = ['customer_id ','first_name','city','last_name','email','mobile_no','country','state','postal_code' ,'address','profile_picture','date_of_birth','gender','mode','isactive','business_id']; -======= + // protected $allowedFields = ['customer_id ','first_name','city','last_name','email','mobile_no','country','state','postal_code' ,'address','profile_picture','date_of_birth','gender','mode','isactive','business_id']; protected $allowedFields = ['customer_id ','first_name','city','last_name','email','mobile_no','country','state','postal_code' ,'address','profile_picture','date_of_birth','gender','mode','type','isactive','business_id','created_by','updated_by']; ->>>>>>> caaaaa0ffd2a11af5f49570cb1fadb521e89b52f public function insertCustomer($data) { diff --git a/app/Views/book_form.php b/app/Views/book_form.php index 6bef9284..20499904 100644 --- a/app/Views/book_form.php +++ b/app/Views/book_form.php @@ -53,7 +53,7 @@
- +
Please provide.
@@ -83,7 +83,7 @@
- +
diff --git a/app/Views/book_list.php b/app/Views/book_list.php index 28e8b58e..deb249e5 100644 --- a/app/Views/book_list.php +++ b/app/Views/book_list.php @@ -7,6 +7,24 @@

+ getFlashdata('success') || session()->getFlashdata('error')) : ?> + getFlashdata('success')) : ?> + + + getFlashdata('error')) : ?> + + +
From f726377124a7b67f497fb6009912fabe09964364 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Fri, 13 Oct 2023 16:38:19 +0530 Subject: [PATCH 2/6] Scheme Message : ps --- app/Controllers/Books.php | 5 +- app/Controllers/Scheme.php | 117 ++++++++++++++++++++++--------------- app/Models/BooksModel.php | 16 +++-- app/Models/SchemeModel.php | 29 ++++++++- app/Views/scheme_list.php | 18 ++++++ 5 files changed, 131 insertions(+), 54 deletions(-) diff --git a/app/Controllers/Books.php b/app/Controllers/Books.php index 5a165bfb..97ba44b5 100755 --- a/app/Controllers/Books.php +++ b/app/Controllers/Books.php @@ -120,7 +120,6 @@ class Books extends BaseController if (empty($book_id)) { // It's an insert operation $data['isactive'] = 1; - $data['category'] = 1; $data['created_by'] = $session_uid; if ($BooksModel->insert($data)) { session()->setFlashdata('success', 'Book has been added successfully.'); @@ -172,7 +171,7 @@ class Books extends BaseController $this->logger->Info("BOOK: Images Going to Inactived = ".implode(" ",$bookImgIds)); $inactive_img_whereIn[0] = 'book_img_id'; $inactive_img_whereIn[1] = $bookImgIds; - $BooksModel->inactiveMissingDetails('book_images',$where, $inactive_img_whereIn); + $BooksModel->inactiveMissingDetails('book_images',$data,$where, $inactive_img_whereIn); } } $activeBookCategory = $BooksModel->getData('book_categories', $where); @@ -184,7 +183,7 @@ class Books extends BaseController $this->logger->Info("BOOK: Categories Going to Inactived = ".implode(" ",$bookCategoryIds)); $inactive_category_whereIn[0] = 'id'; $inactive_category_whereIn[1] = $bookCategoryIds; - $BooksModel->inactiveMissingDetails('book_categories',$where, $inactive_category_whereIn); + $BooksModel->inactiveMissingDetails('book_categories',$data,$where, $inactive_category_whereIn); } } diff --git a/app/Controllers/Scheme.php b/app/Controllers/Scheme.php index 91ede95e..665767f2 100644 --- a/app/Controllers/Scheme.php +++ b/app/Controllers/Scheme.php @@ -57,6 +57,7 @@ class Scheme extends BaseController ## For inserting/updating details of scheme public function insert_scheme() { + try{ helper('session'); $session_bid = get_business_id(); $session_uid = get_logged_user_id(); @@ -76,30 +77,32 @@ class Scheme extends BaseController if (empty($scheme_id)) { // It's an insert operation $data['isactive'] = 1; - $data['created_by'] = $session_uid; - $SchemeModel->insert($data); - // $last_inserted_id = 100; - $last_inserted_id = $SchemeModel->insertID(); - - // Retrieve the category name 'membership' - $category_name = 'membership'; - - // Find the category ID for 'membership' from the category table - $db = db_connect(); - $category = $db->table('category') - ->select('id') - ->where('name', $category_name) - ->get() - ->getRow(); - - // Check if the category exists - if ($category) { - // Insert data into book_categories table - $db->table('book_categories')->insert([ - 'book_id' => $last_inserted_id, - 'category_id' => $category->id - ]); + if ($SchemeModel->insert($data)) { + $last_inserted_id = $SchemeModel->insertID(); + // Retrieve the category name 'membership' + $category_name = 'membership'; + // Find the category ID for 'membership' from the category table + $db = db_connect(); + $category = $db->table('category') + ->select('id') + ->where('name', $category_name) + ->get() + ->getRow(); + // Check if the category exists + if ($category) { + // Insert data into book_categories table + $db->table('book_categories')->insert([ + 'book_id' => $last_inserted_id, + 'category_id' => $category->id, + 'created_by' => $session_uid + ]); + } + session()->setFlashdata('success', 'Scheme has been added successfully.'); + $this->logger->info("Scheme: has been added successfully. Inserted ID = " . $last_inserted_id); + } else { + session()->setFlashdata('error', 'Scheme could not be added. Please try again..'); + $this->logger->error("Scheme: Err could not be added. Please try again."); } } else { @@ -107,37 +110,59 @@ class Scheme extends BaseController $isactive = $this->request->getPost('isactive'); $data['isactive'] = ($isactive == 'on') ? 1 : 0; $data['updated_by'] = $session_uid; - $SchemeModel->update($scheme_id, $data); + if ($SchemeModel->update($scheme_id, $data)) { + session()->setFlashdata('success', 'Scheme has been updated successfully.'); + $this->logger->info("Scheme: has been updated successfully. Updated Scheme ID = " . $scheme_id); + } else { + session()->setFlashdata('error', 'Scheme update failed. Please try again.'); + $this->logger->error("Scheme: Err Failed to update ID =" . $scheme_id); + } } + } catch (\Exception $e) { + $this->logger->error("Scheme: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine()); + session()->setFlashdata('error', 'Message: ' . $e->getMessage()); + } return redirect()->route('scheme_list'); } ## For delete the Scheme details (Which means inactive the details) public function delete_scheme($id) { - $SchemeModel = new SchemeModel(); - - // Check if the business ID exists - $existingScheme = $SchemeModel->find($id); - - if (!$existingScheme) { - // return redirect()->to(base_url('Business/index'))->with('error', 'Business not found.'); - return redirect()->route('scheme_list'); + try { + helper('session'); + $session_uid = get_logged_user_id(); + $SchemeModel = new SchemeModel(); + $where = ['book_id' => (int)$id, 'isactive =' => 1]; + // $existingScheme = $SchemeModel->find($id); + $existingScheme = $SchemeModel->where($where)->find($id); + if ($existingScheme) { + $this->logger->Info("Scheme: Going to Inactive ID = ".$id); + $data = ['isactive' => 0 , 'updated_by' => $session_uid]; + if ($SchemeModel->update($id, $data)) { + $activeSchemeCategory = $SchemeModel->getData('book_categories', $where); + if(!empty($activeSchemeCategory)){ + for ($z = 0; $z < count($activeSchemeCategory); $z++) { + $SchemeCategoryIds[$z] = $activeSchemeCategory[$z]->id; + } + if(!empty($SchemeCategoryIds)){ + $this->logger->Info("Scheme: Categories Going to Inactived = ".implode(" ",$SchemeCategoryIds)); + $inactive_category_whereIn[0] = 'id'; + $inactive_category_whereIn[1] = $SchemeCategoryIds; + $SchemeModel->inactiveMissingDetails('book_categories',$data,$where, $inactive_category_whereIn); + } + } + + session()->setFlashdata('success', 'Deleted successfully.'); + $this->logger->info("Scheme: has been Inactived successfully. Inactived ID = " . $id); + } else { + $this->logger->error("Scheme: Not able to Inactive ID =" . $id); + throw new \Exception("Data Not able to Deleted"); + } + } + } catch (\Exception $e) { + $this->logger->error("Scheme: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine()); + session()->setFlashdata('error', 'Message: ' . $e->getMessage()); } - - helper('session'); - $session_uid = get_logged_user_id(); - // Delete the business record - $data['isactive'] = 0; - $data['updated_by'] = $session_uid; - //echo 'id='.$id; - print_r($data); - //die(); - $SchemeModel->update($id, $data); - // print_r($data);die(); - //$BusinessModel->delete($id); - - // return redirect()->to(base_url('Business/index'))->with('success', 'Business deleted successfully.'); return redirect()->route('scheme_list'); } } diff --git a/app/Models/BooksModel.php b/app/Models/BooksModel.php index 4a7d9ca2..98a6211d 100644 --- a/app/Models/BooksModel.php +++ b/app/Models/BooksModel.php @@ -71,9 +71,17 @@ public function getData($table, $where = null,$whereIn = null) return $query->get()->getResult(); } -public function inactiveMissingDetails($table_name,$where,$whereIn){ - $dataToUpdate = ['isactive' => 0]; - $this->db->table($table_name)->where($where)->whereIn($whereIn[0],$whereIn[1])->update($dataToUpdate); -} + public function inactiveMissingDetails($table_name,$dataToUpdate,$where = null,$whereIn = null) + { + $this->db->table($table_name); + $query = $this->db->table($table_name); + if ($where) { + $query->where($where); + } + if ($whereIn) { + $query->whereIn($whereIn[0], $whereIn[1]); + } + return $query->update($dataToUpdate); + } } diff --git a/app/Models/SchemeModel.php b/app/Models/SchemeModel.php index 513bc406..ab3e1fa5 100644 --- a/app/Models/SchemeModel.php +++ b/app/Models/SchemeModel.php @@ -9,7 +9,7 @@ class SchemeModel extends Model { protected $table = 'books'; protected $primaryKey = 'book_id'; - protected $allowedFields = ['book_id ','title','sku','description','price','features','duration','business_id','updated_by','category','isactive']; + protected $allowedFields = ['book_id ','title','sku','description','price','features','duration','business_id','updated_by','category','isactive','created_by']; public function insertScheme($data) { @@ -25,6 +25,7 @@ class SchemeModel extends Model $builder->join('category', 'category.id = book_categories.category_id', 'left'); $builder->where('books.business_id', $business_id); $builder->where('category.name', 'membership'); + $builder->where('books.isactive', 1); $query = $builder->get(); @@ -109,6 +110,32 @@ public function getAllSchemes() { return $this->findAll(); } + + public function getData($table, $where = null, $whereIn = null) + { + $query = $this->db->table($table); + if ($where) { + $query->where($where); + } + if ($whereIn) { + // $query->whereIn($column_name,$missingValues) + $query->whereIn($whereIn[0], $whereIn[1]); + } + return $query->get()->getResult(); + } + + public function inactiveMissingDetails($table_name,$dataToUpdate,$where = null,$whereIn = null) + { + $this->db->table($table_name); + $query = $this->db->table($table_name); + if ($where) { + $query->where($where); + } + if ($whereIn) { + $query->whereIn($whereIn[0], $whereIn[1]); + } + return $query->update($dataToUpdate); + } } diff --git a/app/Views/scheme_list.php b/app/Views/scheme_list.php index 8f25239f..372adbbe 100644 --- a/app/Views/scheme_list.php +++ b/app/Views/scheme_list.php @@ -7,6 +7,24 @@

+ getFlashdata('success') || session()->getFlashdata('error')) : ?> + getFlashdata('success')) : ?> + + + getFlashdata('error')) : ?> + + +
From 628d77a6db2ebcd31af36deca583a1d988a8506b Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Fri, 13 Oct 2023 18:22:54 +0530 Subject: [PATCH 3/6] Api Invoice Adress issues 1 : ps --- app/Controllers/ApiIntegration.php | 4 ++-- app/Views/invoice_form.php | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/Controllers/ApiIntegration.php b/app/Controllers/ApiIntegration.php index a78d5aae..33645835 100644 --- a/app/Controllers/ApiIntegration.php +++ b/app/Controllers/ApiIntegration.php @@ -719,14 +719,14 @@ class ApiIntegration extends ResourceController if (count($billing_array) > 0) { foreach ($billing_array as $bill) { if($bill->first_name != ""){ - $billing_addr = "".$bill->address_1 .",". $bill->address_2 ."
".$bill->city." ".$bill->postcode."
".$bill->state." ".$bill->country.".
"; + $billing_addr = $bill->address_1 . " " . $bill->address_2 . ",\n" . $bill->city . ",\n" . $bill->state . " - " . $bill->postal_code . ",\n" . $bill->country . "."; } } } if (count($shipping_array) > 0) { foreach ($shipping_array as $ship) { if($ship->first_name != ""){ - $shipping_addr = "".$ship->address_1 .",". $ship->address_2 ."
".$ship->city." ".$ship->postcode."
".$ship->state." ".$ship->country.".
"; + $shipping_addr = $ship->address_1 . " " . $ship->address_2 . ",\n" . $ship->city . ",\n" . $ship->state . " - " . $ship->postal_code . ",\n" . $ship->country . "."; } } } diff --git a/app/Views/invoice_form.php b/app/Views/invoice_form.php index 9eeece37..6559c9cf 100644 --- a/app/Views/invoice_form.php +++ b/app/Views/invoice_form.php @@ -45,12 +45,12 @@ -
-
@@ -644,8 +644,7 @@ $(document).ready(function() { customer_billing = ""; if (cb.length > 0) { $.each(cb, function(k, v) { - customer_billing = v.address_1 + "," + v.address_2 + "," + v.city + - "," + v.state + "," + v.country + "." + v.postal_code + customer_billing = v.address_1 + " " + v.address_2 + ",\n" + v.city + ",\n" + v.state + " - "+v.postal_code+",\n"+ v.country +"." customer_billing_id = v.customer_address_id }); } @@ -703,8 +702,7 @@ $(document).ready(function() { customer_shipping = ""; if (cs.length > 0) { $.each(cs, function(k, v) { - customer_shipping = v.address_1 + "," + v.address_2 + "," + v.city + - "," + v.state + "," + v.country + "." + v.postal_code + customer_shipping = v.address_1 + " " + v.address_2 + ",\n" + v.city + ",\n" + v.state + " - "+v.postal_code+",\n"+ v.country +"." }); } // console.log(customer_shipping); From bc6041b89d8639cd9db8c7c4993cfb8391d9ccd9 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Fri, 13 Oct 2023 19:35:47 +0530 Subject: [PATCH 4/6] Api created by Updated by : ps --- app/Controllers/ApiIntegration.php | 52 +++++++++++++++++++++++------- app/Models/ApiIntegrationModel.php | 18 +++++++++-- 2 files changed, 56 insertions(+), 14 deletions(-) diff --git a/app/Controllers/ApiIntegration.php b/app/Controllers/ApiIntegration.php index 33645835..52f521f0 100644 --- a/app/Controllers/ApiIntegration.php +++ b/app/Controllers/ApiIntegration.php @@ -11,6 +11,24 @@ class ApiIntegration extends ResourceController { use ResponseTrait; + private $global_variable_business_id; + private $global_variable_user_id; + private $global_variable_user_name; + private $global_variable_role; + + public function __construct() + { + $this->global_variable_business_id = 1; + $this->global_variable_role = "online"; + $api_model = new ApiIntegrationModel(); + $table = 'users'; + $where = ['role'=>$this->global_variable_role,'business_id'=>(int)$this->global_variable_business_id]; + $existing_data = $api_model->getData($table, $where); + $this->global_variable_user_id = isset($existing_data[0]->user_id) ? (int)$existing_data[0]->user_id : NULL; + $this->global_variable_user_name = isset($existing_data[0]->user_id) ? $existing_data[0]->first_name." ".$existing_data[0]->last_name : NULL; + $this->logger->info("Api Integration : User = ".$this->global_variable_user_name); + } + public function api_integration($api_request_text) { $this->logger->info("Api Integration : Request Text = ".$api_request_text); try { @@ -142,6 +160,7 @@ class ApiIntegration extends ResourceController $primary_key_id = (int)$existing_data[0][$table_column[0]]; $this->logger->info("Api CallMethods : ".$table." its PrimaryKey ID = ".$primary_key_id); $inactive_data['isactive'] = 0; + $inactive_data['updated_by'] = $this->global_variable_user_id; $update_where = ['isactive' => 1, $table_column[0] => $primary_key_id]; $api_model->updateData($table, $inactive_data, $update_where); $get_existing_child_details = $api_model->getData($table_child, $update_where); @@ -253,9 +272,10 @@ class ApiIntegration extends ResourceController $book_data['price'] = (isset($records['sale_price']) && $records['sale_price'] != '') ? $records['sale_price'] : ((isset($records['regular_price']) && $records['regular_price'] != '') ? $records['regular_price'] : ((isset($records['price']) && $records['price'] != '') ? $records['price'] : NULL)); $book_data['sku'] = isset($records['sku']) ? $records['sku'] : NULL; $book_data['isactive'] = (isset($records['status']) && strtolower($records['status']) === "publish") ? 1 : 0; - $book_data['business_id'] = 1; + $book_data['business_id'] = $this->global_variable_business_id; $images = $records['images']; if ((int)$countAll == 0) { + $book_data['created_by'] = $this->global_variable_user_id; $insert_result = $api_model->insertData('books', $book_data); $last_insert_book_id = $insert_result['info']; $extensive_correspondence .= $insert_result['info'] ? "Book id : " . $insert_result['info'] @@ -265,6 +285,7 @@ class ApiIntegration extends ResourceController $insert_result['err'] ? $this->logger->error("Api SaveBookDetails : Err = ".$insert_result['err']):""; } else { $last_insert_book_id = $book_id; + $book_data['updated_by'] = $this->global_variable_user_id; /** Draft status means entry must but inactive. publish means active that's why comment here * $book_where = ['book_id' => $book_id, 'isactive' => 1, 'wp_api_product_id' => $wordpress_book_id]; **/ @@ -310,7 +331,8 @@ class ApiIntegration extends ResourceController $inactive_where = ['isactive' => 1, 'book_id' => (int)$last_insert_book_id]; $inactive_whereIn[0] = 'wp_api_img_id'; $inactive_whereIn[1] = $missingValues; - $api_model->inactiveMissingDetails('book_images', $inactive_where, $inactive_whereIn); + $data_to_batch_update = ['isactive' => 0,'updated_by'=>$this->global_variable_user_id]; + $api_model->inactiveMissingDetails('book_images',$data_to_batch_update, $inactive_where, $inactive_whereIn); } } } @@ -401,7 +423,8 @@ class ApiIntegration extends ResourceController $where2 = ['isactive' => 1]; $whereIn2[0] = 'category_id'; $whereIn2[1] = $book_categories_to_inactive; - $api_model->inactiveMissingDetails('book_categories', $where2, $whereIn2); + $data_to_batch_update2 = ['isactive' => 0,'updated_by'=>$this->global_variable_user_id]; + $api_model->inactiveMissingDetails('book_categories',$data_to_batch_update2, $where2, $whereIn2); //echo $api_model->getlastQuery(); } } // loop closed @@ -478,13 +501,14 @@ class ApiIntegration extends ResourceController $customer_data['email'] = $records['email']; $customer_data['profile_picture'] = $records['avatar_url']; $customer_data['wp_api_customer_id'] = $wordpress_customer_id; - $customer_data['mode'] = 'online'; - $customer_data['business_id'] = 1; + $customer_data['mode'] = $this->global_variable_role; + $customer_data['business_id'] = $this->global_variable_business_id; $billing = $records['billing']; $shipping = $records['shipping']; if ((int)$countAll == 0) { + $customer_data['created_by'] = $this->global_variable_user_id; $insert_result = $api_model->insertData('customers', $customer_data); $last_insert_customer_id = $insert_result['info']; $extensive_correspondence .= $insert_result['info'] ? "Customer id : " . $insert_result['info'] @@ -493,6 +517,7 @@ class ApiIntegration extends ResourceController $insert_result['info'] ? $this->logger->info("Api SaveCustomerDetails : Customer id = ".$insert_result['info']):""; $insert_result['err'] ? $this->logger->error("Api SaveCustomerDetails : Err = ".$insert_result['err']):""; } else { + $customer_data['updated_by'] = $this->global_variable_user_id; $last_insert_customer_id = $customer_id; $customer_where = ['customer_id' => $customer_id, 'isactive' => 1, 'wp_api_customer_id' => $wordpress_customer_id]; $update_result = $api_model->updateData('customers', $customer_data, $customer_where); @@ -545,7 +570,8 @@ class ApiIntegration extends ResourceController $inactive_where = ['isactive' => 1, 'customer_id' => (int)$last_insert_customer_id,'address_type'=>1]; $inactive_whereIn[0] = 'address_1'; $inactive_whereIn[1] = $missingBillingValues; - $api_model->inactiveMissingDetails('customer_addresses', $inactive_where, $inactive_whereIn); + $data_to_batch_update = ['isactive' => 0,'updated_by'=>$this->global_variable_user_id]; + $api_model->inactiveMissingDetails('customer_addresses',$data_to_batch_update, $inactive_where, $inactive_whereIn); } } } @@ -626,7 +652,8 @@ class ApiIntegration extends ResourceController $inactive_where = ['isactive' => 1, 'customer_id' => (int)$last_insert_customer_id, 'address_type'=>2]; $inactive_whereIn[0] = 'address_1'; $inactive_whereIn[1] = $missingShippingValues; - $api_model->inactiveMissingDetails('customer_addresses', $inactive_where, $inactive_whereIn); + $data_to_batch_update = ['isactive' => 0,'updated_by'=>$this->global_variable_user_id]; + $api_model->inactiveMissingDetails('customer_addresses',$data_to_batch_update, $inactive_where, $inactive_whereIn); $this->logger->info("Api SaveCustomerDetails : Missing Shipping " .implode(",",$missingShippingValues)." Are inactived"); } } @@ -762,7 +789,7 @@ class ApiIntegration extends ResourceController $invoice_data['order_number']=$records['order_key']; $invoice_data['payment_method']=$records['payment_method_title']; $invoice_data['event_id']=NULL; - $invoice_data['business_id']=1; + $invoice_data['business_id']=$this->global_variable_business_id; $invoice_data['shipping_address']=$shipping_addr; $invoice_data['shipping_address_id']=NULL; $invoice_data['billing_address']=$billing_addr; @@ -772,6 +799,7 @@ class ApiIntegration extends ResourceController $invoice_data['invoice_type'] = 1; if ((int)$countAll == 0) { + $invoice_data['created_by'] = $this->global_variable_user_id; $insert_result = $api_model->insertData('invoice', $invoice_data); $last_insert_invoice_id = $insert_result['info']; $extensive_correspondence .= $insert_result['info'] ? "Invoice id : " . $insert_result['info'] @@ -782,6 +810,7 @@ class ApiIntegration extends ResourceController } else { $last_insert_invoice_id = $invoice_id; $customer_where = ['invoice_id' => $invoice_id, 'isactive' => 1, 'wp_api_order_id' => $wordpress_order_id]; + $invoice_data['updated_by'] = $this->global_variable_user_id; $update_result = $api_model->updateData('invoice', $invoice_data, $customer_where); $extensive_correspondence .= $update_result['info'] ? "Invoice id : " . $last_insert_invoice_id . " ( " . $update_result['info'] . ")" : " ( Err :" . $update_result['err'] . ")"; @@ -829,7 +858,8 @@ class ApiIntegration extends ResourceController $inactive_where = ['isactive' => 1, 'invoice_id' => (int)$last_insert_invoice_id]; $inactive_whereIn[0] = 'wp_api_line_items_id'; $inactive_whereIn[1] = $missingValues; - $api_model->inactiveMissingDetails('invoiceitems', $inactive_where, $inactive_whereIn); + $data_to_batch_update = ['isactive' => 0,'updated_by'=>$this->global_variable_user_id]; + $api_model->inactiveMissingDetails('invoiceitems',$data_to_batch_update, $inactive_where, $inactive_whereIn); } } } @@ -890,7 +920,7 @@ class ApiIntegration extends ResourceController $subscription_data[$x]['from_subscription'] = $fromDate; $subscription_data[$x]['to_subscription'] = $toDate; $subscription_data[$x]['mode'] = $result_book_category[$x]['category_name']; - $subscription_data[$x]['business_id']=1; + $subscription_data[$x]['business_id']=$this->global_variable_business_id; $this->logger->info("Api SaveSalesDetails : Subscription Data inx = $x Request data = ".json_encode($subscription_data)); } } @@ -1089,7 +1119,7 @@ class ApiIntegration extends ResourceController $book_category_data[$a]['id'] = $masterCategoryId; $book_category_data[$a]['name'] = $r->name; $book_category_data[$a]['wp_api_category_id'] = $r->id; - $book_category_data[$a]['business_id'] = 1; + $book_category_data[$a]['business_id'] = $this->global_variable_business_id; $book_category_data[$a]['parent_wp_api_category_id'] = NULL; $a++; $this->logger->info("Api SaveCategoriesMasterDetails : Categories Data = $a Request data to save on master category = " . json_encode($book_category_data)); diff --git a/app/Models/ApiIntegrationModel.php b/app/Models/ApiIntegrationModel.php index b7e3f066..1312a41a 100644 --- a/app/Models/ApiIntegrationModel.php +++ b/app/Models/ApiIntegrationModel.php @@ -83,9 +83,21 @@ class ApiIntegrationModel extends Model return $text; } - public function inactiveMissingDetails($table_name,$where,$whereIn){ - $dataToUpdate = ['isactive' => 0]; - $this->db->table($table_name)->where($where)->whereIn($whereIn[0],$whereIn[1])->update($dataToUpdate); + // public function inactiveMissingDetails($table_name,$where,$whereIn){ + // $dataToUpdate = ['isactive' => 0]; + // $this->db->table($table_name)->where($where)->whereIn($whereIn[0],$whereIn[1])->update($dataToUpdate); + // } + public function inactiveMissingDetails($table_name,$dataToUpdate,$where = null,$whereIn = null) + { + $this->db->table($table_name); + $query = $this->db->table($table_name); + if ($where) { + $query->where($where); + } + if ($whereIn) { + $query->whereIn($whereIn[0], $whereIn[1]); + } + $query->update($dataToUpdate); } public function getBookCategories($product_id){ From 77d56c076d8b21da96b55f5e49cb209007c7a851 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Mon, 16 Oct 2023 15:13:34 +0530 Subject: [PATCH 5/6] api Shipping Address Detils : ps --- app/Controllers/ApiIntegration.php | 100 +++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 18 deletions(-) diff --git a/app/Controllers/ApiIntegration.php b/app/Controllers/ApiIntegration.php index 52f521f0..a533b1cf 100644 --- a/app/Controllers/ApiIntegration.php +++ b/app/Controllers/ApiIntegration.php @@ -26,10 +26,10 @@ class ApiIntegration extends ResourceController $existing_data = $api_model->getData($table, $where); $this->global_variable_user_id = isset($existing_data[0]->user_id) ? (int)$existing_data[0]->user_id : NULL; $this->global_variable_user_name = isset($existing_data[0]->user_id) ? $existing_data[0]->first_name." ".$existing_data[0]->last_name : NULL; - $this->logger->info("Api Integration : User = ".$this->global_variable_user_name); } public function api_integration($api_request_text) { + $this->logger->info("Api Integration : UID = ".$this->global_variable_user_id." * ".$this->global_variable_user_name); $this->logger->info("Api Integration : Request Text = ".$api_request_text); try { $request_data = $this->request->getVar(); @@ -742,20 +742,30 @@ class ApiIntegration extends ResourceController if(isset($records['billing']) && gettype($records['billing']) === 'object') {$billing_array = [$records['billing']];} if(isset($records['shipping']) && gettype($records['shipping']) === 'object') {$shipping_array = [$records['shipping']];} - + $where = ['wp_api_customer_id' => (int)$records['customer_id'], 'isactive' => 1]; + $local_customer = $api_model->getData('customers', $where); + $local_customer_id = !empty($local_customer) ? $local_customer[0]->customer_id : NULL; + $this->logger->info((!empty($local_customer)) ? "Api SaveSalesDetails : in wordpress customer ref ID = ".$records['customer_id']." is available on Customer table and its PrimaryKey = ".$local_customer_id."(local customer id)" : "Api SaveSalesDetails : in wordpress customer ref ID = ".$records['customer_id']." Not available on Customer table"); + if (count($billing_array) > 0) { - foreach ($billing_array as $bill) { - if($bill->first_name != ""){ - $billing_addr = $bill->address_1 . " " . $bill->address_2 . ",\n" . $bill->city . ",\n" . $bill->state . " - " . $bill->postal_code . ",\n" . $bill->country . "."; - } - } + // foreach ($billing_array as $bill) { + // if($bill->first_name != ""){ + // $billing_addr = $bill->address_1 . " " . $bill->address_2 . ",\n" . $bill->city . ",\n" . $bill->state . " - " . $bill->postal_code . ",\n" . $bill->country . "."; + // } + // } + $result_billing_addr = $this->save_invoice_address_in_customer_address($billing_array,1,(int)$local_customer_id); + $billing_addr_id = $result_billing_addr['addr_id']; + $billing_addr = $result_billing_addr['addr']; } if (count($shipping_array) > 0) { - foreach ($shipping_array as $ship) { - if($ship->first_name != ""){ - $shipping_addr = $ship->address_1 . " " . $ship->address_2 . ",\n" . $ship->city . ",\n" . $ship->state . " - " . $ship->postal_code . ",\n" . $ship->country . "."; - } - } + // foreach ($shipping_array as $ship) { + // if($ship->first_name != ""){ + // $shipping_addr = $ship->address_1 . " " . $ship->address_2 . ",\n" . $ship->city . ",\n" . $ship->state . " - " . $ship->postal_code . ",\n" . $ship->country . "."; + // } + // } + $result_shipping_addr = $this->save_invoice_address_in_customer_address($shipping_array,2,(int)$local_customer_id); + $shipping_addr_id = $result_shipping_addr['addr_id']; + $shipping_addr = $result_shipping_addr['addr']; } if (count($records['line_items']) > 0) { @@ -771,9 +781,7 @@ class ApiIntegration extends ResourceController $subtotal = $lineitems_subtotal + (float)$records['shipping_total']; $tax = $lineitems_tax + (float)$records['shipping_tax']; $total = ($lineitems_total)+(float)$records['shipping_total'] + (float)$records['shipping_tax']; - $where = ['wp_api_customer_id' => (int)$records['customer_id'], 'isactive' => 1]; - $local_customer = $api_model->getData('customers', $where); - $local_customer_id = !empty($local_customer) ? $local_customer[0]->customer_id : ""; + $invoice_data['invoice_id']=$invoice_id; $invoice_data['invoice_number']=$records['number']; @@ -791,13 +799,12 @@ class ApiIntegration extends ResourceController $invoice_data['event_id']=NULL; $invoice_data['business_id']=$this->global_variable_business_id; $invoice_data['shipping_address']=$shipping_addr; - $invoice_data['shipping_address_id']=NULL; + $invoice_data['shipping_address_id']=$shipping_addr_id; $invoice_data['billing_address']=$billing_addr; - $invoice_data['billing_address_id'] =NULL; + $invoice_data['billing_address_id'] =$billing_addr_id; $invoice_data['shipping_charge'] = isset($records['shipping_total'])?$records['shipping_total']:NULL; $invoice_data['notes'] = isset($records['customer_note'])?$records['customer_note']:NULL; $invoice_data['invoice_type'] = 1; - if ((int)$countAll == 0) { $invoice_data['created_by'] = $this->global_variable_user_id; $insert_result = $api_model->insertData('invoice', $invoice_data); @@ -1131,4 +1138,61 @@ class ApiIntegration extends ResourceController $this->logger->error("Api SaveCategoriesMasterDetails : Err = Categories Data Not Found"); } } + + public function save_invoice_address_in_customer_address($request_addr_array,$flag,$customer_id){ + $this->logger->info("Api saveInvoiceAddressInCustomerAddress = ".json_encode($request_addr_array)); + $this->logger->info("Api saveInvoiceAddressInCustomerAddress Flag = ".$flag." Customer Id = ".$customer_id); + $api_model = new ApiIntegrationModel(); + $where = ['customer_id' =>$customer_id,'address_type'=>$flag, + 'first_name'=>$request_addr_array[0]->first_name,'last_name'=>$request_addr_array[0]->last_name, + 'address_1'=>$request_addr_array[0]->address_1,'address_2'=>$request_addr_array[0]->address_2, + 'city'=>$request_addr_array[0]->city,'state'=>$request_addr_array[0]->state, + 'postal_code'=>$request_addr_array[0]->postcode]; + $existing_addr = $api_model->getData('customer_addresses', $where); + $this->logger->info("Api saveInvoiceAddressInCustomerAddress Count = ".count($existing_addr)); + $final_array['addr_id'] = NULL; + $final_array['addr'] = NULL; + + $addr_data = []; + + if (!empty($existing_addr)) { + $final_array['addr_id'] = isset($existing_addr) && !empty($existing_addr) ? $existing_addr[0]->customer_address_id : NULL; + $this->logger->info("Api saveInvoiceAddressInCustomerAddress Ex Addr id = ".$final_array['addr_id']); + if($existing_addr[0]->first_name != ""){ + $final_array['addr'] = $existing_addr[0]->address_1 . " " . $existing_addr[0]->address_2 . ",\n" . $existing_addr[0]->city . ",\n" . $existing_addr[0]->state . " - " . $existing_addr[0]->postal_code . ",\n" . $existing_addr[0]->country . "."; + } + $this->logger->info("Api saveInvoiceAddressInCustomerAddress Ex Addr = ".$final_array['addr']); + } + if (empty($existing_addr)) { + foreach ($request_addr_array as $addr) { + if($addr->first_name != ""){ + $addr_data['first_name'] = $addr->first_name; + $addr_data['last_name'] = $addr->last_name; + $addr_data['company'] = $addr->company; + $addr_data['address_1'] = $addr->address_1; + $addr_data['address_2'] = $addr->address_2; + $addr_data['city'] = $addr->city; + $addr_data['state'] = $addr->state; + $addr_data['country'] = $addr->country; + $addr_data['postal_code'] = $addr->postcode; + $addr_data['email'] = isset($addr->email)? $addr->email:""; + $addr_data['mobile_no'] = isset($addr->phone)?$addr->phone:""; + $addr_data['customer_id'] = $customer_id; + $addr_data['address_type'] = $flag; + $addr_data['customer_address_id'] = NULL; + $addr_data['created_by'] = $this->global_variable_user_id; + $final_array['addr'] = $addr->address_1 . " " . $addr->address_2 . ",\n" . $addr->city . ",\n" . $addr->state . " - " . $addr->postcode . ",\n" . $addr->country . "."; + } + } + $this->logger->info("Api saveInvoiceAddressInCustomerAddress New Addr = ".$final_array['addr']); + if(!empty($addr_data)){ + + $insert_result = $api_model->insertData('customer_addresses',$addr_data); + $final_array['addr_id'] = $insert_result['info']; + $this->logger->info("Api saveInvoiceAddressInCustomerAddress New Addr id = ".$final_array['addr_id']); + } + + } + return $final_array; + } } \ No newline at end of file From f67028962d9527cd21dcfe6d48b087997f277959 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 18 Oct 2023 17:46:37 +0530 Subject: [PATCH 6/6] Dashboard + due date mail : ps --- app/Controllers/Home.php | 7 + app/Controllers/Invoice.php | 24 +- app/Controllers/Notifications.php | 67 +++++- app/Models/HomeModel.php | 67 ++++++ app/Models/InvoiceModel.php | 2 +- app/Models/NotificationModel.php | 40 +++- app/Views/approve_template.php | 12 +- app/Views/dashboard.php | 378 ++++++++++++++++++++++++------ public/uploads/avatar.png | Bin 24988 -> 5786 bytes 9 files changed, 505 insertions(+), 92 deletions(-) mode change 100755 => 100644 public/uploads/avatar.png diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index db71d573..917b2eda 100644 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -22,6 +22,13 @@ class Home extends BaseController $model = new HomeModel(); $data['customer'] = $model->customers($where); $data['customer']['label'] = "Customer"; + $data['invoice'] = $model->invoice(); + $data['active_category'] = $model->schemes(); + $data['expiring_membership'] = $model->expiring_membership_list(); + // $data['active_category'] = array_filter($model->schemes(), function ($element) { + // return $element['count'] !== '0' ; + // }); + $data['book_published'] = $model->book_published_list(); $this->render_page('dashboard', $data); } diff --git a/app/Controllers/Invoice.php b/app/Controllers/Invoice.php index f1f53f51..fbadc66e 100644 --- a/app/Controllers/Invoice.php +++ b/app/Controllers/Invoice.php @@ -432,6 +432,13 @@ class Invoice extends BaseController $tax = ""; $total_amount = ""; $payment_method = ""; + $business_name= ""; + $business_address= ""; + $business_city= ""; + $business_state= ""; + $business_postal_code= ""; + $business_email= ""; + $business_mobile_no= ""; if (isset($details)) { $this->logger->info("Invoice: approve notification Request data type = ".gettype($details)); } @@ -449,6 +456,13 @@ class Invoice extends BaseController $tax = $rec['tax']; $total_amount = $rec['total_amount']; $payment_method = $rec['payment_method']; + $business_name= $rec['business_name']; + $business_address= $rec['business_address']; + $business_city= $rec['business_city']; + $business_state= $rec['business_state']; + $business_postal_code= $rec['business_postal_code']; + $business_email= $rec['business_email']; + $business_mobile_no= $rec['business_mobile_no']; } $records['invoice_order_number'] = $reference_number; $records['invoice_serial_number'] = $invoice_serial_number; @@ -479,12 +493,12 @@ class Invoice extends BaseController

Best regards,

    -
  • VijayaBharathamBooks,
  • -
  • Sri Kasi, 12, M.V. Naidu Street, Chetpet, Chennai.
  • -
  • Call Us: +91 89391 49466
  • -
  • Email Us: contact@vijayabharathambooks.com
  • "; +
  • ".$business_name.",
  • +
  • ".$business_address." ".$business_city." ".$business_state." - ".$business_postal_code."
  • +
  • Call Us: +91 ".$business_mobile_no."
  • +
  • Email Us: ".$business_email."
  • "; - $template = "Dear " . $recipient_name . ",\r\r\n\nYour Invoice has been approved.\n\nDetails:\r\n- Approval Date: " . $approval_date . "\r\n- Approved By: " . $approved_by . "\r\n- Reference ID: " . $reference_number . "\r\n\nBest regards,\nVijayaBharathamBooks,\nSri Kasi, 12, M.V. Naidu Street, Chetpet, Chennai.\nCall Us: +91 89391 49466\nEmail Us: contact@vijayabharathambooks.com"; + $template = "Dear " . $recipient_name . ",\r\r\n\nYour Invoice has been approved.\n\nDetails:\r\n- Approval Date: " . $approval_date . "\r\n- Approved By: " . $approved_by . "\r\n- Reference ID: " . $reference_number . "\r\n\nBest regards,\n".$business_name.",\n".$business_address." ".$business_city." ".$business_state." - ".$business_postal_code.".\nCall Us: +91 ".$business_mobile_no."\nEmail Us:".$business_email; $params = (object) Null; $params->number = (int)'91' . $recipient_mobile; diff --git a/app/Controllers/Notifications.php b/app/Controllers/Notifications.php index ca741efc..89d38483 100755 --- a/app/Controllers/Notifications.php +++ b/app/Controllers/Notifications.php @@ -3,12 +3,13 @@ namespace App\Controllers; use App\Helpers\NotificationHelper; +use App\Models\NotificationModel; class Notifications extends BaseController { ## Email Section : - public function mail_custom_notifications() + public function mail_custom_notificationsi() { $request = \Config\Services::request(); if ($request->is('post')) { @@ -70,4 +71,68 @@ class Notifications extends BaseController $data['page_name'] = 'Custom Notifications'; $this->render_page('notifications_form', $data); } + + // public function due_date_notifications() + public function mail_custom_notifications() + { + $model = new NotificationModel(); + $details = $model->getSubscriptionDueDetail(); + + $records = []; + $recipient_name = ""; + $recipient_email = ""; + $recipient_mobile = ""; + $subscription_name = ""; + $business_name= ""; + $to_subscription= ""; + if (isset($details)) { + $this->logger->info("Notification : Duedate notification Request data type = ".gettype($details)); + } + helper('notification'); + $notification = new NotificationHelper(); + foreach ($details as $rec) { + $recipient_name = $rec['customer_name']; + $recipient_email = $rec['customer_email']; + $recipient_mobile = $rec['customer_mobile']; + // $recipient_email = "sanjeev.p@venbainfotech.com"; + // $recipient_mobile = 6369084112; + $business_name= $rec['business_name']; + $subscription_name = $rec['title']; + $to_subscription= $rec['to_subscription']; + + } + $records['template_name'] = ''; + $records['recipient_name'] = $recipient_name; + $records['recipient_email'] = $recipient_email ? $recipient_email : "sanjeev.p@venbainfotech.com"; + $records['subject'] = $business_name ." - Due Date Reminder"; + $records['description'] = " + + Due Date Reminder + +

    Hello ".$recipient_name.",

    +

    This is a reminder that the following subscription is due soon:

    +

    Subscription Name:".$subscription_name."

    +

    Due Date: ".$to_subscription."

    +

    Please make sure to complete this subscription on time.

    +

    Thank you.

    + + "; + + $template = "Hello " . $recipient_name . ",\r\r\n\nThis is a reminder that the following subscription is due soon:\r\n- Subscription Name: " . $subscription_name . "\r\n Due Date: " . $to_subscription . "\r\n\nPlease make sure to complete this subscription on time.\n Thank you."; + + $params = (object) Null; + $params->number = (int)'91' . $recipient_mobile; + $params->type = "text"; + $params->message = $template; + $params->instance_id = WAAI_INSTANCE; + $params->access_token = WAAI_TOKEN; + $this->logger->info("Notification : Duedate notification Email Request data = ".json_encode($records)); + + $email_result = $notification->sendEmail($records); + $this->logger->info("Notification : Duedate notification Email Response = " . json_encode($email_result)); + $this->logger->info("Notification : Duedate notification Whatsapp Request data = ".json_encode($params)); + $whatsapp_result = $notification->sendWhatsAppMessage(SEND_WAAI_URL, "POST", $params); + $this->logger->info("Notification : Duedate notification Whatsapp Response = " . json_encode($whatsapp_result)); + + } } diff --git a/app/Models/HomeModel.php b/app/Models/HomeModel.php index 1b774092..4135c532 100644 --- a/app/Models/HomeModel.php +++ b/app/Models/HomeModel.php @@ -24,4 +24,71 @@ class HomeModel extends Model $customer['today'] = $todayCustomers; return $customer; } + + public function invoice() { + if (date('m') <= 3) { + $invoice['financial_year'] = (date('Y')-1) . '-' . date('Y'); + $start_date = (date('Y')-1).'-04-01'; + $end_date = date('Y').'-03-31'; + } else { + $invoice['financial_year'] = date('Y') . '-' . (date('Y') + 1); + $start_date = date('Y').'-04-01'; + $end_date = (date('Y')+1).'-03-31'; + } + $date_where = ['DATE(created_on)' => date('Y-m-d'),'isactive'=>1]; + $date_query = $this->db->table('invoice')->where($date_where)->countAllResults(); + $month_where = ['MONTH(created_on)' => date('m'),'isactive'=>1]; + $month_query = $this->db->table('invoice')->where($month_where)->countAllResults(); + $fin_year_where = ['DATE(created_on) >= ' => $start_date , 'DATE(created_on) <= ' => $end_date,'isactive'=>1]; + $fin_year_query = $this->db->table('invoice')->where($fin_year_where)->countAllResults(); + $invoice['today'] = $date_query; + $invoice['month'] = $month_query; + $invoice['year'] = $fin_year_query; + return $invoice; + } + + public function schemes(){ + $query = $this->db->table('category AS C') + ->select('C.id,C.name,LEFT(C.name, 1) AS first_letter, COUNT(S.customer_id) AS count') + ->join('subscription AS S', 'C.id = S.scheme_id', 'left') + ->where(['C.isactive'=>1,'C.business_id'=>1]) + ->groupBy('C.id, S.scheme_id'); + $results = $query->get()->getResultArray(); + return $results; + } + + public function expiring_membership_list(){ + $now = date('Y-m-d'); + $last30days = date('Y-m-d', strtotime('+30 days')); + + return $this->db->table('subscription as S') + ->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('CM.name, CONCAT(C.first_name, " ", C.last_name) as customer_name, C.email as customer_email, C.mobile_no as customer_mobile, S.sub_id, S.scheme_id, S.customer_id, S.from_subscription, S.to_subscription, S.business_id, S.to_subscription, S.from_subscription, BK.title, BK.book_id,DATEDIFF(S.to_subscription, CURDATE()) as countdays') + ->where('S.to_subscription >=', $now) + ->where('S.to_subscription <=', $last30days) + ->where('BC.category_id', 5) + ->groupBy('S.sub_id') + ->get() + ->getResultArray(); + } + + public function book_published_list(){ + $now = date('Y-m-d'); + $oneMonthAgo = date('Y-m-d', strtotime($now . ' -1 month')); + + return $this->db->table('books as B') + ->select("B.book_id, B.title, B.created_on, B.publisher, B.author, B.publication_date, DATE_FORMAT(B.publication_date, '%d-%m-%Y') as publication_date_format, GROUP_CONCAT(CM.name, ',') as categories") + ->join('book_categories as BC', 'BC.book_id = B.book_id and BC.isactive = 1', 'left') + ->join('category as CM', 'BC.category_id = CM.id', 'left') + ->where('B.created_on >=', $oneMonthAgo) + ->where('B.created_on <=', $now) + ->where('B.isactive', 1) + ->groupBy('B.book_id') + ->get() + ->getResultArray(); + } + } diff --git a/app/Models/InvoiceModel.php b/app/Models/InvoiceModel.php index 82f58a1e..b508a178 100644 --- a/app/Models/InvoiceModel.php +++ b/app/Models/InvoiceModel.php @@ -53,7 +53,7 @@ public function updateData($table, $data, $where) ->join('business as B', 'B.business_id = I.business_id', 'left') ->join('users as U1', 'U1.user_id = I.created_by', 'left') ->join('users as U2', 'U2.user_id = I.updated_by', 'left') - ->select('I.invoice_id, I.invoice_number, I.customer_id,concat(C.first_name," ",C.last_name) as customer_name , I.invoice_date, I.due_date, I.subtotal, I.tax, I.discount, I.total_amount,I.status, I.payment_status, I.order_number, I.payment_method,I.invoice_type, I.event_id,E.event_name, I.business_id,B.title as business_name, I.created_on, I.created_by,concat(U1.first_name," ",U1.last_name) as created_by_name, I.updated_on, I.updated_by,concat(U2.first_name," ",U2.last_name) as updated_by_name, I.isactive,C.email as customer_email,C.mobile_no as customer_mobile,I.shipping_address_id,I.shipping_address,I.billing_address_id,I.billing_address') + ->select('I.invoice_id, I.invoice_number, I.customer_id,concat(C.first_name," ",C.last_name) as customer_name , I.invoice_date, I.due_date, I.subtotal, I.tax, I.discount, I.total_amount,I.status, I.payment_status, I.order_number, I.payment_method,I.invoice_type, I.event_id,E.event_name, I.business_id,B.title as business_name, I.created_on, I.created_by,concat(U1.first_name," ",U1.last_name) as created_by_name, I.updated_on, I.updated_by,concat(U2.first_name," ",U2.last_name) as updated_by_name, I.isactive,C.email as customer_email,C.mobile_no as customer_mobile,I.shipping_address_id,I.shipping_address,I.billing_address_id,I.billing_address,B.address as business_address,B.city as business_city,B.state as business_state,B.postal_code as business_postal_code,B.email as business_email,B.mobile_no as business_mobile_no') ->where($where) ->get() ->getResultArray(); diff --git a/app/Models/NotificationModel.php b/app/Models/NotificationModel.php index 5050766d..73ab77f3 100644 --- a/app/Models/NotificationModel.php +++ b/app/Models/NotificationModel.php @@ -3,20 +3,36 @@ namespace App\Models; use CodeIgniter\Model; class NotificationModel extends Model { - protected $table = 'users'; - protected $primaryKey = 'user_id'; - protected $allowedFields = ['user_id','user_name','email','first_name','last_name','password','mobile_no','date_of_birth','address','gender','profile_picture','city','state','postal_code','country','role','isactive','business_id']; + protected $table; - public function saveData($data, $id = null) + public function setCustomTable($tableName) { - if ($id === null) { - // Insert new record - return $this->insert($data); - } else { - // Update existing record - return $this->update($id, $data); - } + $this->table = $tableName; + } + + // public function getTasksDueLastWeek() + // { + // $now = date('Y-m-d'); + // $oneWeekAgo = date('Y-m-d', strtotime('-7 days', strtotime($now))); + + // return $this->where('due_date >=', $oneWeekAgo) + // ->where('due_date <=', $now) + // ->findAll(); + // } + + public function getSubscriptionDueDetail(){ + $now = date('Y-m-d'); + $lastWeek = date('Y-m-d', strtotime('+7 days')); + return $this->db->table('subscription as S' ) + ->join('customers as C', 'C.customer_id = S.customer_id', 'left') + ->join('category as CM', 'CM.id = S.scheme_id', 'left') + ->join('business as B', 'B.business_id = S.business_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('CM.name,concat(C.first_name, " ", C.last_name) as customer_name,C.email as customer_email,C.mobile_no as customer_mobile,S.sub_id,S.scheme_id,S.customer_id,S.from_subscription,S.to_subscription,S.business_id,B.title as business_name,B.address as business_address,B.city as business_city,B.state as business_state,B.postal_code as business_postal_code,B.email as business_email,B.mobile_no as business_mobile_no,S.to_subscription,S.from_subscription,BK.title,BK.book_id') + ->where('S.to_subscription >=', $now)->where('S.to_subscription <=',$lastWeek) + ->groupBy('S.sub_id') + ->get()->getResultArray(); } - } diff --git a/app/Views/approve_template.php b/app/Views/approve_template.php index 7e2e3d47..cc65a5b2 100644 --- a/app/Views/approve_template.php +++ b/app/Views/approve_template.php @@ -149,12 +149,12 @@


    - 22/2, SriKrishna Apartments
    - 1st Street, Subramania Nagar, Kodambakkam
    - CHENNAI 600024
    - Tamil Nadu
    - +919445062922
    - arasubu@gmail.com
    +
    +
    +
    +
    + +91
    +

    diff --git a/app/Views/dashboard.php b/app/Views/dashboard.php index cc2f879e..746fca29 100644 --- a/app/Views/dashboard.php +++ b/app/Views/dashboard.php @@ -1,93 +1,337 @@ - -
    -
    -
    -
    -
    -
    - -
    - -
    -

    -

    +
    +

    +

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

    8574

    -

    Online Orders

    +
    +
    +
    +
    +
    + +
    +
    +

    8574

    +

    Online Orders

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

    958.25

    -

    Revenue

    +
    +
    +
    +
    +
    + +
    +
    +

    958.25

    +

    Revenue

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

    89.25

    -

    Daily Average

    +
    +
    +
    +
    +
    + +
    +
    +

    89.25

    +

    Daily Average

    +
    -
    -
    +
    -
    +
    - \ No newline at end of file + + + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Today : +

    +
    +
    + MTD : + YTD : +
    +
    +
    +
    +
    + +
    +
    +
    +

    Schemes

    +
    + + +
    +
    +
    + +
    +
    +
    +
    +

    + Subscribers +

    +
    +
    +
    + + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +

    Expiring Membership List

    +
    +
    +
+ + + + + + + + + + "; + // print_r($expiring_membership); + // print ""; + foreach ($expiring_membership as $e) : ?> + + + + + + + + + +
#NameScheme NameExpiring In
+
+ +
days
+
+ + + + + +
+
+
+

Books Published in Last One Month

+
+
+ + + + + + + + + + + + + + + + +
Book DetailsCategory
+

+ +

+

+ +

+

+ +

+
+ + + +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/public/uploads/avatar.png b/public/uploads/avatar.png old mode 100755 new mode 100644 index 29ce634387f662bc995e3c74976f4f0a66b16d36..c037568966af131da7d6902b698cb981d6e2c241 GIT binary patch literal 5786 zcmV;L7G>#)P)F)WpOo`p4lH#nB?g>uiKaC({9Gti1gB9xZ08b%#8o(&-u7j{MxJi;JNZmKt0F(`qc|L1~(>zPi#`fWZ-% z3!Rl!(-v!#u)c|vr->Kp(rRoPg)~Tr@iNgxlnByXvrG~0tYlOk1zB3zG1M|6g!Sd7 zw(kiU7n;jPtknQvYsHXtGLY7af#8~%aL1JQ@fjPLjWr|TPIDnQJYN=?85uJX?lkh| z^BA+~F#}<%0XNTbS%7JfDY7qhqv}_-ZY5^P) zXKmlMch3$+qtWTBzHP%8SNs>^N?1ZMtuP7)#dbpFmg# zWQg+MbdBIER%&~L1L6~>R@}Ehwz|*&M;s{OY6qae{-{aveX3Se+c0! zq#fm5hryY$pBx_T_K)^Jgh(Kk3Lu17D3Xy|q@}`s;uc4zdu3p11X-#&A*2dLMcS(x zgTs{yN*k5KU1<7m7$>YlVyK0x7*>N4ao2z$6~$E5w4q42(^0-RRmG?>)(!_S#*ShU zr$z{fF?Ro;2F3HFHU+9tG2SQ(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