ut-1 quest filter : ps
This commit is contained in:
parent
83088a1b26
commit
a345bb3305
@ -1319,9 +1319,12 @@ class Template_Management_Controller extends REST_Controller {
|
|||||||
$json_table = $this->Template_Management_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATE_JSON_V2);
|
$json_table = $this->Template_Management_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATE_JSON_V2);
|
||||||
if(count($json_table)>0){
|
if(count($json_table)>0){
|
||||||
$json = json_decode($json_table[0]['json'],true);
|
$json = json_decode($json_table[0]['json'],true);
|
||||||
$quest = $json['questions'];
|
if(isset($value1['questions'][0]['question_key']) ){
|
||||||
if($form_id == 19) $quest = $json['questions'][0]['question'];
|
$quest = $json['questions'];
|
||||||
// ch(1,2,22,20,11,13)
|
}else{
|
||||||
|
$quest = $json['questions'][0]['question'];
|
||||||
|
}
|
||||||
|
// re-check (1,2) // done (5,19,14,24,20,22) //ok-but-doubt (13,11)
|
||||||
// print_r($quest);die();
|
// print_r($quest);die();
|
||||||
$filter_arr = array();
|
$filter_arr = array();
|
||||||
//try 4
|
//try 4
|
||||||
@ -1358,7 +1361,8 @@ class Template_Management_Controller extends REST_Controller {
|
|||||||
public function call_arr1($quest){
|
public function call_arr1($quest){
|
||||||
$return_arr = array();
|
$return_arr = array();
|
||||||
$i = 0 ;
|
$i = 0 ;
|
||||||
if(!empty($quest)){
|
if((!empty($quest)) && (is_array($quest) || is_object($quest)) )
|
||||||
|
{
|
||||||
foreach ($quest as $key => $value) {
|
foreach ($quest as $key => $value) {
|
||||||
// $return_arr[$i] = array('question'=> $value['question'],'question_key'=>$value['question_key']);
|
// $return_arr[$i] = array('question'=> $value['question'],'question_key'=>$value['question_key']);
|
||||||
// $return_arr[$i]['question'] = $value['question'];
|
// $return_arr[$i]['question'] = $value['question'];
|
||||||
@ -1374,7 +1378,7 @@ class Template_Management_Controller extends REST_Controller {
|
|||||||
public function call_arr2($quest){
|
public function call_arr2($quest){
|
||||||
$return_arr = array();
|
$return_arr = array();
|
||||||
$i = 0 ;
|
$i = 0 ;
|
||||||
if(!empty($quest)){
|
if(!empty($quest) && is_array($quest) || is_object($quest)){
|
||||||
foreach ($quest as $key => $value) {
|
foreach ($quest as $key => $value) {
|
||||||
if((isset($value['onchange_properties'])) && (!empty($value['onchange_properties'])) && ($value['onchange_properties'] != null)){
|
if((isset($value['onchange_properties'])) && (!empty($value['onchange_properties'])) && ($value['onchange_properties'] != null)){
|
||||||
$onchange_properties = isset($value['onchange_properties'][0]['form_controls']) ? $value['onchange_properties'][0]['form_controls'] : array();
|
$onchange_properties = isset($value['onchange_properties'][0]['form_controls']) ? $value['onchange_properties'][0]['form_controls'] : array();
|
||||||
@ -1382,11 +1386,17 @@ class Template_Management_Controller extends REST_Controller {
|
|||||||
if($count>0 && !empty($onchange_properties)){
|
if($count>0 && !empty($onchange_properties)){
|
||||||
foreach ($onchange_properties as $key1 => $value1) {
|
foreach ($onchange_properties as $key1 => $value1) {
|
||||||
if($value1['insert_index'] == $value['question_key']){
|
if($value1['insert_index'] == $value['question_key']){
|
||||||
$temp[$i] = $this->call_arr1($value1['questions']);
|
if(isset($value1['questions'][0]['question_key'])){
|
||||||
$arr2 = $this->call_arr2($value1['questions']);
|
$temp[$i] = $this->call_arr1($value1['questions']);
|
||||||
// $arr1 = $this->call_arr1($value1['questions']);
|
$arr2 = $this->call_arr2($value1['questions']);
|
||||||
// $arr2[$i]['child'] = $this->call_arr2($temp[$i],$arr2);
|
// $arr1 = $this->call_arr1($value1['questions']);
|
||||||
$return_arr[$i] = $this->merged_arr($temp[$i],$arr2);
|
// $arr2[$i]['child'] = $this->call_arr2($temp[$i],$arr2);
|
||||||
|
$return_arr[$i] = $this->merged_arr($temp[$i],$arr2);
|
||||||
|
}else{
|
||||||
|
$temp[$i] = $this->call_arr1($value1['questions'][0]['question']);
|
||||||
|
$arr2 = $this->call_arr2($value1['questions'][0]['question']);
|
||||||
|
$return_arr[$i] = $this->merged_arr($temp[$i],$arr2);
|
||||||
|
}
|
||||||
// foreach($value1['question'] as $key2 => $value2){
|
// foreach($value1['question'] as $key2 => $value2){
|
||||||
// $temp2[$i] = $this->call_arr1($value2['question']);
|
// $temp2[$i] = $this->call_arr1($value2['question']);
|
||||||
// $arr3 = $this->call_arr2($value2['question']);
|
// $arr3 = $this->call_arr2($value2['question']);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user