diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index 59c20943..be339433 100755 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -190,9 +190,9 @@ abstract class BaseController extends Controller $headerInfo['pageTitle'] = $this->CompanyName ." : ".$headerInfo['pageTitle']; - $header = view('includes/header', $headerInfo); + $header = view('includes/new_header', $headerInfo); $content = view($viewName, $pageInfo); - $footer = view('includes/footer', $headerInfo); + $footer = view('includes/new_footer', $headerInfo); echo $header . $content . $footer; } diff --git a/app/Controllers/Sales.php b/app/Controllers/Sales.php index f35fea79..01c0cf1a 100644 --- a/app/Controllers/Sales.php +++ b/app/Controllers/Sales.php @@ -25,16 +25,40 @@ class Sales extends BaseController { $this->global['pageTitle'] = 'Sales Dashboard'; $data = []; - $data['today_sales'] = $this->ipinvoice_model->todaySales(); - $data['this_month_sales'] = $this->ipinvoice_model->thisMonthSales(); - $data['this_year_sales'] = $this->ipinvoice_model->thisYearSales(); - $data['this_year_sales_trend'] = $this->ipinvoice_model->thisYearSalesTrend(); - $data['get_today_invoices'] = $this->ipinvoice_model->getTodayInvoices(); - echo "
";
-        print_r($data);die;
+        $data['today_sales'] = $this->ipinvoice_model->todaySales();
+        $data['this_month_sales'] = $this->ipinvoice_model->thisMonthSales();
+        $data['this_year_sales'] = $this->ipinvoice_model->thisYearSales();
+        $data['this_year_sales_trend'] = $this->ipinvoice_model->thisYearSalesTrend();
+        $data['get_today_invoices'] = $this->ipinvoice_model->getTodayInvoices();
+    
+        // Define months from April to March
+        $months = ['Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar'];
+    
+        // Initialize arrays for current and last year sales
+        $currentYearSales = array_fill(0, 12, 0);
+        $lastYearSales = array_fill(0, 12, 0);
+    
+        // Populate arrays with data
+        foreach ($months as $index => $month) {
+            if (isset($data['this_year_sales_trend'][$month]['Current Year'])) {
+                $currentYearSales[$index] = $data['this_year_sales_trend'][$month]['Current Year'];
+            }
+            if (isset($data['this_year_sales_trend'][$month]['Last Year'])) {
+                $lastYearSales[$index] = $data['this_year_sales_trend'][$month]['Last Year'];
+            }
+        }
+    
+        // Assign to data array
+        $data['currentYearSales'] = $currentYearSales;
+        $data['lastYearSales'] = $lastYearSales;
+    
+        // echo "
";
+        // print_r($data);
+        // die;
+    
         $this->loadViews("sales_dashboard", $this->global, $data, NULL);
     }
-
+    
     //  Sales Invoice List 
     function sales_invoice(){
         $this->global['pageTitle'] = 'Sales Invoice';
diff --git a/app/Models/Ipinvoice_model.php b/app/Models/Ipinvoice_model.php
index 5cda73e9..52b50afe 100644
--- a/app/Models/Ipinvoice_model.php
+++ b/app/Models/Ipinvoice_model.php
@@ -31,7 +31,8 @@ class Ipinvoice_model extends Model
             ->join('ip_invoice_items', 'ip_invoices.invoice_id = ip_invoice_items.invoice_id', 'left')
             ->join('ip_products', 'ip_invoice_items.item_product_id = ip_products.product_id', 'left')
             ->join('ip_invoice_amounts', 'ip_invoices.invoice_id = ip_invoice_amounts.invoice_id', 'left')
-            ->orderBy('ip_invoices.invoice_number', 'DESC');
+            ->orderBy('ip_invoices.invoice_number', 'DESC')
+            ->limit(100);
     
         $query = $builder->get();
         $result = $query->getResult();
diff --git a/app/Views/dashboard.php b/app/Views/dashboard.php
index 08b65a19..1a898a86 100644
--- a/app/Views/dashboard.php
+++ b/app/Views/dashboard.php
@@ -1,4 +1,4 @@
- THIS MONTH :  
- - - - -

TOTAL EMPLOYEES ABSENT

-

-

- - -

ABSENT


-

@@ -264,80 +253,53 @@ function synczohobooks(){
-

- 'Select Employee'); //print_r( $options); - if(!empty($emplist)) { foreach ($emplist as $SID): - - $options[$SID->EmpID] = $SID->name.' '.' - '.' '.$SID->EmpID; - endforeach; } - echo form_dropdown('emp', $options,set_value('emp'),'id="emp"' ,'class="form-control select2'); - ?> -

- - - Click here to Employee Performance Report
- - -
-
-
-

-

0

Working Days
-

0

Days Present
-
-
-
+ @@ -53,5 +54,12 @@ + + + + + + + \ No newline at end of file diff --git a/app/Views/includes/new_header.php b/app/Views/includes/new_header.php index 9f002434..1fe98f0a 100644 --- a/app/Views/includes/new_header.php +++ b/app/Views/includes/new_header.php @@ -10,6 +10,9 @@ + + + @@ -29,6 +32,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -69,11 +217,7 @@ - - - Lock Screen - - + @@ -148,7 +292,8 @@ diff --git a/app/Views/login.php b/app/Views/login.php index cebd8f33..58bbdaa7 100644 --- a/app/Views/login.php +++ b/app/Views/login.php @@ -4,13 +4,19 @@ Resico (India) Pvt Ltd | Admin System Log in - + - - + + + + + + + + -
- -
-

-
Sales Invoice
-

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

Invoices Table

+
+
+
+
Invoice DateInvoice NoClient NameProductRateQuantitySub TotalGSTTotalStatusE-Invoice NumberAction
+ + + + + + + + + + + + + + + + + + item_price * $invoice->item_quantity; @@ -111,314 +108,38 @@ - -
Invoice DateInvoice NoClient NameProductRateQuantitySub TotalGSTTotalStatusE-Invoice NumberAction
-
- -
+ + + + +
+
+
+
- - + + - - - - - - - - +