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 function cbvalue($cbname)
33 return $_POST[$cbname] ?
'1' : '0';
36 function cbinput($name, $colname)
39 $ret = "<input type='checkbox' name='$name' value='1'";
48 function cbcell($name, $desc, $colname)
50 return "<td width='25%' nowrap>" . cbinput($name, $colname) . "$desc</td>\n";
53 $formid = $_GET['id'];
55 // If Save was clicked, save the info.
57 if ($_POST['bn_save']) {
58 $fu_timing = $_POST['fu_timing'];
59 $fu_location = $_POST['fu_location'];
61 // If updating an existing form...
64 $query = "UPDATE form_specialist_notes SET " .
65 "notes = '" . $_POST['form_notes'] . "', " .
66 "followup_required = " . cbvalue('fu_required') . ", " .
67 "followup_timing = '$fu_timing'" . ", " .
68 "followup_location = '$fu_location'" . " " .
69 "WHERE id = '$formid'";
71 } // If adding a new form...
74 $query = "INSERT INTO form_specialist_notes ( " .
75 "notes, followup_required, followup_timing, followup_location " .
77 "'" . $_POST['form_notes'] . "', " .
78 cbvalue('fu_required') . ", " .
79 "'$fu_timing'" . ", " .
80 "'$fu_location'" . " " .
82 $newid = sqlInsert($query);
83 addForm($encounter, "Specialist Notes", $newid, "specialist_notes", $pid, $userauthorized);
86 formHeader("Redirecting....");
93 $row = sqlQuery("SELECT * FROM form_specialist_notes WHERE " .
94 "id = '$formid' AND activity = '1'") ;
99 <?php
html_header_show();?
>
100 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
101 <script type
="text/javascript" src
="../../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
102 <script language
='JavaScript'>
104 dlgopen('../../main/calendar/add_edit_event.php?patientid=<?php echo $pid ?>',
111 <body
class="body_top">
112 <form method
="post" action
="<?php echo $rootdir ?>/forms/specialist_notes/new.php?id=<?php echo $formid ?>" onsubmit
="return top.restoreSession()">
117 <table border
='1' width
='95%'>
119 <tr bgcolor
='#dddddd'>
120 <td colspan
='2' align
='center'><b
>Notes from Specialist
</b
></td
>
124 <td width
='5%' nowrap
> Notes
</td
>
125 <td width
='95%' nowrap
>
126 <textarea name
='form_notes' rows
='18' style
='width:100%'><?php
echo $row['notes'] ?
></textarea
>
131 <td nowrap
>Follow Up
</td
>
135 <td width
='1%' nowrap
>
136 <?php
echo cbinput('fu_required', 'followup_required') ?
>Required on
 
;
138 <td width
='49%' nowrap
>
139 <input type
='text' name
='fu_timing' size
='10' style
='width:100%'
140 title
='When to follow up'
141 value
='<?php echo addslashes($row['followup_timing
']) ?>' />
143 <td width
='1%' nowrap
>
146 <td width
='49%' nowrap
>
147 <input type
='text' name
='fu_location' size
='10' style
='width:100%'
148 title
='Where to follow up'
149 value
='<?php echo addslashes($row['followup_location
']) ?>' />
159 <input type
='submit' name
='bn_save' value
='Save' />
161 <input type
='button' value
='Add Appointment' onclick
='newEvt()' />
163 <input type
='button' value
='Cancel' onclick
="parent.closeTab(window.name, false)" />