clickoptions feature from mark leeds
[openemr.git] / interface / patient_file / summary / allergies.php
blob4336ca718721c644c6db15ddde22a83ac84f8cb3
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 = "allergy";
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,"allergy",$_POST["title"],$_POST["comments"],1);
38 <html>
39 <head>
42 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
44 <?php
45 //CLICKOPTIONS by Mark Leeds 2005, see clickoptions.txt in openemr/custom/ directory for more info
46 include("clickoptions1.php");
49 </script>
50 </head>
51 <body <?echo $top_bg_line;?> topmargin=0 rightmargin=0 leftmargin=2 bottommargin=0 marginwidth=2 marginheight=0>
53 <table border=0 cellspacing=0 cellpadding=0 height=100%>
54 <tr>
55 <td background="<?echo $linepic;?>" width=7 height=100%>
56 &nbsp;
57 </td>
58 <td valign=top>
60 <a href="patient_summary.php" target="Main"><font class="title">Allergies</font><font class=back><?echo $tback;?></font></a>
61 <br>
63 <form border=0 method=post name=new_note action="allergies.php">
64 <input type=hidden name=mode value="new">
65 <input type=hidden name=active value="<?echo $active;?>">
67 <?php
68 //CLICKOPTIONS by Mark Leeds 2005, see clickoptions.txt in openemr/custom/ directory for more info
69 include("clickoptions2.php");
72 <input type=entry size=15 name=title value="" onfocus="javascript:this.value=''"><br>
73 <textarea name=comments rows=3 cols=15 wrap=virtual onfocus="javascript:this.value=''">Comments</textarea>
74 <br>
75 <a href="javascript:document.new_note.submit();" class=link_submit>[Add New Allergy]</a>
76 </form>
79 <form border=0 method=post name=update_activity action="allergies.php">
81 <input type=hidden name=mode value="update">
82 <input type=hidden name=active value="<?echo $active;?>">
84 <?//change the view on the current mode, whether all, active, or inactive
85 $all_class="link";$active_class="link";$inactive_class="link";
86 if ($active=="all") {
87 $all_class="link_selected";
88 } elseif ($active==1) {
89 $active_class="link_selected";
90 } elseif ($active==0) {
91 $inactive_class="link_selected";
97 <font class=text>View: </font>
98 <a href="allergies.php?offset=0&active=all" class=<?echo $all_class;?>>[All]</a>
99 <a href="allergies.php?offset=0&active=1" class=<?echo $active_class;?>>[Only Active]</a>
100 <a href="allergies.php?offset=0&active=0" class=<?echo $inactive_class;?>>[Only Inactive]</a>
102 <br>
103 <a href="javascript:document.update_activity.submit();" class=link_submit>[Change Activity]</a>
104 <br><br>
106 <span class=text>
108 if ($result = getListByType($pid, "allergy", "id,title,comments,activity,date", $active, "all", 0)){
109 foreach ($result as $iter) {
110 //echo "<dd>" . $iter{"title"} . "</dd>\n";
114 if ($iter{"activity"}) {
115 $checked = "checked";
116 } else {
117 $checked = "";
119 print "<input type=hidden value='' name=act".$iter{"id"}.">";
120 print "<input onClick='javascript:document.update_activity.act".$iter{"id"}.".value=this.checked' type=checkbox $checked>";
121 print "<font class=bold>".$iter{"title"} . "</font><font class=text>(".date("n/j/Y",strtotime($iter{"date"})).")</font><br>";
122 print "<font class=text>" . $iter{"comments"} . "</font><br>\n";
130 </span>
135 <br>
137 </form>
150 </td>
151 </tr>
152 </table>
155 </body>
156 </html>