TEMPLATE CHNAGED

This commit is contained in:
velz 2018-12-22 12:10:22 +05:30
parent 86b5621593
commit b0aca40a5b
2 changed files with 18 additions and 6 deletions

View File

@ -1761,8 +1761,18 @@ class PD_Controller extends REST_Controller {
{ {
$this->saveCoApplicantsFromGeneralInfoForm($records); $this->saveCoApplicantsFromGeneralInfoForm($records);
} }
// if($pd_form_id == 6)
// {
// if(array_key_exists('family_details',$records))
// {
// $records = $records['family_details'];
// unset($records['family_details']);
// }
// }
if($records['formid'] == 1)// If formis supplier then omit parent level array keys if($pd_form_id == 1)// If formis supplier then omit parent level array keys
{ {
if(array_key_exists('manufacturing_details',$records)) if(array_key_exists('manufacturing_details',$records))
{ {
@ -1779,7 +1789,7 @@ class PD_Controller extends REST_Controller {
} }
} }
if($records['formid'] == 2)// If formis client then omit parent level array keys if($pd_form_id == 2)// If formis client then omit parent level array keys
{ {
if(array_key_exists('manufacturing_details',$records)) if(array_key_exists('manufacturing_details',$records))
{ {
@ -1804,7 +1814,7 @@ class PD_Controller extends REST_Controller {
} }
if($records['formid'] == 11)// If formis supplier then omit parent level array keys if($pd_form_id == 11)// If formis supplier then omit parent level array keys
{ {
if(array_key_exists('manufacturing_details',$records)) if(array_key_exists('manufacturing_details',$records))
{ {

View File

@ -680,12 +680,12 @@ class Template_Management_Controller extends REST_Controller {
$this->db->JOIN(QUESTIONCATEGORY.' as QUESTIONCATEGORY','TEMPLATECATEGORYWEIGHTAGE.fk_question_category_id = QUESTIONCATEGORY.question_category_id'); $this->db->JOIN(QUESTIONCATEGORY.' as QUESTIONCATEGORY','TEMPLATECATEGORYWEIGHTAGE.fk_question_category_id = QUESTIONCATEGORY.question_category_id');
$this->db->WHERE('TEMPLATECATEGORYWEIGHTAGE.fk_template_id',$templateid); $this->db->WHERE('TEMPLATECATEGORYWEIGHTAGE.fk_template_id',$templateid);
$template_categories = $this->db->GET()->result_array(); $template_categories = $this->db->GET()->result_array();
//print_r($template_categories); //print_r($template_categories);die();
foreach($template_categories as $cate_key => $category) foreach($template_categories as $cate_key => $category)
{ {
$this->db->SELECT('QUESTIONKEYMAPPING.question_key_mapping_id,QUESTIONKEYMAPPING.fk_form_id,QUESTIONKEYMAPPING.question,QUESTIONKEYMAPPING.key,QUESTIONKEYMAPPING.master_name,SCORECARDQUESTIONS.score_question_id,SCORECARDQUESTIONS.fk_template_id,SCORECARDQUESTIONS.fk_form_id,SCORECARDQUESTIONS.fk_key,SCORECARDQUESTIONS.weightage,SCORECARDQUESTIONS.calc_type'); $this->db->SELECT('QUESTIONKEYMAPPING.question_key_mapping_id,QUESTIONKEYMAPPING.fk_form_id,QUESTIONKEYMAPPING.question,QUESTIONKEYMAPPING.key,QUESTIONKEYMAPPING.master_name,SCORECARDQUESTIONS.score_question_id,SCORECARDQUESTIONS.fk_template_id,SCORECARDQUESTIONS.fk_form_id,SCORECARDQUESTIONS.fk_key,SCORECARDQUESTIONS.weightage,SCORECARDQUESTIONS.calc_type');
$this->db->FROM(SCORECARDQUESTIONS.' as SCORECARDQUESTIONS'); $this->db->FROM(SCORECARDQUESTIONS.' as SCORECARDQUESTIONS');
$this->db->JOIN(QUESTIONKEYMAPPING.' as QUESTIONKEYMAPPING','SCORECARDQUESTIONS.fk_form_id = QUESTIONKEYMAPPING.fk_form_id AND QUESTIONKEYMAPPING.key = SCORECARDQUESTIONS.fk_key AND SCORECARDQUESTIONS.isactive = 1 AND QUESTIONKEYMAPPING.isactive = 1','LEFT'); $this->db->JOIN(QUESTIONKEYMAPPING.' as QUESTIONKEYMAPPING','SCORECARDQUESTIONS.fk_form_id = QUESTIONKEYMAPPING.fk_form_id AND QUESTIONKEYMAPPING.key = SCORECARDQUESTIONS.fk_key AND SCORECARDQUESTIONS.isactive = 1 AND QUESTIONKEYMAPPING.isactive = 1 AND SCORECARDQUESTIONS.fk_template_id ='.$templateid,'LEFT');
$this->db->WHERE('QUESTIONKEYMAPPING.fk_category_id',$category['fk_question_category_id']); $this->db->WHERE('QUESTIONKEYMAPPING.fk_category_id',$category['fk_question_category_id']);
$ques_keys = $this->db->GET()->result_array(); $ques_keys = $this->db->GET()->result_array();
//print_r($ques_keys); //print_r($ques_keys);
@ -703,7 +703,7 @@ class Template_Management_Controller extends REST_Controller {
foreach($answers as $answer_key => $answer) foreach($answers as $answer_key => $answer)
{ {
$this->db->SELECT('SCORECARDANSWERS.score_answer_id, SCORECARDANSWERS.fk_score_question_id, SCORECARDANSWERS.answer, SCORECARDANSWERS.score'); $this->db->SELECT('SCORECARDANSWERS.score_answer_id, SCORECARDANSWERS.fk_score_question_id, SCORECARDANSWERS.answer, SCORECARDANSWERS.score,SCORECARDANSWERS.isactive');
$this->db->FROM(SCORECARDANSWERS.' as SCORECARDANSWERS'); $this->db->FROM(SCORECARDANSWERS.' as SCORECARDANSWERS');
$this->db->WHERE('SCORECARDANSWERS.fk_score_question_id',$result['score_question_id']); $this->db->WHERE('SCORECARDANSWERS.fk_score_question_id',$result['score_question_id']);
//$this->db->WHERE('SCORECARDANSWERS.isactive',1); //$this->db->WHERE('SCORECARDANSWERS.isactive',1);
@ -717,6 +717,7 @@ class Template_Management_Controller extends REST_Controller {
$answers[$answer_key]['fk_score_question_id'] = $exact_answers[0]['fk_score_question_id']; $answers[$answer_key]['fk_score_question_id'] = $exact_answers[0]['fk_score_question_id'];
$answers[$answer_key]['score'] = $exact_answers[0]['score']; $answers[$answer_key]['score'] = $exact_answers[0]['score'];
$answers[$answer_key]['score_answer_id'] = $exact_answers[0]['score_answer_id']; $answers[$answer_key]['score_answer_id'] = $exact_answers[0]['score_answer_id'];
$answers[$answer_key]['isactive'] = $exact_answers[0]['isactive'];
} }
else else
{ {
@ -724,6 +725,7 @@ class Template_Management_Controller extends REST_Controller {
$answers[$answer_key]['fk_score_question_id'] = null; $answers[$answer_key]['fk_score_question_id'] = null;
$answers[$answer_key]['score'] = null; $answers[$answer_key]['score'] = null;
$answers[$answer_key]['score_answer_id'] = null; $answers[$answer_key]['score_answer_id'] = null;
$answers[$answer_key]['isactive'] = 1;
} }
} }