$ids = $object[$i][1][$j]->{$idsub}; $keys = 'idsub_' . $ids; $inskey = 'insinfo'; if (isset($getmoresubinfo[$keys])) { $id_investor = $getmoresubinfo[$keys]; $id_investor = 'idins_' . $id_investor; if (isset($getallinvestor[$id_investor])) { $object[$i][1][$j]->{$inskey} = $getallinvestor[$id_investor]; } else { $object[$i][1][$j]->{$inskey} = ''; } } else { $object[$i][1][$j]->{$inskey} = ''; } /* * Lấy thông tin hs */ $hskey = 'hoso'; $object[$i][1][$j]->{$hskey} = getdocs_in_a_sub($ids); } } return $object; } $rs = returnresult($object, $getmoresubinfo, $getallinvestor); echo json_encode($rs); //echo json_encode($allins); //echo $time_elapsed_us = microtime(true) - $start; CLOSE_DB(); unset($sql, $result, $rs); ?>
$keyword = "id_" . $row['ID']; $data["{$keyword}"] = $tmp; } return $data; } function returnresult($allpc) { $object = array(); foreach ($allpc as $key => $item) { $tmp = array('pc_name' => $item['name_pwc'], 'list_users' => getalluser($item['ID'])); //array_push($object, $tmp); $keyword = "pcid_" . $item['ID']; $object["{$keyword}"] = $tmp; } // for ($i=0; $i<sizeof($allpc); $i++){ // $tmp = array( // 'pc_name' => $allpc[$i]['name_pwc'], // 'list_users' => getalluser($allpc[$i]['ID']) // ); // array_push($object, $tmp); // } return $object; } $rs = returnresult($allpc); echo json_encode($rs); //echo json_encode($allins); //echo $time_elapsed_us = microtime(true) - $start; CLOSE_DB(); unset($sql, $result, $rs); ?>
$object[$i]['pcinfo'] = ''; } $tmp = array(); for ($j = 0; $j < sizeof($object[$i][1]); $j++) { $ids = $object[$i][1][$j]->{$idsub}; $keys = 'idsub_' . $ids; $subkey = 'subinfo'; $inskey = 'insinfo'; if (isset($allsub[$keys])) { $object[$i][1][$j]->{$subkey} = $allsub[$keys]; } else { $object[$i][1][$j]->{$subkey} = ''; } $investorid = 'idins_' . $allsub[$keys]['id_investor']; if (isset($allins[$investorid])) { $object[$i][1][$j]->{$inskey} = $allins[$investorid]; } else { $object[$i][1][$j]->{$inskey} = ''; } } } return $object; } $rs = returnresult($object, $allpc, $allsub, $allins); echo json_encode($rs); //echo json_encode($allins); //echo $time_elapsed_us = microtime(true) - $start; CLOSE_DB(); unset($sql, $result, $rs); ?>