PD FORMDETAIS AS JSON

This commit is contained in:
velz 2018-12-26 17:41:48 +05:30
parent 66c4cd5f8f
commit f9dc439489
3 changed files with 74 additions and 3 deletions

View File

@ -448,6 +448,9 @@ defined('PDREPORTSVERSIONBLOBID') OR define('PDREPORTSVERSIONBLOBID','pd_report_
defined('ENTITYLENDERBRANCH') OR define('ENTITYLENDERBRANCH','m_entity_lender_branch');
defined('ENTITYLENDERBRANCHID') OR define('ENTITYLENDERBRANCHID','entity_lender_branch_id');
defined('PDFORMDETAILSJSON') OR define('PDFORMDETAILSJSON','t_pd_form_details_json');
defined('PDFORMDETAILSJSONID') OR define('PDFORMDETAILSJSONID','pd_form_detail_json_id');

View File

@ -174,13 +174,15 @@ $route['getListOfPDReportVersions'] = 'PD_Controller/getListOfPDReportVersions';
$route['swapOlderPDReportToLatest'] = 'PD_Controller/swapOlderPDReporttoLatest';
$route['filterPDList'] = 'PD_Controller/filterPDList';
$route['getQCLenderRemarks'] = 'PD_Controller/getQCLenderRemarks';
// $route['savePDFormDetailsJSON'] = 'PD_Controller/savePDFormDetailsJSON';
// $route['getPDFormDetailsJSON'] = 'PD_Controller/getPDFormDetailsJSON';
$route['smartyTestFunction'] = 'PD_Controller/smartyTestFunction';
$route['codeigniterViewTest'] = 'PD_Controller/codeigniterViewTest';
//PD Form Related
$route['getPDFormDetails'] = 'PD_Controller/getPDFormDetails';
$route['savePDFormDetails'] = 'PD_Controller/savePDFormDetails';
$route['getPDFormDetails'] = 'PD_Controller/getPDFormDetailsJSON';
$route['savePDFormDetails'] = 'PD_Controller/savePDFormDetailsJSON';
$route['getFinalPDReportQuestions'] = 'PD_Controller/getFinalPDReportQuestions';
$route['getTypeOfActivetyFromBusinessForm'] = 'PD_Controller/getTypeOfActivetyFromBusinessForm';

View File

@ -2028,7 +2028,73 @@ class PD_Controller extends REST_Controller {
}
public function savePDFormDetailsJSON_post()
{
$records = $this->post('records');
$pdid = $records['pdid'];
$formid = $records['formid'];
$createdby = $records['fk_createdby'];
$fields = array('isactive' => 0);
$where_condition_array = array('fk_form_id'=>$formid,'fk_pd_id'=>$pdid);
$id = $this->PD_Model->updateRecords($fields,PDFORMDETAILSJSON,$where_condition_array);
unset($records['pdid']);
unset($records['formid']);
unset($records['fk_createdby']);
$records = json_encode($records);
$temp_array = array('fk_form_id'=>$formid,'fk_pd_id'=>$pdid,'fk_createdby'=>$createdby,'json'=>$records);
$id = $this->PD_Model->saveRecords($temp_array,PDFORMDETAILSJSON);
if($id != "" || $id != null)
{
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
$data['records'] = $id;
$this->response($data,REST_Controller::HTTP_OK);
}
else
{
$data['dataStatus'] = false;
$data['status'] = REST_Controller::HTTP_NOT_MODIFIED;
$data['msg'] = 'Something Went Wrong! Try Later..!';
$this->response($data,REST_Controller::HTTP_OK);
}
}
public function getPDFormDetailsJSON_post()
{
$pd_id = $this->post('pd_id');
$pd_form_id = $this->post('pd_form_id');
$fields = array('json');
$where_condition_array = array('isactive' => 1,'fk_form_id'=>$pd_form_id,'fk_pd_id'=>$pd_id);
$rec = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON);
// print_r($rec);die();
if(count($rec))
{
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
$data['records'] = json_decode($rec[0]['json']);
$this->response($data,REST_Controller::HTTP_OK);
}
else
{
$data['dataStatus'] = false;
$data['status'] = REST_Controller::HTTP_NOT_MODIFIED;
$data['msg'] = 'Something Went Wrong! Try Later..!';
$this->response($data,REST_Controller::HTTP_OK);
}
}
public function downloadExcel_post()
{
}
//Save Co applicants details from General Form
public function saveCoApplicantsFromGeneralInfoForm($records)
{
@ -3588,7 +3654,7 @@ class PD_Controller extends REST_Controller {
}
else if($records['flag'] == 'QC_REMARKS')
{
$fields = array('qc_remarks_remarks','pd_status');
$fields = array('qc_remarks','pd_status');
}
$where_condition_array = array('pd_id'=>$pdid);