Highway to PSR2
[openemr.git] / interface / forms / note / view.php
blob9198d0e6a141800e12b53a53bb7b47baab57f2db
1 <?php
2 /**
3 * Work/School Note Form created by Nikolai Vitsyn: 2004/02/13 and update 2005/03/30
4 * Copyright (C) Open Source Medical Software
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 include_once("../../globals.php");
24 include_once("$srcdir/api.inc");
25 formHeader("Form: note");
26 $returnurl = 'encounter_top.php';
27 $provider_results = sqlQuery("select fname, lname from users where username=?", array($_SESSION{"authUser"}));
29 /* name of this form */
30 $form_name = "note";
32 // get the record from the database
33 if ($_GET['id'] != "") {
34 $obj = formFetch("form_".$form_name, $_GET["id"]);
37 /* remove the time-of-day from the date fields */
38 if ($obj['date_of_signature'] != "") {
39 $dateparts = explode(" ", $obj['date_of_signature']);
40 $obj['date_of_signature'] = $dateparts[0];
43 <html><head>
44 <?php html_header_show();?>
46 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
47 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
49 <!-- supporting javascript code -->
50 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script>
51 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js?v=<?php echo $v_js_includes; ?>"></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 language="JavaScript">
55 // required for textbox date verification
56 var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';
58 function PrintForm() {
59 newwin = window.open("<?php echo $rootdir."/forms/".$form_name."/print.php?id=".attr($_GET["id"]); ?>","mywin");
62 </script>
64 </head>
65 <body class="body_top">
67 <form method=post action="<?php echo $rootdir."/forms/".$form_name."/save.php?mode=update&id=".attr($_GET["id"]);?>" name="my_form" id="my_form">
68 <span class="title"><?php echo xlt('Work/School Note'); ?></span><br></br>
70 <div style="margin: 10px;">
71 <input type="button" class="save" value=" <?php echo xla('Save'); ?> "> &nbsp;
72 <input type="button" class="dontsave" value="<?php echo xla('Don\'t Save'); ?>"> &nbsp;
73 <input type="button" class="printform" value="<?php echo xla('View Printable Version'); ?>"> &nbsp;
74 </div>
76 <select name="note_type">
77 <option value="WORK NOTE" <?php if ($obj['note_type']=="WORK NOTE") {
78 echo " SELECTED";
79 } ?>><?php echo xlt('WORK NOTE'); ?></option>
80 <option value="SCHOOL NOTE" <?php if ($obj['note_type']=="SCHOOL NOTE") {
81 echo " SELECTED";
82 } ?>><?php echo xlt('SCHOOL NOTE'); ?></option>
83 </select>
84 <br>
85 <b><?php echo xlt('MESSAGE:'); ?></b>
86 <br>
87 <textarea name="message" id="message" cols ="67" rows="4"><?php echo text($obj["message"]);?></textarea>
88 <br> <br>
90 <table>
91 <tr><td>
92 <span class=text><?php echo xlt('Doctor:'); ?> </span><input type=entry name="doctor" value="<?php echo attr($obj["doctor"]);?>">
93 </td><td>
94 <span class="text"><?php echo xlt('Date'); ?></span>
95 <input type='text' size='10' class='datepicker' name='date_of_signature' id='date_of_signature'
96 value='<?php echo attr($obj['date_of_signature']); ?>'
97 title='<?php echo xla('yyyy-mm-dd'); ?>' />
98 </td></tr>
99 </table>
101 <div style="margin: 10px;">
102 <input type="button" class="save" value=" <?php echo xla('Save'); ?> "> &nbsp;
103 <input type="button" class="dontsave" value="<?php echo xla('Don\'t Save'); ?>"> &nbsp;
104 <input type="button" class="printform" value="<?php echo xla('View Printable Version'); ?>"> &nbsp;
105 </div>
107 </form>
109 </body>
111 <script language="javascript">
113 // jQuery stuff to make the page a little easier to use
115 $(document).ready(function(){
116 $(".save").click(function() { top.restoreSession(); $("#my_form").submit(); });
117 $(".dontsave").click(function() { location.href='<?php echo "$rootdir/patient_file/encounter/$returnurl";?>'; });
118 $(".printform").click(function() { PrintForm(); });
120 // disable the Print ability if the form has changed
121 // this forces the user to save their changes prior to printing
122 $("#img_date_of_signature").click(function() { $(".printform").attr("disabled","disabled"); });
123 $("input").keydown(function() { $(".printform").attr("disabled","disabled"); });
124 $("select").change(function() { $(".printform").attr("disabled","disabled"); });
125 $("textarea").keydown(function() { $(".printform").attr("disabled","disabled"); });
127 $('.datepicker').datetimepicker({
128 <?php $datetimepicker_timepicker = false; ?>
129 <?php $datetimepicker_showseconds = false; ?>
130 <?php $datetimepicker_formatInput = false; ?>
131 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
132 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
136 </script>
138 </html>