minor bug fixes for previous commit
[openemr.git] / interface / forms / aftercare_plan / new.php
blob1a954df98ec50856edbb5ccaf2e0d6ab65885461
1 <?php
2 /**
4 * Copyright (C) 2012-2013 Naina Mohamed <naina@capminds.com> CapMinds Technologies
6 * LICENSE: 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 3
9 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * 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, see <http://opensource.org/licenses/gpl-license.php>;.
17 * @package OpenEMR
18 * @author Naina Mohamed <naina@capminds.com>
19 * @link http://www.open-emr.org
23 //SANITIZE ALL ESCAPES
24 $sanitize_all_escapes=true;
26 //STOP FAKE REGISTER GLOBALS
27 $fake_register_globals=false;
29 include_once("../../globals.php");
30 include_once("$srcdir/api.inc");
31 require_once("$srcdir/patient.inc");
32 require_once("$srcdir/options.inc.php");
33 require_once("$srcdir/htmlspecialchars.inc.php");
34 formHeader("Form:AfterCare Planning");
35 $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php';
36 $formid = 0 + (isset($_GET['id']) ? $_GET['id'] : '');
37 $obj = $formid ? formFetch("form_aftercare_plan", $formid) : array();
40 <html>
41 <head>
42 <?php html_header_show();?>
43 <script type="text/javascript" src="../../../library/dialog.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 <?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?>
48 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_setup.js"></script>
49 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script>
50 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script>
51 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
52 </head>
53 <body class="body_top">
54 <p><span class="forms-title"><?php echo xlt('AfterCare Planning'); ?></span></p>
55 </br>
56 <?php
57 echo "<form method='post' name='my_form' " .
58 "action='$rootdir/forms/aftercare_plan/save.php?id=" . attr($formid) ."'>\n";
60 <table border="0">
61 <tr>
62 <td align="left" class="forms" class="forms"><?php echo xlt('Client Name' ); ?>:</td>
63 <td class="forms">
64 <label class="forms-data"> <?php if (is_numeric($pid)) {
66 $result = getPatientData($pid, "fname,lname,squad");
67 echo htmlspecialchars(text($result['fname'])." ".text($result['lname']));}
68 $patient_name=($result['fname'])." ".($result['lname']);
70 </label>
71 <input type="hidden" name="client_name" value="<?php echo attr($patient_name);?>">
72 </td>
73 <td align="left" class="forms"><?php echo xlt('DOB'); ?>:</td>
74 <td class="forms">
75 <label class="forms-data"> <?php if (is_numeric($pid)) {
77 $result = getPatientData($pid, "*");
78 echo htmlspecialchars($result['DOB']);}
79 $dob=($result['DOB']);
81 </label>
82 <input type="hidden" name="DOB" value="<?php echo attr($dob);?>">
83 </td>
84 </tr>
85 <tr>
88 <td align="left" class="forms"><?php echo xlt('Admit Date'); ?>:</td>
89 <td class="forms">
90 <input type='text' size='10' name='admit_date' id='admission_date' <?php echo attr($disabled); ?>;
91 value='<?php echo attr($obj{"admit_date"}); ?>'
92 title='<?php echo xla('yyyy-mm-dd Date of service'); ?>'
93 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
94 <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22'
95 id='img_admission_date' border='0' alt='[?]' style='cursor:pointer;cursor:hand'
96 title='<?php echo xla('Click here to choose a date'); ?>'>
97 </td>
101 <td align="left" class="forms"><?php echo xlt('Discharged'); ?>:</td>
102 <td class="forms">
103 <input type='text' size='10' name='discharged' id='discharge_date' <?php echo attr($disabled); ?>;
104 value='<?php echo attr($obj{"discharged"}); ?>'
105 title='<?php echo xla('yyyy-mm-dd Date of service'); ?>'
106 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
107 <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22'
108 id='img_discharge_date' border='0' alt='[?]' style='cursor:pointer;cursor:hand'
109 title='<?php echo xla('Click here to choose a date'); ?>'>
110 </td>
111 </tr>
112 <tr>
113 <td align="left colspan="3" style="padding-bottom:7px;"></td>
114 </tr>
115 <tr>
117 <td class="forms-subtitle" colspan="4"><B><?php echo xlt('Goal and Methods');?></B></td>
119 </tr>
120 <tr>
121 <td align="left colspan="3" style="padding-bottom:7px;"></td>
122 </tr>
123 <tr>
125 <td class="forms-subtitle" colspan="4"><B><?php echo xlt('Goal A');?>:</B>&nbsp;<?php echo xlt('Acute Intoxication/Withdrawal'); ?></td>
127 </tr>
128 <tr>
129 <td align="right" class="forms">1.</td>
130 <td colspan="3"><textarea name="goal_a_acute_intoxication" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_a_acute_intoxication"});?></textarea></td>
132 </tr>
133 <tr>
134 <td align="right" class="forms">2.</td>
135 <td colspan="3"><textarea name="goal_a_acute_intoxication_I" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_a_acute_intoxication_I"});?></textarea></td>
137 </tr>
138 <tr>
139 <td align="right" class="forms">3.</td>
140 <td colspan="3"><textarea name="goal_a_acute_intoxication_II" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_a_acute_intoxication_II"});?></textarea></td>
143 <tr>
145 <td class="forms-subtitle" colspan="4"><B><?php echo xlt('Goal B');?>:</B>&nbsp;<?php echo xlt('Emotional / Behavioral Conditions & Complications'); ?></td>
147 </tr>
148 <tr>
149 <td align="right" class="forms">1.</td>
150 <td colspan="3"><textarea name="goal_b_emotional_behavioral_conditions" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_b_emotional_behavioral_conditions"});?></textarea></td>
152 </tr>
153 <tr>
154 <td align="right" class="forms">2.</td>
155 <td colspan="3"><textarea name="goal_b_emotional_behavioral_conditions_I" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_b_emotional_behavioral_conditions_I"});?></textarea></td>
157 </tr>
160 <td class="forms-subtitle" colspan="4"><B><?php echo xlt('Goal C');?>:</B>&nbsp;<?php echo xlt('Relapse Potential'); ?></td>
162 </tr>
163 <tr>
164 <td align="right" class="forms">1.</td>
165 <td colspan="3"><textarea name="goal_c_relapse_potential" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_c_relapse_potential"});?></textarea></td>
167 </tr>
168 <tr>
169 <td align="right" class="forms">2.</td>
170 <td colspan="3"><textarea name="goal_c_relapse_potential_I" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_c_relapse_potential_I"});?></textarea></td>
172 </tr>
174 <tr>
175 <td align="left colspan="3" style="padding-bottom:7px;"></td>
176 </tr>
177 <tr>
178 <td></td>
179 <td><input type='submit' value='<?php echo xlt('Save');?>' class="button-css">&nbsp;
180 <input type='button' value="Print" onclick="window.print()" class="button-css">&nbsp;
181 <input type='button' class="button-css" value='<?php echo xlt('Cancel');?>'
182 onclick="top.restoreSession();location='<?php echo "$rootdir/patient_file/encounter/$returnurl" ?>'" /></td>
183 </tr>
184 </table>
185 </form>
186 <script language="javascript">
187 /* required for popup calendar */
188 Calendar.setup({inputField:"admission_date", ifFormat:"%Y-%m-%d", button:"img_admission_date"});
189 Calendar.setup({inputField:"discharge_date", ifFormat:"%Y-%m-%d", button:"img_discharge_date"});
190 </script>
191 <?php
192 formFooter();