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");
8 require_once $GLOBALS['srcdir'].'/ESign/Api.php';
10 $esignApi = new Esign\
Api();
14 <?php
html_header_show();?
>
15 <link rel
="stylesheet" href
="<?php echo $css_header; ?>" type
="text/css">
17 <script language
="JavaScript">
19 function openNewForm(sel
) {
21 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
22 FormNameValueArray
= sel
.split('formname=');
23 if(FormNameValueArray
[1] == 'newpatient')
25 parent
.location
.href
= sel
29 parent
.Forms
.location
.href
= sel
;
32 top
.frames
['Main'].location
.href
= sel
;
35 function toggleFrame1(fnum
) {
36 top
.frames
['left_nav'].document
.forms
[0].cb_top
.checked
=false;
37 top
.window
.parent
.left_nav
.toggleFrame(fnum
);
40 <style type
="text/css">
48 <script type
="text/javascript" language
="javascript">
53 var oldddmenuitem
= 0;
65 //if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
66 //if(ddmenuitem) ddmenuitem.style.display = 'none';
68 // get new layer and show it
69 oldddmenuitem
= ddmenuitem
;
70 ddmenuitem
= document
.getElementById(id
);
71 if((ddmenuitem
.style
.visibility
== '')||
(ddmenuitem
.style
.visibility
== 'hidden')){
72 if(oldddmenuitem
) oldddmenuitem
.style
.visibility
= 'hidden';
73 if(oldddmenuitem
) oldddmenuitem
.style
.display
= 'none';
74 ddmenuitem
.style
.visibility
= 'visible';
75 ddmenuitem
.style
.display
= 'block';
77 ddmenuitem
.style
.visibility
= 'hidden';
78 ddmenuitem
.style
.display
= 'none';
89 if(ddmenuitem
) ddmenuitem
.style
.visibility
= 'hidden';
90 if(ddmenuitem
) ddmenuitem
.style
.display
= 'none';
93 // close layer when click-out
94 document
.onclick
= mclose
;
95 //=================================================
98 obj
=document
.getElementById(id
);
103 curleft +
= obj
.offsetLeft
;
104 if(!obj
.offsetParent
)
106 obj
= obj
.offsetParent
;
110 PropertyWidth
=document
.getElementById(id
).offsetWidth
;
111 if(PropertyWidth
>curleft
)
113 document
.getElementById(id
).style
.left
=0;
117 function findPosY(obj
)
123 curtop +
= obj
.offsetTop
;
124 if(!obj
.offsetParent
)
126 obj
= obj
.offsetParent
;
135 <body
class="bgcolor2">
137 <?php
//DYNAMIC FORM RETREIVAL
138 include_once("$srcdir/registry.inc");
140 function myGetRegistered($state="1", $limit="unlimited", $offset="0") {
141 $sql = "SELECT category, nickname, name, state, directory, id, sql_run, " .
142 "unpackaged, date FROM registry WHERE " .
143 "state LIKE \"$state\" ORDER BY category, priority, name";
144 if ($limit != "unlimited") $sql .= " limit $limit, $offset";
145 $res = sqlStatement($sql);
147 for($iter=0; $row=sqlFetchArray($res); $iter++
) {
157 $reg = myGetRegistered();
162 // To see if the encounter is locked. If it is, no new forms can be created
163 $encounterLocked = false;
164 if ( $esignApi->lockEncounters() &&
165 isset($GLOBALS['encounter']) &&
166 !empty($GLOBALS['encounter']) ) {
168 $esign = $esignApi->createEncounterESign( $GLOBALS['encounter'] );
169 if ( $esign->isLocked() ) {
170 $encounterLocked = true;
175 $StringEcho= '<ul id="sddm">';
177 $StringEcho.= "<li><a id='enc2' >" . htmlspecialchars( xl('Encounter Summary'),ENT_NOQUOTES
) . "</a></li>";
179 $StringEcho.= "<li><a href='JavaScript:void(0);' id='enc2' onclick=\" return top.window.parent.left_nav.loadFrame2('enc2','RBot','patient_file/encounter/encounter_top.php')\">" . htmlspecialchars( xl('Encounter Summary'),ENT_NOQUOTES
) . "</a></li>";
181 if ( $encounterLocked === false ) {
182 foreach ($reg as $entry) {
183 $new_category = trim($entry['category']);
184 $new_nickname = trim($entry['nickname']);
185 if ($new_category == '') {$new_category = htmlspecialchars(xl('Miscellaneous'),ENT_QUOTES
);}
186 if ($new_nickname != '') {$nickname = $new_nickname;}
187 else {$nickname = $entry['name'];}
188 if ($old_category != $new_category) {
189 $new_category_ = $new_category;
190 $new_category_ = str_replace(' ','_',$new_category_);
191 if ($old_category != '') {$StringEcho.= "</table></div></li>";}
192 $StringEcho.= "<li class=\"encounter-form-category-li\"><a href='JavaScript:void(0);' onClick=\"mopen('$DivId');\" >$new_category</a><div id='$DivId' ><table border='0' cellspacing='0' cellpadding='0'>";
193 $old_category = $new_category;
196 $StringEcho.= "<tr><td style='border-top: 1px solid #000000;padding:0px;'><a onclick=\"openNewForm('" . $rootdir .'/patient_file/encounter/load_form.php?formname=' .urlencode($entry['directory']) .
197 "')\" href='JavaScript:void(0);'>" . xl_form_title($nickname) . "</a></td></tr>";
200 $StringEcho.= '</table></div></li>';
203 $StringEcho2= '<div style="clear:both"></div>';
208 <!--<table style
="border:solid 1px black" cellspacing
="0" cellpadding
="0">
210 <td valign
="top"><?php
//echo $StringEcho; ?></td>
215 // This shows Layout Based Form names just like the above.
217 if ( $encounterLocked === false ) {
218 $lres = sqlStatement("SELECT * FROM list_options " .
219 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
220 if (sqlNumRows($lres)) {
222 $StringEcho= '<ul id="sddm">';
224 $StringEcho.= "<li class=\"encounter-form-category-li\"><a href='JavaScript:void(0);' onClick=\"mopen('lbf');\" >".xl('Layout Based') ."</a><div id='lbf' ><table border='0' cellspacing='0' cellpadding='0'>";
225 while ($lrow = sqlFetchArray($lres)) {
226 $option_id = $lrow['option_id']; // should start with LBF
227 $title = $lrow['title'];
228 $StringEcho.= "<tr><td style='border-top: 1px solid #000000;padding:0px;'><a href='" . $rootdir .'/patient_file/encounter/load_form.php?formname='
229 .urlencode($option_id) ."' >" . xl_form_title($title) . "</a></td></tr>";
234 $StringEcho.= "</table></div></li></ul>".$StringEcho2;
237 <table cellspacing
="0" cellpadding
="0" align
="center">
239 <td valign
="top"><?php
echo $StringEcho; ?
></td
>