Merge branch 'work1'
[openemr.git] / templates / prescription / general_list.html
blobb10f71db0b4bcb5fc6f10a03bb8a4cc1ca568393
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 chk[pr].checked=true;
43 changeLinkHref_All('multiprint',true,chk[pr].value);
44 changeLinkHref_All('multiprintcss',true, chk[pr].value);
45 changeLinkHref_All('multiprintToFax',true, chk[pr].value);
50 function Uncheck(chk) {
51 var len=chk.length;
52 if (len==undefined) {chk.checked=false;}
53 else {
54 for (pr = 0; pr < chk.length; pr++){
55 chk[pr].checked=false;
56 changeLinkHref_All('multiprint',false,chk[pr].value);
57 changeLinkHref_All('multiprintcss',false, chk[pr].value);
58 changeLinkHref_All('multiprintToFax',false, chk[pr].value);
63 var CheckForChecks = function(chk) {
64 // Checks for any checked boxes, if none are found than an alert is raised and the link is killed
65 if (Checking(chk) == false) { return false; }
66 return top.restoreSession();
69 function Checking(chk) {
70 var len=chk.length;
71 var foundone=false;
73 if (len==undefined) {
74 if (chk.checked == true){
75 foundone=true;
78 else {
79 for (pr = 0; pr < chk.length; pr++){
80 if (chk[pr].checked == true) {
81 foundone=true;
85 if (foundone) {
86 return true;
87 } else {
88 alert("{/literal}{xl t='Please select at least one prescription!'}{literal}");
89 return false;
93 </script>
95 {/literal}
96 </head>
97 <body class="body_top">
99 {if $prescriptions}
100 <span class="title"><b>{xl t='List'}</b></span>
102 <div id="prescription_list">
104 <form name="presc">
106 <div id="print_links">
107 <table width="100%">
108 <tr>
109 <td align="left">
110 <table>
111 <tr>
112 <td>
113 <a id="multiprint" href="{$CONTROLLER}prescription&multiprint&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Print'} ({xl t='PDF'})</span></a>
114 </td>
115 <td>
116 <a id="multiprintcss" href="{$CONTROLLER}prescription&multiprintcss&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Print'} ({xl t='HTML'})</span></a>
117 </td>
118 <td style="border-style:none;">
119 <a id="multiprintToFax" href="{$CONTROLLER}prescription&multiprintfax&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Print'} ({xl t='Fax'})</span></a>
120 </td>
121 {if $CAMOS_FORM == true}
122 <td>
123 <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>
124 </td>
125 {/if}
126 </tr>
127 </table>
128 </td>
129 <td align="right">
130 <table>
131 <tr>
132 <td>
133 <a href="#" class="small" onClick="Check(document.presc.check_list);"><span>{xl t='Check All'}</span></a> |
134 <a href="#" class="small" onClick="Uncheck(document.presc.check_list);"><span>{xl t='Clear All'}</span></a>
135 </td>
136 </tr>
137 </table>
138 </td>
139 </tr>
140 </table>
141 </div>
144 <table width="100%" class="showborder_head" cellspacing="0px" cellpadding="2px">
145 <tr>
146 <th width="8px">&nbsp;</th>
147 <th width="180px">{xl t='Drug'}</th>
148 <th>{xl t='Created'}<br />{xl t='Changed'}</th>
149 <th>{xl t='Dosage'}</th>
150 <th>{xl t='Qty'}.</th>
151 <th>{xl t='Unit'}</th>
152 <th>{xl t='Provider'}</th>
153 </tr>
155 {foreach from=$prescriptions item=prescription}
156 <tr id="{$prescription->id}" class="showborder onescript {if $prescription->active <= 0} inactive{/if}" title="{xl t='Click to view/edit'}">
157 <td align="center">
158 <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'}">
159 </td>
160 <td class="editscript" id="{$prescription->id}">
161 <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>
162 {if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}&nbsp;
163 </td>
164 <td id="{$prescription->id}">
165 {$prescription->date_added}<br />
166 {$prescription->date_modified}&nbsp;
167 </td>
168 <td id="{$prescription->id}">
169 {$prescription->get_dosage_display()} &nbsp;
170 </td>
171 <td class="editscript" id="{$prescription->id}">
172 {$prescription->quantity} &nbsp;
173 </td>
174 <td id="{$prescription->id}">
175 {$prescription->get_size()} {$prescription->get_unit_display()}&nbsp;
176 </td>
177 <td id="{$prescription->id}">
178 {$prescription->provider->get_name_display()}&nbsp;
179 </td>
180 </tr>
181 {/foreach}
182 </table>
184 </form>
185 </div>
187 {else}
188 <div class="text" style="margin-top:10px">{xl t='There are currently no prescriptions'}.</div>
189 {/if}
191 </body>
192 {literal}
193 <script language='JavaScript'>
195 $(document).ready(function(){
196 $("#multiprint").click(function() { return CheckForChecks(document.presc.check_list); });
197 $("#multiprintcss").click(function() { return CheckForChecks(document.presc.check_list); });
198 $("#multiprintToFax").click(function() { return CheckForChecks(document.presc.check_list); });
199 $(".editscript").click(function() { ShowScript(this); });
200 $(".onescript").mouseover(function() { $(this).children().toggleClass("highlight"); });
201 $(".onescript").mouseout(function() { $(this).children().toggleClass("highlight"); });
204 var ShowScript = function(eObj) {
205 top.restoreSession();
206 objID = eObj.id;
207 document.location.href="{/literal}{$WEB_ROOT}{literal}/controller.php?prescription&edit&id="+objID;
208 return true;
211 </script>
212 {/literal}
213 </html>