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.
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");
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...
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'";
48 // If adding a new form...
51 $query = "INSERT INTO form_hist_exam_plan ( " .
52 "history, examination, plan " .
54 "'" . $_POST['form_history'] . "', " .
55 "'" . $_POST['form_examination'] . "', " .
56 "'" . $_POST['form_plan'] . "' " .
58 $newid = sqlInsert($query);
59 addForm($encounter, "Hist/Exam/Plan", $newid, "hist_exam_plan", $pid, $userauthorized);
62 formHeader("Redirecting....");
69 $row = sqlQuery ("SELECT * FROM form_hist_exam_plan WHERE " .
70 "id = '$formid' AND activity = '1'") ;
75 <?
html_header_show();?
>
76 <link rel
=stylesheet href
="<?echo $css_header;?>" type
="text/css">
77 <script language
="JavaScript">
81 <body
<?
echo $top_bg_line;?
> topmargin
="0" rightmargin
="0" leftmargin
="2"
82 bottommargin
="0" marginwidth
="2" marginheight
="0">
83 <form method
="post" action
="<? echo $rootdir ?>/forms/hist_exam_plan/new.php?id=<? echo $formid ?>"
84 onsubmit
="return top.restoreSession()">
89 <table border
='1' width
='95%'>
91 <tr bgcolor
='#dddddd'>
92 <td colspan
='2' align
='center'><b
>History
, Examination
and Plan
</b
></td
>
96 <td width
='5%' nowrap
> History
</td
>
97 <td width
='95%' nowrap
>
98 <textarea name
='form_history' rows
='8' style
='width:100%'><?
echo $row['history'] ?
></textarea
>
103 <td nowrap
> Examination
</td
>
105 <textarea name
='form_examination' rows
='8' style
='width:100%'><?
echo $row['examination'] ?
></textarea
>
110 <td nowrap
> Plan
</td
>
112 <textarea name
='form_plan' rows
='8' style
='width:100%'><?
echo $row['plan'] ?
></textarea
>
119 <input type
='submit' name
='bn_save' value
='Save' />
121 <input type
='button' value
='Cancel' onclick
="top.restoreSession();location='<?php echo $GLOBALS['form_exit_url']; ?>'" />