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
. -->
19 include_once("../../globals.php");
20 include_once("$srcdir/api.inc");
21 formHeader("Form: note");
22 $returnurl = $GLOBALS['concurrent_layout'] ?
'encounter_top.php' : 'patient_encounter.php';
23 $provider_results = sqlQuery("select fname, lname from users where username='" . $_SESSION{"authUser"} . "'");
25 /* name of this form */
28 // get the record from the database
29 if ($_GET['id'] != "") $obj = formFetch("form_".$form_name, $_GET["id"]);
30 /* remove the time-of-day from the date fields */
31 if ($obj['date_of_signature'] != "") {
32 $dateparts = split(" ", $obj['date_of_signature']);
33 $obj['date_of_signature'] = $dateparts[0];
37 <?php
html_header_show();?
>
38 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
40 <!-- supporting javascript code
-->
41 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.js"></script
>
42 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script
>
44 <!-- pop up calendar
-->
45 <style type
="text/css">@import
url(<?php
echo $GLOBALS['webroot'] ?
>/library
/dynarch_calendar
.css
);</style
>
46 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.js"></script
>
47 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_en.js"></script
>
48 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_setup.js"></script
>
50 <script language
="JavaScript">
51 // required for textbox date verification
52 var mypcc
= '<?php echo $GLOBALS['phone_country_code
'] ?>';
54 function PrintForm() {
55 newwin
= window
.open("<?php echo $rootdir."/forms
/".$form_name."/print.php?id
=".$_GET["id
"]; ?>","mywin");
61 <body
class="body_top">
63 <form method
=post action
="<?php echo $rootdir."/forms
/".$form_name."/save
.php?mode
=update
&id
=".$_GET["id
"];?>" name
="my_form" id
="my_form">
64 <span
class="title"><?php
xl('Work/School Note','e'); ?
></span
><br
></br
>
66 <div style
="margin: 10px;">
67 <input type
="button" class="save" value
=" <?php xl('Save','e'); ?> ">  
;
68 <input type
="button" class="dontsave" value
="<?php xl('Don\'t Save','e'); ?>">  
;
69 <input type
="button" class="printform" value
="<?php xl('Print','e'); ?>">  
;
72 <select name
="note_type">
73 <option value
="WORK NOTE" <?php
if ($obj['note_type']=="WORK NOTE") echo " SELECTED"; ?
>><?php
xl('WORK NOTE','e'); ?
></option
>
74 <option value
="SCHOOL NOTE" <?php
if ($obj['note_type']=="SCHOOL NOTE") echo " SELECTED"; ?
>><?php
xl('SCHOOL NOTE','e'); ?
></option
>
77 <b
><?php
xl('MESSAGE:','e'); ?
></b
>
79 <textarea name
="message" id
="message" cols
="67" rows
="4"><?php
echo stripslashes($obj["message"]);?
></textarea
>
84 <span
class=text
><?php
xl('Doctor:','e'); ?
> </span
><input type
=entry name
="doctor" value
="<?php echo stripslashes($obj["doctor
"]);?>">
86 <span
class="text"><?php
xl('Date','e'); ?
></span
>
87 <input type
='text' size
='10' name
='date_of_signature' id
='date_of_signature'
88 value
='<?php echo $obj['date_of_signature
']; ?>'
89 title
='<?php xl('yyyy
-mm
-dd
','e
'); ?>'
90 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)' />
91 <img src
='../../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
92 id
='img_date_of_signature' border
='0' alt
='[?]' style
='cursor:pointer;cursor:hand'
93 title
='<?php xl('Click here to choose a date
','e
'); ?>'>
97 <div style
="margin: 10px;">
98 <input type
="button" class="save" value
=" <?php xl('Save','e'); ?> ">  
;
99 <input type
="button" class="dontsave" value
="<?php xl('Don\'t Save','e'); ?>">  
;
100 <input type
="button" class="printform" value
="<?php xl('Print','e'); ?>">  
;
107 <script language
="javascript">
108 /* required for popup calendar */
109 Calendar
.setup({inputField
:"date_of_signature", ifFormat
:"%Y-%m-%d", button
:"img_date_of_signature"});
111 // jQuery stuff to make the page a little easier to use
113 $
(document
).ready(function(){
114 $
(".save").click(function() { top
.restoreSession(); $
("#my_form").submit(); });
115 $
(".dontsave").click(function() { location
.href
='<?php echo "$rootdir/patient_file/encounter/$returnurl";?>'; });
116 $
(".printform").click(function() { PrintForm(); });
118 // disable the Print ability if the form has changed
119 // this forces the user to save their changes prior to printing
120 $
("#img_date_of_signature").click(function() { $
(".printform").attr("disabled","disabled"); });
121 $
("input").keydown(function() { $
(".printform").attr("disabled","disabled"); });
122 $
("select").change(function() { $
(".printform").attr("disabled","disabled"); });
123 $
("textarea").keydown(function() { $
(".printform").attr("disabled","disabled"); });