3 * The page shown when the user requests to see this form in a "report view". does not allow editing contents, or saving. has 'print' and 'delete' buttons.
6 /* for $GLOBALS[], ?? */
7 require_once('../../globals.php');
8 /* for acl_check(), ?? */
9 require_once($GLOBALS['srcdir'].'/api.inc');
10 /* for display_layout_rows(), ?? */
11 require_once($GLOBALS['srcdir'].'/options.inc.php');
13 /** CHANGE THIS - name of the database table associated with this form **/
14 $table_name = 'form_pelvic_soap';
16 /** CHANGE THIS name to the name of your form. **/
19 /** CHANGE THIS to match the folder you created for this form. **/
20 $form_folder = 'pelvic_soap';
22 /* Check the access control lists to ensure permissions to this page */
23 $thisauth = acl_check('patients', 'med');
25 die($form_name.': Access Denied.');
27 /* perform a squad check for pages touching patients, if we're in 'athletic team' mode */
28 if ($GLOBALS['athletic_team']!='false') {
29 $tmp = getPatientData($pid, 'squad');
30 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
33 /* Use the formFetch function from api.inc to load the saved record */
34 $xyzzy = formFetch($table_name, $_GET['id']);
36 /* in order to use the layout engine's draw functions, we need a fake table of layout data. */
37 $manual_layouts = array(
38 'pelvic_complaints' =>
39 array( 'field_id' => 'pelvic_complaints',
41 'fld_length' => '140',
43 'list_id' => 'Pelvic_Complaints' ),
45 array( 'field_id' => 'pelvic_exam',
47 'fld_length' => '140',
49 'list_id' => 'Pelvic_Exam' ),
50 'pelvic_assessment' =>
51 array( 'field_id' => 'pelvic_assessment',
53 'fld_length' => '140',
55 'list_id' => 'Pelvic_Assessment' ),
57 array( 'field_id' => 'pelvic_plan',
59 'fld_length' => '140',
61 'list_id' => 'Pelvic_Plan' ),
63 array( 'field_id' => 'plan_discussion',
65 'fld_length' => '151',
71 /* since we have no-where to return, abuse returnurl to link to the 'edit' page */
72 /* FIXME: pass the ID, create blank rows if necissary. */
73 $returnurl = "../../forms/$form_folder/view.php?mode=noencounter";
76 /* define check field functions. used for translating from fields to html viewable strings */
78 function chkdata_Txt(&$record, $var) {
79 return htmlspecialchars($record{"$var"},ENT_QUOTES
);
82 ?
><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
83 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="en">
86 <!-- declare this document
as being encoded in UTF
-8 -->
87 <meta http
-equiv
="Content-Type" content
="text/html;charset=utf-8" ></meta
>
89 <!-- supporting javascript code
-->
91 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot']; ?>/library/dialog.js"></script
>
92 <!-- For jquery
, required by edit
, print, and delete buttons
. -->
93 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot']; ?>/library/js/jquery.js"></script
>
94 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot']; ?>/library/textformat.js"></script
>
96 <!-- Global Stylesheet
-->
97 <link rel
="stylesheet" href
="<?php echo $css_header; ?>" type
="text/css"/>
98 <!-- Form Specific Stylesheet
. -->
99 <link rel
="stylesheet" href
="../../forms/<?php echo $form_folder; ?>/style.css" type
="text/css"/>
101 <script type
="text/javascript">
103 <!-- FIXME
: this needs to detect access method
, and construct a URL appropriately
! -->
104 function PrintForm() {
105 newwin
= window
.open("<?php echo $rootdir.'/forms/'.$form_folder.'/print.php?id='.$_GET['id']; ?>","print_<?php echo $form_name; ?>");
109 <title
><?php
echo htmlspecialchars('Show '.$form_name); ?
></title
>
112 <body
class="body_top">
115 <span
class="title"><?php
xl($form_name,'e'); ?
></span
>
117 if ($thisauth == 'write' ||
$thisauth == 'addonly')
119 <a href
="<?php echo $returnurl; ?>" onclick
="top.restoreSession()">
120 <span
class="back"><?php
xl($tmore,'e'); ?
></span
>
125 <form method
="post" id
="<?php echo $form_folder; ?>" action
="">
127 <!-- container
for the main body of the form
-->
128 <div id
="form_container">
132 <!-- display the form
's manual based fields -->
133 <table border='0' cellpadding='0' width='100%
'>
134 <tr><td class='sectionlabel
'>Subjective</td><!-- called consumeRows 012--> <!-- called consumeRows 212--> <!-- Exiting not($fields)0--></tr>
135 <tr><td class='sectionlabel
'>Objective</td><!-- called consumeRows 012--> <!-- called consumeRows 212--> <!-- Exiting not($fields)0--></tr>
136 <tr><td class='sectionlabel
'>Assessment</td><!-- called consumeRows 012--> <!-- called consumeRows 212--> <!-- Exiting not($fields)0--></tr>
137 <tr><td class='sectionlabel
'>Plan</td><!-- called consumeRows 012--> </tr>
138 <tr><td valign='top
'> </td><!-- called consumeRows 012--> <td class='fieldlabel
' colspan='1'><?php echo xl_layout_label('Discussion
','e
').':'; ?></td><td class='text data
' colspan='1'><?php echo generate_display_field($manual_layouts['plan_discussion
'], $xyzzy['plan_discussion
']); ?></td><!-- called consumeRows 212--> <!-- Exiting not($fields)0--></tr>
142 </div><!-- end show -->
144 </div><!-- end form_container -->
146 <!-- Print button -->
147 <div id="button_bar" class="button_bar">
148 <fieldset class="button_bar">
149 <input type="button" class="print" value="<?php xl('Print','e
'); ?>" />
151 </div><!-- end button_bar -->
154 <script type="text/javascript">
155 // jQuery stuff to make the page a little easier to use
157 $(document).ready(function(){
158 $(".print").click(function() { PrintForm(); });