<option value="ja">Japanese</option> <option value="ko">Korean</option> <option value="pt-BR">Portuguese</option> <option value="ru">Russian</option> <option value="es-AR">Spanish</option> </select> <table class='table table-striped'> <th>Regulatory</th> <tbody> <input type='hidden' name='type' value='reg'/> <?php #Regulatory foreach($reglist as $k => $result) { if($result['active'] == 'Y') { $responses = $myJSONRPCClient->export_responses( $sessionKey, $result['sid'], 'json', 'en', 'complete','short', 'long'); $valid = false; if(!isset($responses['status'])) { $json = base64_decode($responses); $decoded = json_decode( $json, true ); foreach ($decoded['responses'] as $key => $jsons) { // This will search in the 2 jsons foreach($jsons as $key => $pairs) { $valid = true; break; } } } if($valid){ print "<tr><td><input type='checkbox' name='id[]' value='" . $result['sid'] . "|" . $k . "'><label>" . $k . "</label></td></tr>"; } }
$lang = 'en'; } #$survey_ids = array(147451); // instanciate a new client $myJSONRPCClient = new JsonRPCClient( LS_BASEURL.'/admin/remotecontrol' ); // receive session key $sessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD ); $results = array(); $i = 0; // receive all ids and info of groups belonging to a given survey foreach($survey_ids as $survey_id) { $responses = $myJSONRPCClient->export_responses( $sessionKey, $survey_id, 'json', $lang, 'complete','short', 'long'); $title = $titles[$i]; if(!isset($responses['status'])) { $json = base64_decode($responses); $decoded = json_decode( $json, true ); $processed_pairs = array(); foreach ($decoded['responses'] as $key => $jsons) { // This will search in the 2 jsons foreach($jsons as $key => $pairs) { foreach($pairs as $key => $value) { if(preg_match("/^G[^2]*Q[0-9]*/", $key) == True) { $processed_pairs[$key] = $value; } } $processed_pairs['title'] = $title; #array_push($results, $processed_pairs); $results[$title] = $processed_pairs;