The Third Reminders email bug fix - contributed by arnabnaha
[openemr.git] / interface / patient_file / summary / record_disclosure.php
blobe274659f06b6a2414abcf96c88b6cef9d590a990
1 <?php
2 /*******************************************************************************\
3 * Copyright (C) Visolve (vicareplus_engg@visolve.com) *
4 * *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License *
7 * as published by the Free Software Foundation; either version 2 *
8 * of the License, or (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18 ********************************************************************************/
20 //SANITIZE ALL ESCAPES
21 $sanitize_all_escapes=true;
24 //STOP FAKE REGISTER GLOBALS
25 $fake_register_globals=false;
29 require_once("../../globals.php");
30 require_once("$srcdir/sql.inc");
31 require_once("$srcdir/options.inc.php");
33 //if the edit button for editing disclosure is set.
34 if (isset($_GET['editlid']))
36 $editlid=$_GET['editlid'];
39 <html>
40 <head>
41 <link rel='stylesheet' href="<?php echo $css_header;?>" type="text/css">
42 <!-- supporting javascript code -->
43 <style type="text/css">@import url(<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.css);</style>
44 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.js"></script>
45 <?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?>
46 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_setup.js"></script>
47 <script type="text/javascript">
48 //function to validate fields in record disclosure page
49 function submitform()
51 if (document.forms[0].dates.value.length<=0)
53 {document.forms[0].dates.focus();document.forms[0].dates.style.backgroundColor="red";
55 else if (document.forms[0].recipient_name.value.length<=0)
57 document.forms[0].dates.style.backgroundColor="white";
58 document.forms[0].recipient_name.focus();document.forms[0].recipient_name.style.backgroundColor="red";
60 else if (document.forms[0].desc_disc.value.length<=0)
62 document.forms[0].recipient_name.style.backgroundColor="white";
63 document.forms[0].desc_disc.focus();document.forms[0].desc_disc.style.backgroundColor="red";
65 else if (document.forms[0].dates.value.length>0 && document.forms[0].recipient_name.value.length>0 && document.forms[0].desc_disc.value.length>0)
67 top.restoreSession();
68 document.forms[0].submit();
71 </script>
72 </head>
73 <body class="body_top">
74 <div style='float: left; margin-right: 10px'>
75 <div style='float: left; margin-right: 5px'><?php if($editlid) {?><!--Edit the disclosures-->
76 <span class="title"><?php echo htmlspecialchars(xl('Edit Disclosure'),ENT_NOQUOTES); ?></span><?php }
77 else {?> <span class="title"><?php echo htmlspecialchars(xl('Record Disclosure'),ENT_NOQUOTES); ?></span><?php }?>
78 </div>
79 <div><a onclick="return submitform()" class="css_button large_button"
80 name='form_save' id='form_save' href='#'> <span
81 class='css_button_span large_button_span'><?php echo htmlspecialchars(xl('Save'),ENT_NOQUOTES);?></span>
82 </a></div>
83 <div><a class="css_button large_button" id='cancel'
84 href='disclosure_full.php' target='_parent'> <span
85 class='css_button_span large_button_span'><?php echo htmlspecialchars(xl('Cancel'),ENT_NOQUOTES);?></span>
86 </a></div>
87 <br>
88 <form NAME="disclosure_form" METHOD="POST" ACTION="disclosure_full.php" target='_parent' onsubmit='return top.restoreSession()'>
89 <input type=hidden name=mode value="disclosure">
90 <table border=0 cellpadding=3 cellspacing=0 align='center'>
91 <br>
92 <tr>
93 <td><span class='text'><?php echo htmlspecialchars(xl('Date'),ENT_NOQUOTES); ?>:</span></td>
94 <td><!--retrieve disclosures from extended_log table for modifications-->
95 <?php
96 if($editlid){
97 $dres=sqlQuery("select date,recipient,description,event from extended_log where id=?", array($editlid) );
98 $description=$dres{"description"};
99 $app_event=$dres{"event"};
100 $disc_date=$dres{"date"};
101 $recipient_name=$dres{"recipient"};
103 <input type=hidden name=disclosure_id value="<?php echo htmlspecialchars($editlid,ENT_QUOTES); ?>">
104 <input type=hidden name=updatemode value="disclosure_update">
105 <input type='entry' size='20' name='dates' id='dates' readonly='readonly' value='<?php echo htmlspecialchars($disc_date,ENT_QUOTES);?>' style="background-color:white"/>&nbsp; <?php
107 else {
108 ?> <input type='entry' size='20' name='dates' id='dates' value='' readonly="readonly" style="background-color:white"/>&nbsp;
109 <?php }
111 <!-- image for date/time picker -->
112 <img src="../../../interface/pic/show_calendar.gif" id="img_date"
113 width="24" height="22" align="absbottom" style="cursor: pointer;"
114 title="<?php echo htmlspecialchars(xl('Date selector'),ENT_QUOTES);?>" /></td>
115 <script type="text/javascript">
116 Calendar.setup({inputField:'dates', ifFormat:'%Y-%m-%d %H:%M:%S',
117 button:'img_date', showsTime:true});
118 </script>
119 </tr>
120 <tr>
121 <td><span class=text><?php echo htmlspecialchars(xl('Type of Disclosure'),ENT_NOQUOTES); ?>: </span></TD>
122 <td><?php if($editlid)
124 //To incorporate the disclosure types into the list_options listings
125 generate_form_field(array('data_type'=>1,'field_id'=>'disclosure_type','list_id'=>'disclosure_type','fld_length'=>'10','max_length'=>'63','empty_title'=>'SKIP'), $app_event);}
126 else{
127 //To incorporate the disclosure types into the list_options listings
128 generate_form_field(array('data_type'=>1,'field_id'=>'disclosure_type','list_id'=>'disclosure_type','fld_length'=>'10','max_length'=>'63','empty_title'=>'SKIP'), $title);
129 } ?>
130 </td>
131 </tr>
132 <tr>
133 <td><span class=text><?php echo htmlspecialchars(xl('Recipient of the Disclosure'),ENT_NOQUOTES); ?>:
134 </span></td>
135 <td class='text'>
136 <?php
137 if($editlid){
138 ?> <input type=entry name=recipient_name size=20 value="<?php echo htmlspecialchars($recipient_name,ENT_QUOTES); ?>"></td>
139 <?php
140 }else
142 <input type=entry name=recipient_name size=20 value="">
143 </td>
144 <?php
146 </tr>
147 <tr>
148 <td>
149 <span class=text><?php echo htmlspecialchars(xl('Description of the Disclosure'),ENT_NOQUOTES); ?>:</span></td>
150 <?php if($editlid)
153 <td>
154 <textarea name=desc_disc wrap=auto rows=4 cols=30><?php echo htmlspecialchars($description,ENT_NOQUOTES); ?></textarea>
155 <?php }
156 else
158 <td><textarea name=desc_disc wrap=auto rows=4 cols=30></textarea><?php }?>
159 </td>
160 </tr>
161 </table>
162 </form>
163 </body>