added new datepicker to disclosures gui
[openemr.git] / interface / patient_file / summary / record_disclosure.php
blobc4e29936d400d57ed52d2329be22d5e00350bb6c
1 <?php
2 /**
4 * Patient disclosures main screen.
6 * Copyright (C) Visolve <vicareplus_engg@visolve.com>
7 * Copyright (C) 2017 Brady Miller <brady.g.miller@gmail.com>
9 * LICENSE: This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
20 * @package OpenEMR
21 * @author Visolve <vicareplus_engg@visolve.com>
22 * @author Brady Miller <brady@sparmy.com>
23 * @link http://www.open-emr.org
27 //SANITIZE ALL ESCAPES
28 $sanitize_all_escapes=true;
31 //STOP FAKE REGISTER GLOBALS
32 $fake_register_globals=false;
36 require_once("../../globals.php");
37 require_once("$srcdir/options.inc.php");
39 //if the edit button for editing disclosure is set.
40 if (isset($_GET['editlid']))
42 $editlid=$_GET['editlid'];
45 <html>
46 <head>
47 <link rel='stylesheet' href="<?php echo $css_header;?>" type="text/css">
48 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
50 <!-- supporting javascript code -->
51 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script>
52 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script>
54 <script type="text/javascript">
55 //function to validate fields in record disclosure page
56 function submitform()
58 if (document.forms[0].dates.value.length<=0)
60 {document.forms[0].dates.focus();document.forms[0].dates.style.backgroundColor="red";
62 else if (document.forms[0].recipient_name.value.length<=0)
64 document.forms[0].dates.style.backgroundColor="white";
65 document.forms[0].recipient_name.focus();document.forms[0].recipient_name.style.backgroundColor="red";
67 else if (document.forms[0].desc_disc.value.length<=0)
69 document.forms[0].recipient_name.style.backgroundColor="white";
70 document.forms[0].desc_disc.focus();document.forms[0].desc_disc.style.backgroundColor="red";
72 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)
74 top.restoreSession();
75 document.forms[0].submit();
79 $(document).ready(function() {
80 $('.datepicker').datetimepicker({
81 <?php $datetimepicker_timepicker = true; ?>
82 <?php $datetimepicker_formatInput = false; ?>
83 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
84 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
85 });
86 });
88 </script>
89 </head>
90 <body class="body_top">
91 <div id="record-disclosure" style='float: left; margin-right: 10px' >
92 <div style='float: left; margin-right: 5px'><?php if($editlid) {?><!--Edit the disclosures-->
93 <span class="title"><?php echo htmlspecialchars(xl('Edit Disclosure'),ENT_NOQUOTES); ?></span><?php }
94 else {?> <span class="title"><?php echo htmlspecialchars(xl('Record Disclosure'),ENT_NOQUOTES); ?></span><?php }?>
95 </div>
96 <div><a onclick="return submitform()" class="css_button large_button"
97 name='form_save' id='form_save' href='#'> <span
98 class='css_button_span large_button_span'><?php echo htmlspecialchars(xl('Save'),ENT_NOQUOTES);?></span>
99 </a></div>
100 <div><a class="css_button large_button" id='cancel'
101 href='disclosure_full.php' target='_parent' onclick='top.restoreSession()'> <span
102 class='css_button_span large_button_span'><?php echo htmlspecialchars(xl('Cancel'),ENT_NOQUOTES);?></span>
103 </a></div>
104 <br>
105 <form NAME="disclosure_form" METHOD="POST" ACTION="disclosure_full.php" target='_parent' onsubmit='return top.restoreSession()'>
106 <input type=hidden name=mode value="disclosure">
107 <table border=0 cellpadding=3 cellspacing=0 align='center'>
108 <br>
109 <tr>
110 <td><span class='text'><?php echo htmlspecialchars(xl('Date'),ENT_NOQUOTES); ?>:</span></td>
111 <td><!--retrieve disclosures from extended_log table for modifications-->
112 <?php
113 if($editlid){
114 $dres=sqlQuery("select date,recipient,description,event from extended_log where id=?", array($editlid) );
115 $description=$dres{"description"};
116 $app_event=$dres{"event"};
117 $disc_date=$dres{"date"};
118 $recipient_name=$dres{"recipient"};
120 <input type=hidden name=disclosure_id value="<?php echo htmlspecialchars($editlid,ENT_QUOTES); ?>">
121 <input type=hidden name=updatemode value="disclosure_update">
122 <input type='entry' size='20' class='datepicker' name='dates' id='dates' value='<?php echo htmlspecialchars($disc_date,ENT_QUOTES);?>' style="background-color:white"/>&nbsp; <?php
124 else {
125 ?> <input type='entry' size='20' class='datepicker' name='dates' id='dates' value='' style="background-color:white"/>&nbsp;
126 <?php }
128 </tr>
129 <tr>
130 <td><span class=text><?php echo htmlspecialchars(xl('Type of Disclosure'),ENT_NOQUOTES); ?>: </span></TD>
131 <td><?php if($editlid)
133 //To incorporate the disclosure types into the list_options listings
134 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);}
135 else{
136 //To incorporate the disclosure types into the list_options listings
137 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);
138 } ?>
139 </td>
140 </tr>
141 <tr>
142 <td><span class=text><?php echo htmlspecialchars(xl('Recipient of the Disclosure'),ENT_NOQUOTES); ?>:
143 </span></td>
144 <td class='text'>
145 <?php
146 if($editlid){
147 ?> <input type=entry name=recipient_name size=20 value="<?php echo htmlspecialchars($recipient_name,ENT_QUOTES); ?>"></td>
148 <?php
149 }else
151 <input type=entry name=recipient_name size=20 value="">
152 </td>
153 <?php
155 </tr>
156 <tr>
157 <td>
158 <span class=text><?php echo htmlspecialchars(xl('Description of the Disclosure'),ENT_NOQUOTES); ?>:</span></td>
159 <?php if($editlid)
162 <td>
163 <textarea name=desc_disc wrap=auto rows=4 cols=30><?php echo htmlspecialchars($description,ENT_NOQUOTES); ?></textarea>
164 <?php }
165 else
167 <td><textarea name=desc_disc wrap=auto rows=4 cols=30></textarea><?php }?>
168 </td>
169 </tr>
170 </table>
171 </form>
172 </body>