From 6ab29e883972e4faf5f64438b505a82195eeaa7f Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Thu, 7 Oct 2021 18:32:39 +0530 Subject: [PATCH] Dashboard changes : ps --- application/controllers/user.php | 59 ++- application/models/dahsboard_model.php | 15 + application/views/dashboard.php | 578 +++++++++++++------------ application/views/includes/footer.php | 14 +- 4 files changed, 389 insertions(+), 277 deletions(-) mode change 100644 => 100755 application/controllers/user.php mode change 100755 => 100644 application/views/dashboard.php diff --git a/application/controllers/user.php b/application/controllers/user.php old mode 100644 new mode 100755 index cb3f1145..3609e938 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -40,13 +40,17 @@ class user extends BaseController $this->load->model('dahsboard_Model'); - - $data['EmpCount'] = $this->employeedetails_model->getEmployeeCount(); + // if(date('m') == 04) { $this->dahsboard_Model->update_FiscalYear(); } + $data['EmpCount'] = $this->employeedetails_model->getEmployeeCount(); + $Users = $this->user_model->userListing(); + $data['Usrcnt'] = count($Users); + $data['totalpurchaseorder']=$this->dahsboard_Model->totalpurchaseorder(); //print_r( $data['totalpurchaseorder']); $data['totalordervalue']=$this->dahsboard_Model->totalordervalue(); + $data['convertiontotalordervalue']=$this->convertamounttext($data['totalordervalue'][0]->totalordervalue); $data['pendingpo']=$this->dahsboard_Model->pendingpo(); // $data['totalserviceamount']=$this->dahsboard_Model->totalserviceamount(); // $data['totalcapitalamount']=$this->dahsboard_Model->totalcapitalamount(); @@ -62,6 +66,8 @@ class user extends BaseController $data['details']=$this->dahsboard_Model->reqdetail(); $data['pending_details']=$this->dahsboard_Model->req_pending(); + + // $data['list']=$this->dahsboard_Model->req_list(); $data['serviceprogress']=$this->dahsboard_Model->serviceprogress(); @@ -77,7 +83,8 @@ class user extends BaseController //dashboard pie chart $data['importbudgt'] = $this->dahsboard_Model->importbudgt(); - $data['servicebudgt'] = $this->dahsboard_Model->servicebudgt(); +$data['servicebudgt'] = $this->dahsboard_Model->servicebudgt(); +// print_r($data);die(); $data['revenuebudgt'] = $this->dahsboard_Model->revenuebudgt(); $data['capitalbud'] = $this->dahsboard_Model->capitalbud(); $data['typebal'] = $this->dahsboard_Model->typebal(); @@ -1568,6 +1575,52 @@ function deliver_perform() } } + + + function count_digit($number) { + return strlen($number); + } + + function divider($number_of_digits) { + $tens="1"; + + if($number_of_digits>8) + return 10000000; + + while(($number_of_digits-1)>0) + { + $tens.="0"; + $number_of_digits--; + } + return $tens; + } + + function convertamounttext($num){ + $ext="";//thousand,lac, crore + $split = explode(".", $num); + $number_of_digits = $this->count_digit($split[0]); //this is call :) + + if($number_of_digits>3) + { + if($number_of_digits%2!=0) + $divider=$this->divider($number_of_digits-1); + else + $divider=$this->divider($number_of_digits); + } + else + $divider=1; + + $fraction=$num/$divider; + $fraction=number_format($fraction,2); + if($number_of_digits==4 ||$number_of_digits==5) + $ext="k"; + if($number_of_digits==6 ||$number_of_digits==7) + $ext="Lac"; + if($number_of_digits==8 ||$number_of_digits==9) + $ext="Cr"; + return $fraction." ".$ext; + } + } ?> diff --git a/application/models/dahsboard_model.php b/application/models/dahsboard_model.php index b130262b..15eea7e0 100755 --- a/application/models/dahsboard_model.php +++ b/application/models/dahsboard_model.php @@ -3135,5 +3135,20 @@ function getDailyOpeningAmt($yesterday){ return $query->result(); } + + function update_FiscalYear(){ + if(date('m') >= 4) { + $d = date('Y-m-d', strtotime('+1 years')); + $arr = array('FiscalYearStartOn' => date('Y')."-04-01", + 'FiscalYearEndsOn' => date('Y', strtotime($d))."-03-31"); + } else { + $d = date('Y-m-d', strtotime('-1 years')); + $arr = array('FiscalYearStartOn' => date('Y', strtotime($d))."-04-01", + 'FiscalYearEndsOn' => date('Y')."-03-31"); + + } + $this->db->where('CompID', "SI001"); + $this->db->update('T_Company_Details',$arr); + } } ?> \ No newline at end of file diff --git a/application/views/dashboard.php b/application/views/dashboard.php old mode 100755 new mode 100644 index ce278732..5c8eaf21 --- a/application/views/dashboard.php +++ b/application/views/dashboard.php @@ -2,23 +2,83 @@ $Empcnt = ''; if (!empty($EmpCount)) { foreach ($EmpCount as $Emp) { - $Empcnt = $Emp->EmpCount; + $Empcnt = $Emp->EmpCount; } } + ?> +
- + -
-
-

Accounts Department Dashboard

-
+

Accounts Department Dashboard

@@ -38,19 +98,13 @@
- - - - + + - - - - + + +
-
-
-

Admin Dashboard

-
-
+
-
-

44

- +

User Registrations

@@ -647,17 +689,10 @@
- - - - - - - + + + +
@@ -684,23 +719,19 @@
- - - - + + + + - + --> - - - - - @@ -1563,13 +1601,7 @@ // //- END PIE CHART - // //----------------- - - - - - - + + \ No newline at end of file diff --git a/application/views/includes/footer.php b/application/views/includes/footer.php index a6334683..47cd3bcc 100755 --- a/application/views/includes/footer.php +++ b/application/views/includes/footer.php @@ -4,7 +4,19 @@ - Copyright © 2016-2017 Siddharth Industries. All rights reserved. + + Copyright © + + Siddharth Industries. All rights reserved. + + +