fix: allow viewing of fee sheet items if billing.billed is null (#7808)
[openemr.git] / contrib / forms / hist_exam_plan / new.php
blob1a2234d96921e4a7622f93932e90e83337c0a650
1 <?php
3 //////////////////////////////////////////////////////////////////////
4 // ------------------ DO NOT MODIFY VIEW.PHP !!! ---------------------
5 // View.php is an exact duplicate of new.php. If you wish to make
6 // any changes, then change new.php and either (recommended) make
7 // view.php a symbolic link to new.php, or copy new.php to view.php.
8 //
9 // And if you check in a change to either module, be sure to check
10 // in the other (identical) module also.
12 // This nonsense will go away if we ever move to subversion.
13 //////////////////////////////////////////////////////////////////////
15 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
17 // This program is free software; you can redistribute it and/or
18 // modify it under the terms of the GNU General Public License
19 // as published by the Free Software Foundation; either version 2
20 // of the License, or (at your option) any later version.
22 require_once("../../globals.php");
23 require_once("$srcdir/api.inc.php");
24 require_once("$srcdir/forms.inc.php");
26 use OpenEMR\Core\Header;
28 $row = array();
30 if (! $encounter) { // comes from globals.php
31 die("Internal error: we do not seem to be in an encounter!");
34 $formid = $_GET['id'];
36 // If Save was clicked, save the info.
38 if ($_POST['bn_save']) {
39 // If updating an existing form...
41 if ($formid) {
42 $query = "UPDATE form_hist_exam_plan SET
43 history = ?,
44 examination = ?,
45 plan = ?,
46 WHERE id = ?";
47 sqlStatement($query, array($_POST['form_history'], $_POST['form_examination'], $_POST['form_plan'], $formid ));
48 } else { // If adding a new form...
49 $query = "INSERT INTO form_hist_exam_plan (
50 history, examination, plan
51 ) VALUES ( ?, ?, ? )";
53 $newid = sqlInsert($query, array($_POST['form_history'], $_POST['form_examination'], $_POST['form_plan'] ));
54 addForm($encounter, "Hist/Exam/Plan", $newid, "hist_exam_plan", $pid, $userauthorized);
57 formHeader("Redirecting....");
58 formJump();
59 formFooter();
60 exit;
63 if ($formid) {
64 $row = sqlQuery("SELECT * FROM form_hist_exam_plan WHERE
65 id = ? AND activity = '1'", array($formid));
68 <html>
69 <head>
70 <?php Header::setupHeader(); ?>
71 </head>
73 <body <?php echo $top_bg_line;?> topmargin="0" rightmargin="0" leftmargin="2"
74 bottommargin="0" marginwidth="2" marginheight="0">
75 <form method="post" action="<?php echo $rootdir ?>/forms/hist_exam_plan/new.php?id=<?php echo attr_url($formid); ?>"
76 onsubmit="return top.restoreSession()">
78 <center>
80 <p>
81 <table border='1' width='95%'>
83 <tr bgcolor='#dddddd'>
84 <td colspan='2' align='center'><b>History, Examination and Plan</b></td>
85 </tr>
87 <tr>
88 <td width='5%' nowrap> History </td>
89 <td width='95%' nowrap>
90 <textarea name='form_history' rows='8' style='width:100%'><?php echo text($row['history']); ?></textarea>
91 </td>
92 </tr>
94 <tr>
95 <td nowrap> Examination </td>
96 <td nowrap>
97 <textarea name='form_examination' rows='8' style='width:100%'><?php echo text($row['examination']); ?></textarea>
98 </td>
99 </tr>
101 <tr>
102 <td nowrap> Plan </td>
103 <td nowrap>
104 <textarea name='form_plan' rows='8' style='width:100%'><?php echo text($row['plan']); ?></textarea>
105 </td>
106 </tr>
108 </table>
111 <input type='submit' name='bn_save' value='Save' />
112 &nbsp;
113 <input type='button' value='Cancel' onclick="parent.closeTab(window.name, false)" />
114 </p>
116 </center>
118 </form>
119 </body>
120 </html>