2 // Copyright (C) 2010 Brady Miller <brady@sparmy.com>
3 // Modified 2011 Rod Roark <rod@sunsetsystems.com>
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 $special_timeout = 3600;
11 include_once("../../globals.php");
13 $formname = $_GET["formname"];
14 $is_lbf = substr($formname, 0, 3) === 'LBF';
16 //Bring in the style sheet
18 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
20 // Hide the current value css entries. This is currently specific
21 // for the vitals form but could use this mechanism for other
24 // currentvalues - input boxes
25 // valuesunfocus - input boxes that are auto-calculated
26 // editonly - the edit and cancel buttons
28 // readonly - the link back to summary screen
29 // Also customize the 'graph' class to look like links.
32 .currentvalues
{ display
: none
;}
33 .valuesunfocus
{ display
: none
;}
34 .editonly
{ display
: none
;}
36 .graph
{color
:#0000cc;}
41 margin
:0em
1em
2em
2em
;
45 <script type
="text/javascript" src
="../../../library/js/jquery.1.3.2.js"></script
>
46 <script type
="text/javascript" src
="../../../library/openflashchart/js/json/json2.js"></script
>
47 <script type
="text/javascript" src
="../../../library/openflashchart/js/swfobject.js"></script
>
48 <script type
="text/javascript">
50 // variable that holds graph information for the open_flash_chart_data() function
53 // Function that is built into swfobject.js script that will collect the
54 // data used for the graph.
55 function open_flash_chart_data()
57 return JSON
.stringify(data
);
60 // Show the selected chart in the 'chart' div element
61 function show_graph(table_graph
, name_graph
, title_graph
)
64 $
.ajax({ url
: '../../../library/openflashchart/graphs.php',
66 data
: ({ table
: table_graph
,
71 success
: function(returnData
){
72 // place the raw graph data in the data variable
74 // this function will automatically call open_flash_chart_data() in order to collect the raw data
75 swfobject
.embedSWF('../../../library/openflashchart/open-flash-chart.swf', "chart", "650", "200", "9.0.0");
76 // ensure show the chart div
86 $
(document
).ready(function(){
88 // Use jquery to show the 'readonly' class entries
89 $
('.readonly').show();
91 // Place click callback for graphing
92 $
(".graph").click(function(e
){ show_graph('<?php echo $is_lbf ? $formname : 'form_vitals
'; ?>', this
.id
, $
(this
).text()) });
94 // Show hovering effects for the .graph links
97 $
(this
).css({color
:'#ff5555'}); //mouseover
100 $
(this
).css({color
:'#0000cc'}); // mouseout
104 // show blood pressure graph by default
105 <?php
if ($formname == 'LBFfms') { ?
>
106 show_graph('<?php echo $formname; ?>','total','Sum of Scores');
107 <?php
} else if ($is_lbf) { ?
>
108 show_graph('<?php echo $formname; ?>','bp_systolic','');
110 show_graph('form_vitals','bps','');
117 // Use the List Based Forms engine for all LBFxxxxx forms.
118 include_once("$incdir/forms/LBF/new.php");
121 include_once("$incdir/forms/$formname/new.php");