clickoptions feature from mark leeds
[openemr.git] / interface / patient_file / summary / surgeries.php
blob109859c0f4256b7e9e872d73e7921ef0dd6902cb
1 <?
2 include_once("../../globals.php");
3 include_once("$srcdir/lists.inc");
5 if (!isset($active)) {
6 $active="all";
9 //CLICKOPTIONS by Mark Leeds 2005, see clickoptions.txt in openemr/custom/ directory for more info
10 $clickoptions_category = "surgery";
12 //this code handles changing the state of activity tags when the user updates them through the interface
13 if (isset($mode)) {
14 if ($mode == "update") {
15 foreach ($_POST as $var => $val) {
16 if ($val == "true" || $val == "false") {
17 $id = str_replace("act","",$var);
18 if ($val == "true") {reappearList ($id);}elseif($val=="false"){disappearList($id);};
19 //print "$id: $val > $act_state<br>\n";
23 } elseif ($mode == "new") {
24 addList($pid,"surgery",$_POST["title"], $_POST["comments"],1);
30 <html>
31 <head>
33 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
35 <?php
36 //CLICKOPTIONS by Mark Leeds 2005, see clickoptions.txt in openemr/custom/ directory for more info
37 include("clickoptions1.php");
40 </head>
41 <body <?echo $top_bg_line;?> topmargin=0 rightmargin=0 leftmargin=2 bottommargin=0 marginwidth=2 marginheight=0>
43 <table border=0 cellspacing=0 cellpadding=0 height=100%>
44 <tr>
45 <td background="<?echo $linepic;?>" width=7 height=100%>
46 &nbsp;
47 </td>
48 <td valign=top>
50 <a href="patient_summary.php" target="Main"><font class="title">Surgeries</font><font class=back><?echo $tback;?></font></a>
51 <br>
53 <form border=0 method=post name=new_note action="surgeries.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 Surgery]</a>
66 </form>
69 <form border=0 method=post name=update_activity action="surgeries.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";
86 <font class=text>View: </font>
87 <a href="surgeries.php?offset=0&active=all" class=<?echo $all_class;?>>[All]</a>
88 <a href="surgeries.php?offset=0&active=1" class=<?echo $active_class;?>>[Only Active]</a>
89 <a href="surgeries.php?offset=0&active=0" class=<?echo $inactive_class;?>>[Only Inactive]</a>
91 <br>
92 <a href="javascript:document.update_activity.submit();" class=link_submit>[Change Activity]</a>
93 <br><br>
95 <span class=text>
97 if ($result = getListByType($pid, "surgery", "id,title,comments,activity,date", $active, "all", 0)){
98 foreach ($result as $iter) {
99 //echo "<dd>" . $iter{"title"} . "</dd>\n";
101 if ($iter{"activity"}) {
102 $checked = "checked";
103 } else {
104 $checked = "";
106 print "<input type=hidden value='' name=act".$iter{"id"}.">";
107 print "<input onClick='javascript:document.update_activity.act".$iter{"id"}.".value=this.checked' type=checkbox $checked>";
108 print "<font class=bold>".$iter{"title"} . "</font><font class=text>(".date("n/j/Y",strtotime($iter{"date"})).")</font><br>";
109 print "<font class=text>" . $iter{"comments"} . "</font><br>\n";
115 </span>
117 <br>
119 </form>
121 </td>
122 </tr>
123 </table>
125 </body>
126 </html>