Contributed GYM Forms, some of the table.sql files include inserts into list_options...
[openemr.git] / contrib / forms / pelvic_soap / show.php
bloba6a93056d09369401cc32ce5a17e842fdeafca71
1 <?php
2 /*
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.
4 */
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. **/
17 $form_name = 'POP';
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');
24 if (!$thisauth) {
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']))
31 $thisauth = 0;
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',
40 'data_type' => '25',
41 'fld_length' => '140',
42 'description' => '',
43 'list_id' => 'Pelvic_Complaints' ),
44 'pelvic_exam' =>
45 array( 'field_id' => 'pelvic_exam',
46 'data_type' => '25',
47 'fld_length' => '140',
48 'description' => '',
49 'list_id' => 'Pelvic_Exam' ),
50 'pelvic_assessment' =>
51 array( 'field_id' => 'pelvic_assessment',
52 'data_type' => '25',
53 'fld_length' => '140',
54 'description' => '',
55 'list_id' => 'Pelvic_Assessment' ),
56 'pelvic_plan' =>
57 array( 'field_id' => 'pelvic_plan',
58 'data_type' => '25',
59 'fld_length' => '140',
60 'description' => '',
61 'list_id' => 'Pelvic_Plan' ),
62 'plan_discussion' =>
63 array( 'field_id' => 'plan_discussion',
64 'data_type' => '3',
65 'fld_length' => '151',
66 'max_length' => '4',
67 'description' => '',
68 'list_id' => '' )
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">
84 <head>
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 -->
90 <!-- for dialog -->
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; ?>");
108 </script>
109 <title><?php echo htmlspecialchars('Show '.$form_name); ?></title>
111 </head>
112 <body class="body_top">
114 <div id="title">
115 <span class="title"><?php xl($form_name,'e'); ?></span>
116 <?php
117 if ($thisauth == 'write' || $thisauth == 'addonly')
118 { ?>
119 <a href="<?php echo $returnurl; ?>" onclick="top.restoreSession()">
120 <span class="back"><?php xl($tmore,'e'); ?></span>
121 </a>
122 <?php }; ?>
123 </div>
125 <form method="post" id="<?php echo $form_folder; ?>" action="">
127 <!-- container for the main body of the form -->
128 <div id="form_container">
130 <div id="show">
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'>&nbsp;</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>
139 </table>
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'); ?>" />
150 </fieldset>
151 </div><!-- end button_bar -->
153 </form>
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(); });
160 </script>
161 </body>
162 </html>