diff --git a/app/Controllers/Customer.php b/app/Controllers/Customer.php index bae69804..0f5b4524 100644 --- a/app/Controllers/Customer.php +++ b/app/Controllers/Customer.php @@ -23,7 +23,7 @@ class Customer extends BaseController $CustomerModel = new CustomerModel(); $data['page_name'] = 'Customer Listing'; - $data['customer'] = $CustomerModel->where($where)->findAll(); + $data['customer'] = $CustomerModel->where($where)->orderBy('customer_id', 'DESC')->findAll(); // print_r($data); die(); @@ -92,8 +92,7 @@ class Customer extends BaseController 'state' => $this->request->getPost('cstate'), 'postal_code' => $this->request->getPost('czip'), 'country' => $this->request->getPost('ccountry'), - 'type' => $this->request->getPost('ctype'), - 'date_of_birth' => $this->request->getPost('dob'), + 'date_of_birth' => $this->request->getPost('dob'), 'gender' => $this->request->getPost('gen'), 'profile_picture' => $this->request->getPost('cfile'), 'mode' => $this->request->getPost('cmode'), diff --git a/app/Controllers/Scheme.php b/app/Controllers/Scheme.php index 7d3ad5e7..cab834cf 100644 --- a/app/Controllers/Scheme.php +++ b/app/Controllers/Scheme.php @@ -21,9 +21,10 @@ class Scheme extends BaseController $where = ['isactive != ' => NULL]; } $SchemeModel = new SchemeModel(); - + $data['page_name'] = 'Scheme Listing'; - $data['scheme'] = $SchemeModel->where($where)->findAll(); + $data['scheme'] = $SchemeModel->where($where)->orderBy('book_id', 'DESC')->findAll(); + $this->render_page('scheme_list', $data); } else { diff --git a/app/Models/AuthenticationModel.php b/app/Models/AuthenticationModel.php index 046977e5..eb805a3a 100644 --- a/app/Models/AuthenticationModel.php +++ b/app/Models/AuthenticationModel.php @@ -5,12 +5,12 @@ class AuthenticationModel 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','reset_link']; + protected $allowedFields = ['user_id','email','first_name','last_name','password','mobile_no','date_of_birth','address','gender','profile_picture','city','state','postal_code','country','role','isactive','business_id','reset_link']; public function getheringDetailsForHeader($user_id) { $builder = $this->db->table('users'); - $builder->select('users.user_id,users.user_name,users.business_id,users.profile_picture,users.role,settings.site_name,settings.site_title,settings.favicon,settings.logo as company_logo_large,business.business_logo as company_logo_small,business.email as company_email,business.address as company_address,business.mobile_no as company_mobile_no,business.title'); + $builder->select('users.user_id,users.business_id,users.profile_picture,users.role,settings.site_name,settings.site_title,settings.favicon,settings.logo as company_logo_large,business.business_logo as company_logo_small,business.email as company_email,business.address as company_address,business.mobile_no as company_mobile_no,business.title'); $builder->join('settings', 'settings.business_id = users.business_id', 'left'); $builder->join('business', 'business.business_id = users.business_id', 'left'); $builder->where('user_id', $user_id); diff --git a/app/Models/InvoiceModel.php b/app/Models/InvoiceModel.php index 05ce427b..82f58a1e 100644 --- a/app/Models/InvoiceModel.php +++ b/app/Models/InvoiceModel.php @@ -162,3 +162,4 @@ public function insertSubscriptionData($data) + diff --git a/app/Models/SchemeModel.php b/app/Models/SchemeModel.php index e4257839..c7043933 100644 --- a/app/Models/SchemeModel.php +++ b/app/Models/SchemeModel.php @@ -102,6 +102,23 @@ public function getAllSchemes() { return $this->findAll(); } + public function getCategoryName($book_id) +{ + $builder = $this->builder(); + $builder->select('category.name AS category_name'); + $builder->join('book_categories', 'book_categories.book_id = books.book_id'); + $builder->join('category', 'category.id = book_categories.category_id'); + $builder->where('books.book_id', $book_id); + + $query = $builder->get(); + + if ($query->getNumRows() === 1) { + $row = $query->getRow(); + return $row->category_name; + } else { + return null; + } +} } diff --git a/app/Views/customer_form.php b/app/Views/customer_form.php index 5afce7de..0382706c 100644 --- a/app/Views/customer_form.php +++ b/app/Views/customer_form.php @@ -17,7 +17,7 @@ href="#subscriptionDetails" role="tab" aria-controls="subscriptionDetails" aria-selected="false">Subscription Details - @@ -75,8 +75,7 @@
- + @@ -94,15 +93,8 @@
-
- - -
Please provide.
-
-
+ +
- -
-
+
-
+
@@ -34,8 +29,8 @@
- - + +
- -
- - -
- -
+
+
+ + +
+ +
- - + +
- - + +
- - + +
- - + +
@@ -113,7 +108,7 @@
- +