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.
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
;
30 if (! $encounter) { // comes from globals.php
31 die("Internal error: we do not seem to be in an encounter!");
34 function cbvalue($cbname)
36 return $_POST[$cbname] ?
'1' : '0';
39 function cbinput($name, $colname)
42 $ret = "<input type='checkbox' name='" . attr($name) . "' value='1'";
51 function cbcell($name, $desc, $colname)
53 return "<td width='25%' nowrap>" . cbinput($name, $colname) . "$desc</td>\n";
56 $formid = $_GET['id'];
58 // If Save was clicked, save the info.
60 if ($_POST['bn_save']) {
61 $fu_timing = $_POST['fu_timing'];
62 $fu_location = $_POST['fu_location'];
64 // If updating an existing form...
67 $query = "UPDATE form_specialist_notes SET
73 sqlStatement($query, array($_POST['form_notes'], cbvalue('fu_required'), $fu_timing, $fu_location, $formid));
74 } else { // If adding a new form...
75 $query = "INSERT INTO form_specialist_notes ( " .
76 "notes, followup_required, followup_timing, followup_location " .
77 ") VALUES ( ?, ?, ?, ? )";
78 $newid = sqlInsert($query, array($_POST['form_notes'], cbvalue('fu_required'), $fu_timing, $fu_location));
79 addForm($encounter, "Specialist Notes", $newid, "specialist_notes", $pid, $userauthorized);
82 formHeader("Redirecting....");
89 $row = sqlQuery("SELECT * FROM form_specialist_notes WHERE " .
90 "id = ? AND activity = '1'", array($formid)) ;
95 <?php Header
::setupHeader(); ?
>
98 dlgopen('../../main/calendar/add_edit_event.php?patientid=' +
<?php
echo js_url($pid); ?
>,
105 <body
class="body_top">
106 <form method
="post" action
="<?php echo $rootdir ?>/forms/specialist_notes/new.php?id=<?php echo attr_url($formid); ?>" onsubmit
="return top.restoreSession()">
111 <table border
='1' width
='95%'>
113 <tr bgcolor
='#dddddd'>
114 <td colspan
='2' align
='center'><b
>Notes from Specialist
</b
></td
>
118 <td width
='5%' nowrap
> Notes
</td
>
119 <td width
='95%' nowrap
>
120 <textarea name
='form_notes' rows
='18' style
='width:100%'><?php
echo text($row['notes']); ?
></textarea
>
125 <td nowrap
>Follow Up
</td
>
129 <td width
='1%' nowrap
>
130 <?php
echo cbinput('fu_required', 'followup_required') ?
>Required on
 
;
132 <td width
='49%' nowrap
>
133 <input type
='text' name
='fu_timing' size
='10' style
='width:100%'
134 title
='When to follow up'
135 value
='<?php echo attr($row['followup_timing
']) ?>' />
137 <td width
='1%' nowrap
>
140 <td width
='49%' nowrap
>
141 <input type
='text' name
='fu_location' size
='10' style
='width:100%'
142 title
='Where to follow up'
143 value
='<?php echo attr($row['followup_location
']) ?>' />
153 <input type
='submit' name
='bn_save' value
='Save' />
155 <input type
='button' value
='Add Appointment' onclick
='newEvt()' />
157 <input type
='button' value
='Cancel' onclick
="parent.closeTab(window.name, false)" />