diff --git a/app/Controllers/Customer.php b/app/Controllers/Customer.php index 4616ea25..3cbdd2e8 100644 --- a/app/Controllers/Customer.php +++ b/app/Controllers/Customer.php @@ -12,6 +12,7 @@ class Customer extends BaseController public function index() { helper('session'); + if (is_session_active()) { $session_role = get_user_role(); $session_bid = get_business_id(); @@ -22,13 +23,11 @@ class Customer extends BaseController $this->logger->info("Customer: Listing In Super-admin role ."); $where = ['isactive != ' => NULL]; } - $CustomerModel = new CustomerModel(); + $CustomerModel = new CustomerModel(); $data['page_name'] = 'Customer Details'; $data['customer'] = $CustomerModel->where($where)->orderBy('customer_id', 'DESC')->findAll(); - - // print_r($data); die(); - + $this->render_page('customer_list', $data); } else { return redirect()->to('login'); diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index 1890f137..2b98eea0 100644 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -32,6 +32,7 @@ class Home extends BaseController // return $element['count'] !== '0' ; // }); $data['book_published'] = $model->book_published_list(); + $data['business_id'] = $session_bid; $this->render_page('dashboard', $data); } diff --git a/app/Controllers/Invoice.php b/app/Controllers/Invoice.php index beb96774..00621612 100644 --- a/app/Controllers/Invoice.php +++ b/app/Controllers/Invoice.php @@ -572,7 +572,7 @@ class Invoice extends BaseController $mpdf->autoLangToFont = true; $mpdf->autoScriptToLang = true; // Set PDF properties $mpdf->SetTitle('Invoice'); - $mpdf->SetAuthor('VBP'); + $mpdf->SetAuthor($data[0]->company_name); $mpdf->SetCreator(''); // Generate the PDF content (HTML) @@ -613,7 +613,7 @@ class Invoice extends BaseController ]; $mpdf = new Mpdf($config); $mpdf->SetTitle('Customer Address'); - $mpdf->SetAuthor('Your Company Name'); + $mpdf->SetAuthor($invoiceData[0]->company_name); $mpdf->SetCreator(''); // Generate the PDF content (HTML) with customer and address data diff --git a/app/Controllers/Users.php b/app/Controllers/Users.php index de902321..8983a333 100755 --- a/app/Controllers/Users.php +++ b/app/Controllers/Users.php @@ -25,10 +25,13 @@ class Users extends BaseController } $model = new UsersModel(); $model->setTable('users'); - $user_details = $model->where($where)->orderBy('user_id', 'DESC')->findAll(); + + $user_details = $model->select('users.*,business.title as company_name')->where($where)->join('business', 'business.business_id = users.business_id','left')->orderBy('user_id', 'DESC')->findAll(); + $this->logger->info("Users: Listing Count .".count($user_details)); $data['page_name'] = 'User Details'; $data['details'] = $user_details; + $data['session_role'] = $session_role; $this->render_page('user_list', $data); } @@ -86,6 +89,7 @@ class Users extends BaseController } $data['business_details'] = $business_details; $data['session_bid'] = $session_bid; + $data['session_role'] = $session_role; $this->render_page($render_page_name, $data); } diff --git a/app/Models/InvoiceModel.php b/app/Models/InvoiceModel.php index 5b980bc8..6dc48391 100644 --- a/app/Models/InvoiceModel.php +++ b/app/Models/InvoiceModel.php @@ -127,8 +127,8 @@ public function updateData($table, $data, $where) ->join('customer_addresses as A','A.customer_id=invoice.customer_id and A.address_type=1','left') ->join('states', 'states.state_short_name = A.state AND A.country = "IN"', 'left') ->join('countries', 'countries.country_short_name = A.country', 'left') - ->select('invoice.*,concat(C.first_name," ",C.last_name) as customer_name,A.address_1, A.address_2,A.postal_code,A.city, A.state,C.mobile_no as customer_mobile') - ->select('B.title as ,B.business_logo,B.terms,B.address,B.city,B.state,B.postal_code,B.email,B.mobile_no') + ->select('invoice.*,DATE_FORMAT(invoice.invoice_date, "%d/%m/%Y") AS formatted_invoice_date,DATE_FORMAT(invoice.due_date, "%d/%m/%Y") AS formatted_due_date ,concat(C.first_name," ",C.last_name) as customer_name,A.address_1, A.address_2,A.postal_code,A.city, A.state,C.mobile_no as customer_mobile') + ->select('B.title as company_name,B.business_logo,B.terms as company_terms,B.address as company_address,B.city as company_city,B.state as company_state,B.postal_code as company_postal_code,B.email as company_email,B.mobile_no as company_mobile_no') ->select('COALESCE(NULLIF(states.state_name, ""), A.state) AS customer_bill_state') ->select('concat(A.address_1," ", A.address_2) as customer_bill_address,A.postal_code as customer_bill_postal_code ,A.city as customer_bill_city, countries.country_name as customer_bill_country') ->get() diff --git a/app/Views/address_pdf_template.php b/app/Views/address_pdf_template.php index 8eccfc2a..9bf023b1 100644 --- a/app/Views/address_pdf_template.php +++ b/app/Views/address_pdf_template.php @@ -14,7 +14,7 @@ width: 4in; /* height: 6in; */ margin: 20px auto; - border: 1px solid #000; + border: 1px solid #fff; padding:15px; box-sizing: border-box; } @@ -49,25 +49,23 @@ foreach ($invoiceData as $value) : ?>
- -
- customer_name ?> - customer_bill_address ?> - customer_bill_city ?> customer_bill_state ?> - customer_bill_postal_code ?> - customer_bill_country ?> + customer_name ?>
+ customer_bill_address." ," ?>
+ customer_bill_city ?> customer_bill_state ? $value->customer_bill_state : "" ?> + customer_bill_postal_code ? " - ".$value->customer_bill_postal_code :""; ?> + customer_bill_country." ." ?>
- -
-
From
- address ?>,
city ?>, state ?>, - postal_code ?> +
+
From
+ company_name; ?>
+ company_address; ?>
+ company_city; ?> - company_postal_code; ?> + company_mobile_no; ?> +
-
- diff --git a/app/Views/dashboard.php b/app/Views/dashboard.php index a0aff90e..31871cca 100644 --- a/app/Views/dashboard.php +++ b/app/Views/dashboard.php @@ -1,85 +1,4 @@ - -
-
-
-
-
-
- -
- -
-

-

-
-
-
-
-
- -
-
-
-
-
- -
-
-

8574

-

Online Orders

-
-
-
-
-
- -
-
-
-
-
- -
-
-

958.25

-

Revenue

-
-
-
-
-
- -
-
-
-
-
- -
-
-

89.25

-

Daily Average

-
-
-
-
-
- -
- - - + - + Invoice Date : formatted_invoice_date ?> - Order Number : order_number ?> - + Order Number : order_number ? $value->order_number : "-" ?> + due_date) : ?> - due_date); -if (count($invoiceDateParts) === 3) { - $formattedDueDate = $invoiceDateParts[2] . '/' . $invoiceDateParts[1] . '/' . $invoiceDateParts[0]; -} else { - $formattedDueDate = ''; // Handle invalid dates gracefully -} -?> - Due Date : - - - - + Due Date : formatted_due_date ?> - - + + + - - From Subscription : from_subscription)) ?> - - - To Subscription : to_subscription)) ?> - - - - - - + + From Subscription : from_subscription)) ?> + + + To Subscription : to_subscription)) ?> + + + + diff --git a/app/Views/template/header.php b/app/Views/template/header.php index b2b2e46e..8a2faafd 100644 --- a/app/Views/template/header.php +++ b/app/Views/template/header.php @@ -124,25 +124,31 @@ Dashboard +
  • "> Customer
  • + +
  • "> Invoices
  • + +
  • "> Membership
  • - + +
  • "> @@ -150,7 +156,7 @@
  • - +
  • "> @@ -173,8 +179,14 @@ Site Setting
  • +
  • + "> + + Business + +
  • - +
  • "> @@ -183,7 +195,7 @@
  • - +
  • "> @@ -191,7 +203,7 @@
  • - +
  • "> @@ -200,7 +212,7 @@
  • - +
  • @@ -223,7 +235,7 @@
  • - +
  • diff --git a/app/Views/template/topbar.php b/app/Views/template/topbar.php index 9c4525c7..a128b79f 100644 --- a/app/Views/template/topbar.php +++ b/app/Views/template/topbar.php @@ -74,7 +74,7 @@ My Account - + "class="dropdown-item notify-item"> Business Setting diff --git a/app/Views/user_list.php b/app/Views/user_list.php index 55e0a6d3..7226be3c 100644 --- a/app/Views/user_list.php +++ b/app/Views/user_list.php @@ -36,6 +36,7 @@ Email Mobile Number Role + Company Status Action @@ -66,6 +67,7 @@ +