supplier and client fixes : ps
This commit is contained in:
parent
c7e1d506f0
commit
1b4aa61511
@ -1331,8 +1331,8 @@ class Template_Management_Controller extends REST_Controller {
|
||||
$filter_arr = array();
|
||||
//try 4
|
||||
if(!empty($quest)){
|
||||
$arr1 = $this->call_arr1($quest,$_GET['form_id']);
|
||||
$arr2 = $this->call_arr2($quest,$_GET['form_id']);
|
||||
$arr1 = $this->call_arr1($quest);
|
||||
$arr2 = $this->call_arr2($quest);
|
||||
$filter_arr = $this->merged_arr($arr1,$arr2);
|
||||
}
|
||||
|
||||
@ -1360,7 +1360,7 @@ class Template_Management_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
//Step 1 : Question Filter Only
|
||||
public function call_arr1($quest,$fid){
|
||||
public function call_arr1($quest){
|
||||
$return_arr = array();
|
||||
$i = 0 ;
|
||||
if((!empty($quest)) && (is_array($quest) || is_object($quest)) )
|
||||
@ -1377,7 +1377,7 @@ class Template_Management_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
//Step 2 : Onchange fns - Question Filter
|
||||
public function call_arr2($quest,$fid){
|
||||
public function call_arr2($quest){
|
||||
$return_arr = array();
|
||||
$i = 0 ;
|
||||
if(!empty($quest) && is_array($quest) || is_object($quest)){
|
||||
@ -1387,26 +1387,43 @@ class Template_Management_Controller extends REST_Controller {
|
||||
$count = isset($onchange_properties) ? count($onchange_properties) : 0 ;
|
||||
if($count>0 && !empty($onchange_properties)){
|
||||
foreach ($onchange_properties as $key1 => $value1) {
|
||||
// if($value1['question_key'] == 'Payment_Terms'){
|
||||
// echo "I have step 1";
|
||||
// echo($value['question_key']);
|
||||
// echo $value1['question_key'];}
|
||||
if($value1['insert_index'] == $value['question_key']){
|
||||
if(count($value1['questions']) > 1 && ($fid == 1 || $fid == 2)){
|
||||
for($j = 0 ;$j < count($value1['questions']);$j++){
|
||||
$temp[$i] = $this->call_arr1($value1['questions'][$j]['question'],$fid);
|
||||
$arr2 = $this->call_arr2($value1['questions'][$j]['question'],$fid);
|
||||
$return_arr[$i] = $this->merged_arr($temp[$i],$arr2);
|
||||
if(count($value1['questions']) > 0){
|
||||
// echo " 8-i".$i;
|
||||
for($j = 0 ;$j<count($value1['questions']);$j++){
|
||||
// if($value['question_key'] == 'Payment_Terms'){
|
||||
// print_r($value1['questions']);
|
||||
// echo count($value1['questions']);
|
||||
// print_r($this->call_arr1($value1['questions'],$fid)); run
|
||||
// print_r($this->call_arr2($value1['questions'][$j]['question']));
|
||||
// echo " <br> parent ".$value['question_key'];
|
||||
$latest_quest = isset($value1['questions'][$j]['question_key']) ? $value1['questions'] : $value1['questions'][$j]['question'];
|
||||
$temp[$i] = $this->call_arr1($latest_quest);
|
||||
$arr2 = $this->call_arr2($latest_quest);
|
||||
$return_arr[$i] = $this->merged_arr($temp[$i],$arr2);
|
||||
// }
|
||||
// $temp[$i] = $this->call_arr1($value1['questions'][$j]['question'],$fid);
|
||||
// $arr2 = $this->call_arr2($value1['questions'][$j]['question'],$fid);
|
||||
// $return_arr[$i] = $this->merged_arr($temp[$i],$arr2);
|
||||
}
|
||||
}else{
|
||||
if(isset($value1['questions'][0]['question_key'])){
|
||||
$temp[$i] = $this->call_arr1($value1['questions'],$fid);
|
||||
$arr2 = $this->call_arr2($value1['questions'],$fid);
|
||||
// $arr1 = $this->call_arr1($value1['questions']);
|
||||
// $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'],$fid);
|
||||
$arr2 = $this->call_arr2($value1['questions'][0]['question'],$fid);
|
||||
$return_arr[$i] = $this->merged_arr($temp[$i],$arr2);
|
||||
}
|
||||
}
|
||||
// else{
|
||||
// if(isset($value1['questions'][0]['question_key'])){
|
||||
// $temp[$i] = $this->call_arr1($value1['questions'],$fid);
|
||||
// $arr2 = $this->call_arr2($value1['questions'],$fid);
|
||||
// // $arr1 = $this->call_arr1($value1['questions']);
|
||||
// // $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'],$fid);
|
||||
// $arr2 = $this->call_arr2($value1['questions'][0]['question'],$fid);
|
||||
// $return_arr[$i] = $this->merged_arr($temp[$i],$arr2);
|
||||
// }
|
||||
// }
|
||||
// foreach($value1['question'] as $key2 => $value2){
|
||||
// $temp2[$i] = $this->call_arr1($value2['question']);
|
||||
// $arr3 = $this->call_arr2($value2['question']);
|
||||
@ -1422,7 +1439,7 @@ class Template_Management_Controller extends REST_Controller {
|
||||
return $return_arr;
|
||||
}
|
||||
|
||||
//Step 3 : Mapping Here for single-array using 2-array(arr1,arr2)
|
||||
//Step 3 : Mapping Here for single-array using 2-array(arr1,arr2) ---- Short description is "array associate"
|
||||
public function merged_arr($arr1,$arr2){
|
||||
$final_result = array();
|
||||
foreach($arr1 as $key=>$val){ // Loop though one array
|
||||
@ -1439,4 +1456,11 @@ class Template_Management_Controller extends REST_Controller {
|
||||
}
|
||||
return $final_result;
|
||||
}
|
||||
|
||||
//Step 4 : description - to get un-associated array.
|
||||
// public function arr_formation_for_associate(){
|
||||
// $return_arr = array();
|
||||
// $i = 0 ;
|
||||
// }
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user