echo lang('report_queries__assigned_selected_subset_of_size') . ': <B>' . $q['properties']['assigned_count'] . '</B>'; } else { echo lang('report_queries__assigned_all'); } } else { if ($q['properties']['selected'] == 'y') { echo lang('report_queries__deassigned_selected_subset_of_size') . ': <B>' . $q['properties']['assigned_count'] . '</B>'; } else { echo lang('report_queries__deassigned_all'); } } } echo '</TD>'; echo '<TD>'; $posted_query = $json->decode($q['json_query']); $pseudo_query_array = query__get_pseudo_query_array($posted_query['query']); $pseudo_query_display = query__display_pseudo_query($pseudo_query_array, true); echo $pseudo_query_display; //echo $q['json_query']; echo '</TD>'; echo '</TR>'; } echo '</table>'; echo '</TD></TR>'; ///////////////////////////// /// SUBJECT POOL STATISTICS ///////////////////////////// echo '<TR><TD>'; echo '<TABLE class="or_orr_section_head"><TR><TD align="center" valign="middle"> ' . lang('subject_pool_statistics') . ' </TD></TR></TABLE>';
function query__show_form($hide_modules, $experiment = array(), $load_query = "", $button_title = 'Search and show', $saved_queries = array(), $status_query = "", $formextra = "") { global $lang, $color; if (is_array($experiment) && isset($experiment['experiment_id']) && $experiment['experiment_id']) { $experiment_id = $experiment['experiment_id']; } else { $experiment_id = ""; } $prototypes = query__get_query_form_prototypes($hide_modules, $experiment_id, $status_query); //echo '<pre>'; var_dump($prototypes); echo '</pre>'; $done = query__echo_form_javascript($prototypes, $load_query); $pastitems = ""; $pastitemsdata = ""; $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); if (is_array($saved_queries) && count($saved_queries) > 0) { foreach ($saved_queries as $id => $query) { $decoded = $json->decode($query); $pastitems = $pastitems . '<a style="text-align: left;" onclick="javascript:loadFromObj(pastQueries[' . $id . ']); return false;">' . query__display_pseudo_query(query__get_pseudo_query_array($decoded['query'])) . '</a>'; $pastitemsdata = $pastitemsdata . $query; if (count($saved_queries) - 1 != $id) { $pastitems = $pastitems . '<hr>'; $pastitemsdata = $pastitemsdata . ','; } } } echo '<script>var pastQueries = [' . $pastitemsdata . '];</script>'; // display form table echo ' <form id="queryForm" action="' . thisdoc() . '" method="POST">'; if ($formextra) { echo $formextra; } if ($experiment_id) { echo '<INPUT type="hidden" name="experiment_id" value="' . $experiment_id . '">'; } echo ' <TABLE border=0 width=100%> <TR> <TD align=left> <TABLE width=100% border=0> <TR> <TD width="80" align=left style="font-size: 12pt; font-weight: bold;"> ' . str_replace(" ", " ", trim(lang('query_select_all'))) . ' </TD> <TD> </TD> <TD > <ul id="addDropdown" class="query_add"> <li><A HREF="#" class="button fa-plus-circle">' . lang('add_condition') . '</A> <ul id="protoDropdown"> </ul> </li> </ul> </TD> <TD align=right> <button class="button fa-eraser" style="font-size: 8pt;" onclick="javascript:clearQuery(); return false;">' . lang('reset_query_form') . '</button> </TD>'; if ($pastitemsdata) { echo ' <TD align=right width="205"> <ul id="savedDropdown" class="past_queries"> <li> <A HREF="#" class="button fa-file-text">' . lang('load_saved_query') . '</A> <ul id="saveDropdown"> ' . $pastitems . ' </ul> </li> </ul> </TD>'; } echo ' </TR> </TABLE> </TD> </TR>'; echo '<TR><TD> <table id="queryTable" width="100%">'; echo ' <tbody> </tbody> <tfoot> <tr> <td colspan=4> </td> </tr> </tfoot> </table> </TD></TR>'; echo ' <TR> <TD> <TABLE border=0 width=100%><TR>'; echo ' <TD align=right> <input type="hidden" name="search_submit" value="true"> <button name="search_submit" class="fa-search button" type="submit">' . $button_title . '</button> </TD> </TR></TABLE> </TD> </TR> </TABLE> </form>'; }