From 74807382af5fb253809a9be2fab174bef223b3a8 Mon Sep 17 00:00:00 2001 From: sriramv Date: Mon, 2 Jan 2023 12:01:17 +0530 Subject: [PATCH] business:GWM --- .../modules/Asset/controllers/Asset.php | 10 +- .../modules/Asset/models/Asset_model.php | 8 +- .../modules/Asset/views/asset_amc_form.php | 14 +- .../Asset/views/asset_insurance_form.php | 15 + .../Asset/views/asset_sub_value_list.php | 23 +- application/modules/Business/.gitkeep | 0 .../modules/Business/controllers/Business.php | 458 ++++++++++++++++++ application/modules/Business/models/.gitkeep | 0 .../Business/models/Business_model.php | 44 ++ application/modules/Business/views/.gitkeep | 0 .../modules/Business/views/add_business.php | 148 ++++++ .../modules/Business/views/business_list.php | 82 ++++ .../modules/Business/views/edit_business.php | 156 ++++++ .../Layout/views/includes/default_header.php | 5 + .../Layout/views/includes/default_menu.php | 14 +- assets/uploads/logo/lion-roar.png | Bin 0 -> 27001 bytes assets/uploads/logo/lovepik.png | Bin 0 -> 20319 bytes assets/uploads/logo/lovepik1.png | Bin 0 -> 20319 bytes .../logo/venba-information-technology.png | Bin 0 -> 9536 bytes 19 files changed, 952 insertions(+), 25 deletions(-) create mode 100644 application/modules/Business/.gitkeep create mode 100644 application/modules/Business/controllers/Business.php create mode 100644 application/modules/Business/models/.gitkeep create mode 100644 application/modules/Business/models/Business_model.php create mode 100644 application/modules/Business/views/.gitkeep create mode 100644 application/modules/Business/views/add_business.php create mode 100644 application/modules/Business/views/business_list.php create mode 100644 application/modules/Business/views/edit_business.php create mode 100644 assets/uploads/logo/lion-roar.png create mode 100644 assets/uploads/logo/lovepik.png create mode 100644 assets/uploads/logo/lovepik1.png create mode 100644 assets/uploads/logo/venba-information-technology.png diff --git a/application/modules/Asset/controllers/Asset.php b/application/modules/Asset/controllers/Asset.php index 9b0c57b..757f31c 100644 --- a/application/modules/Asset/controllers/Asset.php +++ b/application/modules/Asset/controllers/Asset.php @@ -338,6 +338,7 @@ public function add_or_edit_asset_amc() $data['valid_from'] = $this->input->post('valid_from'); $data['valid_to'] = $this->input->post('valid_to'); $data['created_by'] = user()->id; + $data['type'] = 3; //(amc service provider type = 3 * in third_parties table) $createAMCData = $this->MY_Model->insert($data, 'amc'); //$this->view_asset_details(md5($this->input->post('asset_id_for_add'))); redirect('asset/view_asset_details/'.md5($this->input->post('asset_id_for_add'))); @@ -371,16 +372,19 @@ public function add_or_edit_asset_insurance() { $value = $this->input->post(); unset($value['asset_id_for_add']); - $editInsuranceData = $this->MY_Model->edit_option($value, $this->input->post('id'), 'asset_insurance'); + $editInsuranceData = $this->MY_Model->edit_option($value, $this->input->post('id'), 'amc'); redirect('asset/view_asset_details/'.md5($this->input->post('asset_id'))); }else{ $data['asset_id'] = $this->input->post('asset_id_for_add'); $data['business_id'] = user()->business_id; $data['insurance_company'] = $this->input->post('insurance_company'); + $data['cost'] = $this->input->post('cost'); + $data['description'] = $this->input->post('description'); $data['valid_from'] = $this->input->post('valid_from'); $data['valid_to'] = $this->input->post('valid_to'); $data['created_by'] = user()->id; - $createInsuranceData = $this->MY_Model->insert($data, 'asset_insurance'); + $data['type'] = 4; //(insurance company type = 4 * in third_parties table) + $createInsuranceData = $this->MY_Model->insert($data, 'amc'); redirect('asset/view_asset_details/'.md5($this->input->post('asset_id_for_add'))); } } @@ -463,7 +467,7 @@ public function deleteAssetInsurance($id) $split = preg_split('/_/', $id); $key = $split[0]; $asset_id = $split[1]; - $Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'asset_insurance'); + $Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'amc'); redirect('asset/view_asset_details/'.md5($asset_id)); } diff --git a/application/modules/Asset/models/Asset_model.php b/application/modules/Asset/models/Asset_model.php index 4b0f440..a6c4ddd 100644 --- a/application/modules/Asset/models/Asset_model.php +++ b/application/modules/Asset/models/Asset_model.php @@ -56,6 +56,7 @@ public function get_amc_with_join($id,$business_id) $this->db->where('A.business_id', $business_id); $this->db->where('md5(A.asset_id)', $id); $this->db->where('is_active', 1); + $this->db->where('A.type', 3); $query = $this->db->get(); $query = $query->result(); return $query; @@ -67,6 +68,7 @@ public function get_amc_by_id_with_join($id) $this->db->join('third_parties', 'third_parties.id = A.service_provider', 'left'); $this->db->where('md5(A.id)', $id); $this->db->where('is_active', 1); + $this->db->where('A.type', 3); $query = $this->db->get(); $query = $query->row(); return $query; @@ -75,11 +77,12 @@ public function get_amc_by_id_with_join($id) public function get_insurance_with_join($id,$business_id) { $this->db->select('A.* , third_parties.name as insurance_company_name '); - $this->db->from('asset_insurance A'); + $this->db->from('amc A'); $this->db->join('third_parties', 'third_parties.id = A.insurance_company', 'left'); $this->db->where('A.business_id', $business_id); $this->db->where('md5(A.asset_id)', $id); $this->db->where('is_active', 1); + $this->db->where('A.type', 4); $query = $this->db->get(); $query = $query->result(); return $query; @@ -87,10 +90,11 @@ public function get_insurance_with_join($id,$business_id) public function get_insurance_by_id_with_join($id) { $this->db->select('A.* , third_parties.name as insurance_company_name '); - $this->db->from('asset_insurance A'); + $this->db->from('amc A'); $this->db->join('third_parties', 'third_parties.id = A.insurance_company', 'left'); $this->db->where('md5(A.id)', $id); $this->db->where('is_active', 1); + $this->db->where('A.type', 4); $query = $this->db->get(); $query = $query->row(); return $query; diff --git a/application/modules/Asset/views/asset_amc_form.php b/application/modules/Asset/views/asset_amc_form.php index 69c500a..8ed65fe 100644 --- a/application/modules/Asset/views/asset_amc_form.php +++ b/application/modules/Asset/views/asset_amc_form.php @@ -39,13 +39,6 @@ -
- -
- -
-
-
@@ -70,6 +63,13 @@
+
+ +
+ +
+
+ +
+ +
+ +
+
@@ -61,6 +67,15 @@
+
+ +
+ +
+
+ + +