datepicker in standard forms (#520)
[openemr.git] / interface / forms / treatment_plan / new.php
blob63832a61bb4320c85507965eb746cfa14a93b8ce
1 <?php
2 /**
4 * Copyright (C) 2012-2013 Naina Mohamed <naina@capminds.com> CapMinds Technologies
5 * Copyright (C) 2017 Brady Miller <brady.g.miller@gmail.com>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * 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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
18 * @package OpenEMR
19 * @author Naina Mohamed <naina@capminds.com>
20 * @author Brady Miller <brady.g.miller@gmail.com>
21 * @link http://www.open-emr.org
24 //SANITIZE ALL ESCAPES
25 $sanitize_all_escapes=true;
27 //STOP FAKE REGISTER GLOBALS
28 $fake_register_globals=false;
30 include_once("../../globals.php");
31 include_once("$srcdir/api.inc");
32 require_once("$srcdir/patient.inc");
33 require_once("$srcdir/options.inc.php");
34 formHeader("Form:Treatment Planning");
35 $returnurl = 'encounter_top.php';
36 $formid = 0 + (isset($_GET['id']) ? $_GET['id'] : '');
37 $obj = $formid ? formFetch("form_treatment_plan", $formid) : array();
39 // Get the providers list.
40 $ures = sqlStatement("SELECT id, username, fname, lname FROM users WHERE " .
41 "authorized != 0 AND active = 1 ORDER BY lname, fname");
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 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js?v=<?php echo $v_js_includes; ?>"></script>
50 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
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 language="JavaScript">
55 $(document).ready(function() {
56 var win = top.printLogSetup ? top : opener.top;
57 win.printLogSetup(document.getElementById('printbutton'));
59 $('.datepicker').datetimepicker({
60 <?php $datetimepicker_timepicker = false; ?>
61 <?php $datetimepicker_showseconds = false; ?>
62 <?php $datetimepicker_formatInput = false; ?>
63 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
64 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
65 });
66 });
67 </script>
69 </head>
70 <body class="body_top">
71 <p><span class="forms-title"><?php echo xlt('Treatment Planning'); ?></span></p>
72 </br>
73 <?php
74 echo "<form method='post' name='my_form' " .
75 "action='$rootdir/forms/treatment_plan/save.php?id=" . attr($formid) ."'>\n";
78 <table border="0">
80 <tr>
81 <td align="left" class="forms" class="forms"><?php echo xlt('Client Name' ); ?>:</td>
82 <td class="forms">
83 <label class="forms-data"> <?php if (is_numeric($pid)) {
85 $result = getPatientData($pid, "fname,lname,squad");
86 echo text($result['fname'])." ".text($result['lname']);}
87 $patient_name=($result['fname'])." ".($result['lname']);
89 </label>
90 <input type="hidden" name="client_name" value="<?php echo attr($patient_name);?>">
91 </td>
92 <td align="left" class="forms"><?php echo xlt('DOB'); ?>:</td>
93 <td class="forms">
94 <label class="forms-data"> <?php if (is_numeric($pid)) {
96 $result = getPatientData($pid, "*");
97 echo text($result['DOB']);}
98 $dob=($result['DOB']);
100 </label>
101 <input type="hidden" name="DOB" value="<?php echo attr($dob);?>">
102 </td>
103 </tr>
104 <tr>
105 <td align="left" class="forms"><?php echo xlt('Client Number'); ?>:</td>
106 <td class="forms">
107 <label class="forms-data" > <?php if (is_numeric($pid)) {
109 $result = getPatientData($pid, "*");
110 echo text($result['pid']);}
111 $patient_id=$result['pid'];
113 </label>
114 <input type="hidden" name="client_number" value="<?php echo attr($patient_id);?>">
115 </td>
118 <td align="left" class="forms"><?php echo xlt('Admit Date'); ?>:</td>
119 <td class="forms">
120 <input type='text' size='10' class='datepicker' name='admit_date' id='admission_date' <?php echo attr($disabled) ?>;
121 value='<?php echo attr($obj{"admit_date"}); ?>'
122 title='<?php echo xla('yyyy-mm-dd Date of service'); ?>' />
123 </td>
125 </tr>
126 <tr>
127 <td align="left" class="forms"><?php echo xlt('Provider'); ?>:</td>
128 <td class="forms" width="280px">
129 <?php
131 echo "<select name='provider' style='width:60%' />";
132 while ($urow = sqlFetchArray($ures)) {
133 echo " <option value='" . attr($urow['lname']) . "'";
134 if ($urow['lname'] == attr($obj{"provider"})) echo " selected";
135 echo ">" . text($urow['lname']);
136 if ($urow['fname']) echo ", " . text($urow['fname']);
137 echo "</option>\n";
139 echo "</select>";
141 </td>
143 </tr>
145 <tr>
147 <td colspan='3' nowrap style='font-size:8pt'>
148 &nbsp;
149 </td>
150 </tr>
152 <tr>
153 <td align="left" class="forms"><?php echo xlt('Presenting Issue(s)'); ?>:</td>
154 <td colspan="3"><textarea name="presenting_issues" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"presenting_issues"});?></textarea></td>
156 </tr>
157 <tr>
158 <td align="left" class="forms"><?php echo xlt('Patient History'); ?>:</td>
159 <td colspan="3"><textarea name="patient_history" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"patient_history"});?></textarea></td>
161 </tr>
162 <tr>
164 <td align="left" class="forms"><?php echo xlt('Medications'); ?>:</td>
165 <td colspan="3"><textarea name="medications" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"medications"});?></textarea></td>
168 </tr>
169 <tr>
170 <td align="left" class="forms"><?php echo xlt('Anyother Relevant Information'); ?>:</td>
171 <td colspan="3"><textarea name="anyother_relevant_information" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"anyother_relevant_information"});?></textarea></td>
173 </tr>
174 <tr>
175 <td align="left" class="forms"><?php echo xlt('Diagnosis'); ?>:</td>
176 <td colspan="3"><textarea name="diagnosis" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"diagnosis"});?></textarea></td>
178 </tr>
179 <tr>
180 <td align="left" class="forms"><?php echo xlt('Treatment Received'); ?>:</td>
181 <td colspan="3"><textarea name="treatment_received" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"treatment_received"});?></textarea></td>
183 </tr>
184 <tr>
185 <td align="left" class="forms"><?php echo xlt('Recommendation For Follow Up'); ?>:</td>
186 <td colspan="3"><textarea name="recommendation_for_follow_up" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"recommendation_for_follow_up"});?></textarea></td>
188 </tr>
189 <tr>
190 <td align="left colspan="3" style="padding-bottom:7px;"></td>
191 </tr>
192 <tr>
193 <td align="left colspan="3" style="padding-bottom:7px;"></td>
194 </tr>
195 <tr>
196 <td></td>
197 <td><input type='submit' value='<?php echo xlt('Save');?>' class="button-css">&nbsp;
198 <input type='button' value='<?php echo xla('Print'); ?>' id='printbutton' />&nbsp;
200 <input type='button' class="button-css" value='<?php echo xlt('Cancel');?>'
201 onclick="top.restoreSession();location='<?php echo "$rootdir/patient_file/encounter/$returnurl" ?>'" /></td>
202 </tr>
203 </table>
204 </form>
205 <?php
206 formFooter();