datepicker in standard forms (#520)
[openemr.git] / interface / forms / note / view.php
blobb47dad5c0c7ea48c982f997bcd6a9e2cd0483ad7
1 <!-- Work/School Note Form created by Nikolai Vitsyn: 2004/02/13 and update 2005/03/30
2 Copyright (C) Open Source Medical Software
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -->
18 <?php
20 $fake_register_globals=false;
21 $sanitize_all_escapes=true;
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'] != "") $obj = formFetch("form_".$form_name, $_GET["id"]);
34 /* remove the time-of-day from the date fields */
35 if ($obj['date_of_signature'] != "") {
36 $dateparts = explode(" ", $obj['date_of_signature']);
37 $obj['date_of_signature'] = $dateparts[0];
40 <html><head>
41 <?php html_header_show();?>
43 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
44 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
46 <!-- supporting javascript code -->
47 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script>
48 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js?v=<?php echo $v_js_includes; ?>"></script>
49 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script>
51 <script language="JavaScript">
52 // required for textbox date verification
53 var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';
55 function PrintForm() {
56 newwin = window.open("<?php echo $rootdir."/forms/".$form_name."/print.php?id=".attr($_GET["id"]); ?>","mywin");
59 </script>
61 </head>
62 <body class="body_top">
64 <form method=post action="<?php echo $rootdir."/forms/".$form_name."/save.php?mode=update&id=".attr($_GET["id"]);?>" name="my_form" id="my_form">
65 <span class="title"><?php echo xlt('Work/School Note'); ?></span><br></br>
67 <div style="margin: 10px;">
68 <input type="button" class="save" value=" <?php echo xla('Save'); ?> "> &nbsp;
69 <input type="button" class="dontsave" value="<?php echo xla('Don\'t Save'); ?>"> &nbsp;
70 <input type="button" class="printform" value="<?php echo xla('View Printable Version'); ?>"> &nbsp;
71 </div>
73 <select name="note_type">
74 <option value="WORK NOTE" <?php if ($obj['note_type']=="WORK NOTE") echo " SELECTED"; ?>><?php echo xlt('WORK NOTE'); ?></option>
75 <option value="SCHOOL NOTE" <?php if ($obj['note_type']=="SCHOOL NOTE") echo " SELECTED"; ?>><?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=entry 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 language="javascript">
106 // jQuery stuff to make the page a little easier to use
108 $(document).ready(function(){
109 $(".save").click(function() { top.restoreSession(); $("#my_form").submit(); });
110 $(".dontsave").click(function() { location.href='<?php echo "$rootdir/patient_file/encounter/$returnurl";?>'; });
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>