diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index 782493a4..a41452c3 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -684,6 +684,7 @@ class Sales_PD_Controller extends REST_Controller { $state = ''; $form = $this->Sales_PD_Model->selectCustomRecords(array(),array('isactive' => 1,'sales_pd_id' => $records['sales_pd_id'],'section_id' => 1,'status' => 1),SALESPD_SECTION_DATA); $gen_form = json_decode($form[0]['section_data'],true); + if(!empty($gen_form)){ foreach ($gen_form['questions'] as $g_key => $g_value) { if($g_value['question_key'] == 'state') @@ -691,6 +692,7 @@ class Sales_PD_Controller extends REST_Controller { $state = $g_value['answer_value']; } } + }//gen_form closed here. PDALERTS::sendSalesPDMail($this,$records['sales_pd_id'],$state); }