diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index 6d3540ec..39f76b55 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -1596,9 +1596,11 @@ public function filterSalesPDList_post() { public function checksalesPD_post() { - $records = $this->post('records'); - $section_data = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('sales_pd_id' => $records['sales_pd_id'],'isactive' => 1,'section_id' => $records['section_id']),SALESPD_SECTION_DATA); - print_r(json_decode($section_data[0]['section_data'],true)); + // $records = $this->post('records'); + // $section_data = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('sales_pd_id' => 775,'isactive' => 1,'section_id' => 1),SALESPD_SECTION_DATA); + // print_r(json_decode($section_data[0]['section_data'],true)); + $template = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('lender_id' => 35,'product_id' => 8,'pd_type' => 1,'sales_pd_type' => 1,'isactive' => 1),SALESPDTEMPLATE); + print_r(json_decode($template[0]['template'],true)); } @@ -1608,7 +1610,7 @@ public function filterSalesPDList_post() { * TO Trigger New Sales PD on CETApp ****** ******/ public function cetNewSalesPd_get(){ - // + log_message('ERROR','## In NewSalesPd'); $sales_pd_type = $this->get('type'); $productname = $this->get('prod'); $applicantname = $this->get('apcntname'); @@ -1660,14 +1662,17 @@ public function filterSalesPDList_post() { $salepd_serial_no = count($lender_short_name)? $lender_short_name[0]['short_name']:'UNKNOWN'; $salepd_serial_no .= $product_id? '-'.$product_short_name:'-UNKNOWN'; $salepd_serial_no .= '-'.(++$count[0]['count']); - + log_message('ERROR','## 1) random string : '.$randomString.' serial No : '.$salepd_serial_no); /*************Inserting Here ******************/ $records = array("sales_pd_sno"=> $salepd_serial_no,"rand_string"=>$randomString,"lender_id"=>$lenderid, "product_id"=>$product_id, "sales_pd_type"=>$sales_pd_type, "applicant_id"=>$applicantid, "applicant_name"=>$applicantname, "createdby"=>$createdby, "isactive"=>1); - $id = $this->Sales_PD_Model->saveRecords($records,SALES_PD_DATA); - // $id = 772; + // $id = $this->Sales_PD_Model->saveRecords($records,SALES_PD_DATA); + $id = 775; + log_message('ERROR','## 2) available sales pdid : '.$id); if (!empty($id)) { $msg = "Inserted, Sales PD : ".$salepd_serial_no."/".$id; $template = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('lender_id' => $lenderid,'product_id' => $product_id,'pd_type' => 1,'sales_pd_type' => $sales_pd_type,'isactive' => 1),SALESPDTEMPLATE); + log_message('ERROR',"## 3) sales_pd_template_id : ".$template[0]["sales_pd_template_id"]." name : ".$template[0]["name"]." lender_id : ".$template[0]["lender_id"]." product_id : ".$template[0]["product_id"]." pd_type : ".$template[0]["pd_type"]." sales_pd_type : ".$template[0]["sales_pd_type"]); + log_message('ERROR','## 4) msg : '.$msg); $template = json_decode($template[0]['template'],true); $section_data=array(); foreach ($template['sections'] as $key => $value){ @@ -1687,6 +1692,10 @@ public function filterSalesPDList_post() { }else if(!empty($form_value['question_key'])){ $value['questions'][$form_key]['answer_value'] = null; } + // if($value['questions'][$form_key]['validations']){ + // $value['questions'][$form_key]['raw_validations'] = $value['questions'][$form_key]['validations']; + // } + } $general = array("section_id"=>$section_id,"section_name"=>$section_name,"onsubmit"=>null,"questions"=>$value['questions'],"order_id"=>1,"is_complete"=>1,"fk_createdby"=>$createdby,"sales_pd_id"=>$id); array_push($section_data, $general);