erx fix 4
[openemr.git] / templates / prescription / general_list.html
bloba23823f75e0ebd06be36e63a041e722b514c4329
1 <html>
2 <head>
3 {php}html_header_show();{/php}
4 <link rel="stylesheet" href="{php}echo $GLOBALS['css_header']; {/php}" type="text/css">
5 <script type="text/javascript" src="{$WEBROOT}/library/js/jquery-1.2.2.min.js"></script>
7 {literal}
8 <style type="text/css" title="mystyles" media="all">
9 .inactive {
10 color:#777777;
12 </style>
14 <script language="javascript">
16 function changeLinkHref(id,addValue,value) {
17 var myRegExp = new RegExp(":" + value + ":");
18 if (addValue){ //add value to href
19 document.getElementById(id).href += ':' + value + ':';
21 else { //remove value from href
22 document.getElementById(id).href = document.getElementById(id).href.replace(myRegExp,'');
26 function changeLinkHref_All(id,addValue,value) {
27 var myRegExp = new RegExp(":" + value + ":");
28 if (addValue){ //add value to href
29 document.getElementById(id).href += ':' + value + ':';
31 else { //remove value from href
32 document.getElementById(id).href = document.getElementById(id).href.replace(myRegExp,'');
33 document.getElementById(id).target = '';
37 function Check(chk) {
38 var len=chk.length;
39 if (len==undefined) {chk.checked=true;}
40 else {
41 for (pr = 0; pr < chk.length; pr++){
42 if($(chk[pr]).parents("tr.inactive").length==0)
44 chk[pr].checked=true;
45 changeLinkHref_All('multiprint',true,chk[pr].value);
46 changeLinkHref_All('multiprintcss',true, chk[pr].value);
47 changeLinkHref_All('multiprintToFax',true, chk[pr].value);
53 function Uncheck(chk) {
54 var len=chk.length;
55 if (len==undefined) {chk.checked=false;}
56 else {
57 for (pr = 0; pr < chk.length; pr++){
58 chk[pr].checked=false;
59 changeLinkHref_All('multiprint',false,chk[pr].value);
60 changeLinkHref_All('multiprintcss',false, chk[pr].value);
61 changeLinkHref_All('multiprintToFax',false, chk[pr].value);
66 var CheckForChecks = function(chk) {
67 // Checks for any checked boxes, if none are found than an alert is raised and the link is killed
68 if (Checking(chk) == false) { return false; }
69 return top.restoreSession();
72 function Checking(chk) {
73 var len=chk.length;
74 var foundone=false;
76 if (len==undefined) {
77 if (chk.checked == true){
78 foundone=true;
81 else {
82 for (pr = 0; pr < chk.length; pr++){
83 if (chk[pr].checked == true) {
84 foundone=true;
88 if (foundone) {
89 return true;
90 } else {
91 alert("{/literal}{xl t='Please select at least one prescription!'}{literal}");
92 return false;
96 </script>
98 {/literal}
99 </head>
100 <body class="body_top">
102 {if $prescriptions}
103 <span class="title"><b>{xl t='List'}</b></span>
105 <div id="prescription_list">
107 <form name="presc">
109 <div id="print_links">
110 <table width="100%">
111 <tr>
112 <td align="left">
113 <table>
114 <tr>
115 <td>
116 <a id="multiprint" href="{$CONTROLLER}prescription&multiprint&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Print'} ({xl t='PDF'})</span></a>
117 </td>
118 <td>
119 <a id="multiprintcss" href="{$CONTROLLER}prescription&multiprintcss&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Print'} ({xl t='HTML'})</span></a>
120 </td>
121 <td style="border-style:none;">
122 <a id="multiprintToFax" href="{$CONTROLLER}prescription&multiprintfax&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Print'} ({xl t='Fax'})</span></a>
123 </td>
124 {if $CAMOS_FORM == true}
125 <td>
126 <a id="four_panel_rx" href="{$WEBROOT}/interface/forms/CAMOS/rx_print.php?sigline=plain" onclick="top.restoreSession()" class="css_button"><span>{xl t='Print Four Panel'}</span></a>
127 </td>
128 {/if}
129 </tr>
130 </table>
131 </td>
132 <td align="right">
133 <table>
134 <tr>
135 <td>
136 <a href="#" class="small" onClick="Check(document.presc.check_list);"><span>{xl t='Check All'}</span></a> |
137 <a href="#" class="small" onClick="Uncheck(document.presc.check_list);"><span>{xl t='Clear All'}</span></a>
138 </td>
139 </tr>
140 </table>
141 </td>
142 </tr>
143 </table>
144 </div>
147 <table width="100%" class="showborder_head" cellspacing="0px" cellpadding="2px">
148 <tr>
149 <th width="8px">&nbsp;</th>
150 <th width="180px">{xl t='Drug'}</th>
151 <th>{xl t='Created'}<br />{xl t='Changed'}</th>
152 <th>{xl t='Dosage'}</th>
153 <th>{xl t='Qty'}.</th>
154 <th>{xl t='Unit'}</th>
155 <th>{xl t='Provider'}</th>
156 </tr>
158 {foreach from=$prescriptions item=prescription}
159 <tr id="{$prescription->id}" class="showborder onescript {if $prescription->active <= 0} inactive{/if}" title="{xl t='Click to view/edit'}">
160 <td align="center">
161 <input id="check_list" type="checkbox" value="{$prescription->id}" onclick="changeLinkHref('multiprint',this.checked, this.value);changeLinkHref('multiprintcss',this.checked, this.value);changeLinkHref('multiprintToFax',this.checked, this.value)" title="{xl t='Select for printing'}">
162 </td>
163 {if $prescription->erx_source==0}
164 <td class="editscript" id="{$prescription->id}">
165 <a class='editscript css_button_small' id='{$prescription->id}' href="controller.php?prescription&edit&id={$prescription->id}" style="margin-top:-2px"><span>{xl t='Edit'}</span></a>
166 {if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}&nbsp;
167 </td>
168 {else}
169 <td id="{$prescription->id}">
170 {if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}&nbsp;
171 </td>
172 {/if}
173 <td id="{$prescription->id}">
174 {$prescription->date_added}<br />
175 {$prescription->date_modified}&nbsp;
176 </td>
177 <td id="{$prescription->id}">
178 {$prescription->get_dosage_display()} &nbsp;
179 </td>
180 {if $prescription->erx_source==0}
181 <td class="editscript" id="{$prescription->id}">
182 {$prescription->quantity} &nbsp;
183 </td>
184 {else}
185 <td id="{$prescription->id}">
186 {$prescription->quantity} &nbsp;
187 </td>
188 {/if}
189 <td id="{$prescription->id}">
190 {$prescription->get_size()} {$prescription->get_unit_display()}&nbsp;
191 </td>
192 <td id="{$prescription->id}">
193 {$prescription->provider->get_name_display()}&nbsp;
194 </td>
195 </tr>
196 {/foreach}
197 </table>
199 </form>
200 </div>
202 {else}
203 <div class="text" style="margin-top:10px">{xl t='There are currently no prescriptions'}.</div>
204 {/if}
206 </body>
207 {literal}
208 <script language='JavaScript'>
210 $(document).ready(function(){
211 $("#multiprint").click(function() { return CheckForChecks(document.presc.check_list); });
212 $("#multiprintcss").click(function() { return CheckForChecks(document.presc.check_list); });
213 $("#multiprintToFax").click(function() { return CheckForChecks(document.presc.check_list); });
214 $(".editscript").click(function() { ShowScript(this); });
215 $(".onescript").mouseover(function() { $(this).children().toggleClass("highlight"); });
216 $(".onescript").mouseout(function() { $(this).children().toggleClass("highlight"); });
219 var ShowScript = function(eObj) {
220 top.restoreSession();
221 objID = eObj.id;
222 document.location.href="{/literal}{$WEB_ROOT}{literal}/controller.php?prescription&edit&id="+objID;
223 return true;
226 </script>
227 {/literal}
228 </html>