diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 77b8bc95..493aef9c 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -139,6 +139,7 @@ $route['getVendorCityMap'] = 'Entity_Management_Controller/getVendorCityMap'; $route['saveLenderBranches'] = 'Entity_Management_Controller/saveLenderBranches'; $route['listLenderBranches'] = 'Entity_Management_Controller/listLenderBranches'; $route['getFullTATInfo'] = 'Entity_Management_Controller/getFullTATInfo'; +$route['saveTATInfo'] = 'Entity_Management_Controller/saveTATInfo'; //PD RELATED $route['triggerNewPD'] = 'PD_Controller/triggerNewPD'; diff --git a/api/application/controllers/Entity_Management_Controller.php b/api/application/controllers/Entity_Management_Controller.php index 0c02fcfe..b3b4c858 100644 --- a/api/application/controllers/Entity_Management_Controller.php +++ b/api/application/controllers/Entity_Management_Controller.php @@ -667,4 +667,39 @@ class Entity_Management_Controller extends REST_Controller { } + public function saveTATInfo_post() + { + $records = $this->post('records'); + $count = 0; + // if($records['entity_tat_master_id'] == "" || $records['entity_tat_master_id'] == null) + // { + $temp = array('fk_entity_id'=>$records['fk_entity_id'],'tat1'=>$records['tat1'],'tat2'=>$records['tat2'],'fk_createdby'=>$records['fk_createdby']); + $id = $this->Entity_Management_Model->saveRecords($temp,ENTITYTAT); + if($id != null || $id != "") + { + foreach($records['child'] as $key => $child) + { + $temp = array('fk_city_id'=>substr($child,0,1),'fk_product_id'=>substr($child,1,1),'fk_pd_type_id'=>substr($child,2,1),'fk_tat_master_id'=>$id); + $cid = $this->Entity_Management_Model->saveRecords($temp,ENTITYTATCHILD); + if($cid != "" || $cid != null) { $count++; } + + } + + } + + if($count != 0 && ($count == count($records['child']))) + { + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = $count; + $this->response($data,REST_Controller::HTTP_OK); + } + // } + // else + // { + + // } + } + + } \ No newline at end of file