2 // This program is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU General Public License
4 // as published by the Free Software Foundation; either version 2
5 // of the License, or (at your option) any later version.
7 include_once("../../globals.php");
11 <?php
html_header_show();?
>
12 <link rel
="stylesheet" href
="<?php echo $css_header; ?>" type
="text/css">
14 <script language
="JavaScript">
16 function openNewForm(sel
) {
18 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
19 parent
.location
.href
= sel
.options
[sel
.selectedIndex
].value
;
21 top
.frames
['Main'].location
.href
= sel
.options
[sel
.selectedIndex
].value
;
28 <body
class="body_top">
30 <?php
//DYNAMIC FORM RETREIVAL
31 include_once("$srcdir/registry.inc");
33 function myGetRegistered($state="1", $limit="unlimited", $offset="0") {
34 $sql = "SELECT category, nickname, name, state, directory, id, sql_run, " .
35 "unpackaged, date FROM registry WHERE " .
36 "state LIKE \"$state\" ORDER BY category, priority, name";
37 if ($limit != "unlimited") $sql .= " limit $limit, $offset";
38 $res = sqlStatement($sql);
40 for($iter=0; $row=sqlFetchArray($res); $iter++
) {
50 $reg = myGetRegistered();
52 echo "<FORM METHOD=POST NAME='choose'>\n";
54 foreach ($reg as $entry) {
55 $new_category = trim($entry['category']);
56 $new_nickname = trim($entry['nickname']);
57 if ($new_category == '') {$new_category = 'miscellaneous';}
58 if ($new_nickname != '') {$nickname = $new_nickname;}
59 else {$nickname = $entry['name'];}
60 if ($old_category != $new_category) {
61 $new_category_ = $new_category;
62 $new_category_ = str_replace(' ','_',$new_category_);
63 if ($old_category != '') {echo "</select>\n";}
64 echo "<select name=" . $new_category_ . " onchange='openNewForm(this)'>\n";
65 echo " <option value=" . $new_category_ . ">" . $new_category . "</option>\n";
66 $old_category = $new_category;
68 echo " <option value='" . $rootdir .
69 '/patient_file/encounter/load_form.php?formname=' .
70 urlencode($entry['directory']) . "'>" . xl_form_title($nickname) . "</option>\n";
75 // This shows Layout Based Form names just like the above.
77 $lres = sqlStatement("SELECT * FROM list_options " .
78 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
79 if (sqlNumRows($lres)) {
80 echo "<select name='lbfnames' onchange='openNewForm(this)'>\n";
81 echo "<option value='lbfnames'>" . xl('Layout Based') . "</option>\n";
82 while ($lrow = sqlFetchArray($lres)) {
83 $option_id = $lrow['option_id']; // should start with LBF
84 $title = $lrow['title'];
85 echo "<option value='$rootdir/patient_file/encounter/load_form.php?" .
86 "formname=$option_id'>" . xl_form_title($title) . "</option>\n";