clickoptions feature from mark leeds
[openemr.git] / interface / patient_file / summary / medications.php
blob2f80b172a80f9c2f9e9bbdd1af23de16b421edd0
1 <?
2 include_once("../../globals.php");
3 include_once("$srcdir/lists.inc");
6 if (!isset($active)) {
7 $active="all";
10 //CLICKOPTIONS by Mark Leeds 2005, see clickoptions.txt in openemr/custom/ directory for more info
11 $clickoptions_category = "medication";
13 //this code handles changing the state of activity tags when the user updates them through the interface
14 if (isset($mode)) {
15 if ($mode == "update") {
16 foreach ($_POST as $var => $val) {
17 if ($val == "true" || $val == "false") {
18 $id = str_replace("act","",$var);
19 if ($val == "true") {reappearList ($id);}elseif($val=="false"){disappearList($id);};
20 //print "$id: $val > $act_state<br>\n";
24 } elseif ($mode == "new") {
25 addList($pid,"medication",$_POST["title"],$_POST["comments"],1);
31 <html>
32 <head>
35 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
37 <?php
38 //CLICKOPTIONS by Mark Leeds 2005, see clickoptions.txt in openemr/custom/ directory for more info
39 include("clickoptions1.php");
42 </head>
43 <body <?echo $top_bg_line;?> topmargin=0 rightmargin=0 leftmargin=2 bottommargin=0 marginwidth=2 marginheight=0>
45 <table border=0 cellspacing=0 cellpadding=0 height=100%>
46 <tr>
47 <td valign=top>
50 <a href="patient_summary.php" target="Main"><font class="title">Medications</font><font class=back><?echo $tback;?></font></a>
51 <br>
53 <form border=0 method=post name=new_note action="medications.php">
54 <input type=hidden name=mode value="new">
55 <input type=hidden name=active value="<?echo $active;?>">
57 <?php
58 //CLICKOPTIONS by Mark Leeds 2005, see clickoptions.txt in openemr/custom/ directory for more info
59 include("clickoptions2.php");
62 <input type=entry size=15 name=title value="" onfocus="javascript:this.value=''"><br>
63 <textarea name=comments rows=3 cols=15 wrap=virtual onfocus="javascript:this.value=''">Comments</textarea>
64 <br>
65 <a href="javascript:document.new_note.submit();" class=link_submit>[Add New Medication]</a>
66 </form>
69 <form border=0 method=post name=update_activity action="medications.php">
71 <input type=hidden name=mode value="update">
72 <input type=hidden name=active value="<?echo $active;?>">
74 <?//change the view on the current mode, whether all, active, or inactive
75 $all_class="link";$active_class="link";$inactive_class="link";
76 if ($active=="all") {
77 $all_class="link_selected";
78 } elseif ($active==1) {
79 $active_class="link_selected";
80 } elseif ($active==0) {
81 $inactive_class="link_selected";
87 <font class=text>View: </font>
88 <a href="medications.php?offset=0&active=all" class=<?echo $all_class;?>>[All]</a>
89 <a href="medications.php?offset=0&active=1" class=<?echo $active_class;?>>[Only Active]</a>
90 <a href="medications.php?offset=0&active=0" class=<?echo $inactive_class;?>>[Only Inactive]</a>
92 <br>
93 <a href="javascript:document.update_activity.submit();" class=link_submit>[Change Activity]</a>
94 <br><br>
96 <span class=text>
98 if ($result = getListByType($pid, "medication", "id,title,comments,activity,date", $active, "all", 0)){
99 foreach ($result as $iter) {
100 //echo "<dd>" . $iter{"title"} . "</dd>\n";
104 if ($iter{"activity"}) {
105 $checked = "checked";
106 } else {
107 $checked = "";
109 print "<input type=hidden value='' name=act".$iter{"id"}.">";
110 print "<input onClick='javascript:document.update_activity.act".$iter{"id"}.".value=this.checked' type=checkbox $checked>";
111 print "<font class=bold>".$iter{"title"} . "</font><font class=text>(".date("n/j/Y",strtotime($iter{"date"})).")</font><br>";
112 print "<font class=text>" . $iter{"comments"} . "</font><br>\n";
120 </span>
125 <br>
127 </form>
131 </td></tr></table>
140 </body>
141 </html>