initial checkin
[openemr.git] / contrib / forms / hist_exam_plan / view.php
blob5a69fb0724e658b39f129e886f593704eeb5cf11
1 <?php
2 //////////////////////////////////////////////////////////////////////
3 // ------------------ DO NOT MODIFY VIEW.PHP !!! ---------------------
4 // View.php is an exact duplicate of new.php. If you wish to make
5 // any changes, then change new.php and either (recommended) make
6 // view.php a symbolic link to new.php, or copy new.php to view.php.
7 //
8 // And if you check in a change to either module, be sure to check
9 // in the other (identical) module also.
11 // This nonsense will go away if we ever move to subversion.
12 //////////////////////////////////////////////////////////////////////
14 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
16 // This program is free software; you can redistribute it and/or
17 // modify it under the terms of the GNU General Public License
18 // as published by the Free Software Foundation; either version 2
19 // of the License, or (at your option) any later version.
21 include_once("../../globals.php");
22 include_once("$srcdir/api.inc");
23 include_once("$srcdir/forms.inc");
25 $row = array();
27 if (! $encounter) { // comes from globals.php
28 die("Internal error: we do not seem to be in an encounter!");
31 $formid = $_GET['id'];
33 // If Save was clicked, save the info.
35 if ($_POST['bn_save']) {
37 // If updating an existing form...
39 if ($formid) {
40 $query = "UPDATE form_hist_exam_plan SET " .
41 "history = '" . $_POST['form_history'] . "', " .
42 "examination = '" . $_POST['form_examination'] . "', " .
43 "plan = '" . $_POST['form_plan'] . "' " .
44 "WHERE id = '$formid'";
45 sqlStatement($query);
48 // If adding a new form...
50 else {
51 $query = "INSERT INTO form_hist_exam_plan ( " .
52 "history, examination, plan " .
53 ") VALUES ( " .
54 "'" . $_POST['form_history'] . "', " .
55 "'" . $_POST['form_examination'] . "', " .
56 "'" . $_POST['form_plan'] . "' " .
57 ")";
58 $newid = sqlInsert($query);
59 addForm($encounter, "Hist/Exam/Plan", $newid, "hist_exam_plan", $pid, $userauthorized);
62 formHeader("Redirecting....");
63 formJump();
64 formFooter();
65 exit;
68 if ($formid) {
69 $row = sqlQuery ("SELECT * FROM form_hist_exam_plan WHERE " .
70 "id = '$formid' AND activity = '1'") ;
73 <html>
74 <head>
75 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
76 <script language="JavaScript">
77 </script>
78 </head>
80 <body <?echo $top_bg_line;?> topmargin="0" rightmargin="0" leftmargin="2"
81 bottommargin="0" marginwidth="2" marginheight="0">
82 <form method="post" action="<? echo $rootdir ?>/forms/hist_exam_plan/new.php?id=<? echo $formid ?>">
84 <center>
86 <p>
87 <table border='1' width='95%'>
89 <tr bgcolor='#dddddd'>
90 <td colspan='2' align='center'><b>History, Examination and Plan</b></td>
91 </tr>
93 <tr>
94 <td width='5%' nowrap> History </td>
95 <td width='95%' nowrap>
96 <textarea name='form_history' rows='8' style='width:100%'><? echo $row['history'] ?></textarea>
97 </td>
98 </tr>
100 <tr>
101 <td nowrap> Examination </td>
102 <td nowrap>
103 <textarea name='form_examination' rows='8' style='width:100%'><? echo $row['examination'] ?></textarea>
104 </td>
105 </tr>
107 <tr>
108 <td nowrap> Plan </td>
109 <td nowrap>
110 <textarea name='form_plan' rows='8' style='width:100%'><? echo $row['plan'] ?></textarea>
111 </td>
112 </tr>
114 </table>
117 <input type='submit' name='bn_save' value='Save' />
118 &nbsp;
119 <input type='button' value='Cancel' onclick="location='<? echo "$rootdir/patient_file/encounter/patient_encounter.php" ?>'" />
120 </p>
122 </center>
124 </form>
125 </body>
126 </html>