fix: ccda zip import and php warnings and deprecations (#7416)
[openemr.git] / interface / forms / note / view.php
blob9191befd058a19e2ccb7fbb0b1a6f27312c40ed2
1 <?php
3 /*
4 * Work/School Note Form view.php
6 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Nikolai Vitsyn
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2004-2005 Nikolai Vitsyn
11 * @copyright Copyright (c) 2019 Brady Miller <brady.g.miller@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
17 require_once(__DIR__ . "/../../globals.php");
18 require_once("$srcdir/api.inc.php");
20 use OpenEMR\Common\Csrf\CsrfUtils;
21 use OpenEMR\Core\Header;
23 formHeader("Form: note");
24 $returnurl = 'encounter_top.php';
25 $provider_results = sqlQuery("select fname, lname from users where username=?", array($_SESSION["authUser"]));
27 /* name of this form */
28 $form_name = "note";
30 // get the record from the database
31 if ($_GET['id'] != "") {
32 $obj = formFetch("form_" . $form_name, $_GET["id"]);
35 /* remove the time-of-day from the date fields */
36 if ($obj['date_of_signature'] != "") {
37 $dateparts = explode(" ", $obj['date_of_signature']);
38 $obj['date_of_signature'] = $dateparts[0];
41 <html><head>
43 <?php Header::setupHeader('datetime-picker'); ?>
45 <script>
46 // required for textbox date verification
47 var mypcc = <?php echo js_escape($GLOBALS['phone_country_code']); ?>;
49 function PrintForm() {
50 newwin = window.open(<?php echo js_escape($rootdir . "/forms/" . $form_name . "/print.php?id=" . urlencode($_GET["id"])); ?>,"mywin");
53 </script>
55 </head>
56 <body class="body_top">
58 <form method=post action="<?php echo $rootdir . "/forms/" . $form_name . "/save.php?mode=update&id=" . attr_url($_GET["id"]);?>" name="my_form" id="my_form">
59 <input type="hidden" name="csrf_token_form" value="<?php echo attr(CsrfUtils::collectCsrfToken()); ?>" />
61 <span class="title"><?php echo xlt('Work/School Note'); ?></span><br /><br />
63 <div style="margin: 10px;">
64 <input type="button" class="save" value=" <?php echo xla('Save'); ?> "> &nbsp;
65 <input type="button" class="dontsave" value="<?php echo xla('Don\'t Save'); ?>"> &nbsp;
66 <input type="button" class="printform" value="<?php echo xla('View Printable Version'); ?>"> &nbsp;
67 </div>
69 <select name="note_type">
70 <option value="WORK NOTE" <?php if ($obj['note_type'] == "WORK NOTE") {
71 echo " SELECTED";
72 } ?>><?php echo xlt('WORK NOTE'); ?></option>
73 <option value="SCHOOL NOTE" <?php if ($obj['note_type'] == "SCHOOL NOTE") {
74 echo " SELECTED";
75 } ?>><?php echo xlt('SCHOOL NOTE'); ?></option>
76 </select>
77 <br />
78 <b><?php echo xlt('MESSAGE:'); ?></b>
79 <br />
80 <textarea name="message" id="message" cols ="67" rows="4"><?php echo text($obj["message"]);?></textarea>
81 <br /> <br />
83 <table>
84 <tr><td>
85 <span class=text><?php echo xlt('Doctor:'); ?> </span><input type="text" name="doctor" value="<?php echo attr($obj["doctor"]);?>">
86 </td><td>
87 <span class="text"><?php echo xlt('Date'); ?></span>
88 <input type='text' size='10' class='datepicker' name='date_of_signature' id='date_of_signature'
89 value='<?php echo attr($obj['date_of_signature']); ?>'
90 title='<?php echo xla('yyyy-mm-dd'); ?>' />
91 </td></tr>
92 </table>
94 <div style="margin: 10px;">
95 <input type="button" class="save" value=" <?php echo xla('Save'); ?> "> &nbsp;
96 <input type="button" class="dontsave" value="<?php echo xla('Don\'t Save'); ?>"> &nbsp;
97 <input type="button" class="printform" value="<?php echo xla('View Printable Version'); ?>"> &nbsp;
98 </div>
100 </form>
102 </body>
104 <script>
106 // jQuery stuff to make the page a little easier to use
108 $(function () {
109 $(".save").click(function() { top.restoreSession(); $("#my_form").submit(); });
110 $(".dontsave").click(function() { parent.closeTab(window.name, false); });
111 $(".printform").click(function() { PrintForm(); });
113 // disable the Print ability if the form has changed
114 // this forces the user to save their changes prior to printing
115 $("#img_date_of_signature").click(function() { $(".printform").attr("disabled","disabled"); });
116 $("input").keydown(function() { $(".printform").attr("disabled","disabled"); });
117 $("select").change(function() { $(".printform").attr("disabled","disabled"); });
118 $("textarea").keydown(function() { $(".printform").attr("disabled","disabled"); });
120 $('.datepicker').datetimepicker({
121 <?php $datetimepicker_timepicker = false; ?>
122 <?php $datetimepicker_showseconds = false; ?>
123 <?php $datetimepicker_formatInput = false; ?>
124 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
125 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
129 </script>
131 </html>