Updated translation table after fixing script in previous commit
[openemr.git] / contrib / forms / hist_exam_plan / view.php
blobdb9448475b518fa612fc9cb03a5e2a8be7e720c6
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 <?php html_header_show();?>
76 <link rel=stylesheet href="<?php echo $css_header;?>" type="text/css">
77 <script language="JavaScript">
78 </script>
79 </head>
81 <body <?php echo $top_bg_line;?> topmargin="0" rightmargin="0" leftmargin="2"
82 bottommargin="0" marginwidth="2" marginheight="0">
83 <form method="post" action="<?php echo $rootdir ?>/forms/hist_exam_plan/new.php?id=<?php echo $formid ?>"
84 onsubmit="return top.restoreSession()">
86 <center>
88 <p>
89 <table border='1' width='95%'>
91 <tr bgcolor='#dddddd'>
92 <td colspan='2' align='center'><b>History, Examination and Plan</b></td>
93 </tr>
95 <tr>
96 <td width='5%' nowrap> History </td>
97 <td width='95%' nowrap>
98 <textarea name='form_history' rows='8' style='width:100%'><?php echo $row['history'] ?></textarea>
99 </td>
100 </tr>
102 <tr>
103 <td nowrap> Examination </td>
104 <td nowrap>
105 <textarea name='form_examination' rows='8' style='width:100%'><?php echo $row['examination'] ?></textarea>
106 </td>
107 </tr>
109 <tr>
110 <td nowrap> Plan </td>
111 <td nowrap>
112 <textarea name='form_plan' rows='8' style='width:100%'><?php echo $row['plan'] ?></textarea>
113 </td>
114 </tr>
116 </table>
119 <input type='submit' name='bn_save' value='Save' />
120 &nbsp;
121 <input type='button' value='Cancel' onclick="top.restoreSession();location='<?php echo $GLOBALS['form_exit_url']; ?>'" />
122 </p>
124 </center>
126 </form>
127 </body>
128 </html>