- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / laboratory / labor_test_param_admin.php
blobd28492302efe296cf1a314b496de0592dae47830
1 <?php
3 define('ROW_MAX',15); # define here the maximum number of rows for displaying the parameters
5 error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
6 require('./roots.php');
7 require($root_path.'include/inc_environment_global.php');
8 /**
9 * CARE2X Integrated Hospital Information System Deployment 2.2 - 2006-07-10
10 * GNU General Public License
11 * Copyright 2002,2003,2004,2005,2006 Elpidio Latorilla
12 * elpidio@care2x.org,
14 * See the file "copy_notice.txt" for the licence notice
16 //$lang_tables=array('chemlab_groups.php','chemlab_params.php');
17 define('LANG_FILE','lab.php');
18 $local_user='ck_lab_user';
19 require_once($root_path.'include/inc_front_chain_lang.php');
21 $thisfile=basename(__FILE__);
23 ///$db->debug=true;
25 # Create lab object
26 require_once($root_path.'include/care_api_classes/class_lab.php');
27 $lab_obj=new Lab();
29 if(!isset($parameterselect)||$parameterselect=='') $parameterselect='priority';
31 $pitems=array('msr_unit','median','lo_bound','hi_bound','lo_critical','hi_critical','lo_toxic','hi_toxic');
33 # Load the date formatter */
34 include_once($root_path.'include/inc_date_format_functions.php');
36 # Get the test test groups
37 $tgroups=&$lab_obj->TestActiveGroups();
39 # Get the test parameter values
40 $tparams=&$lab_obj->TestParamsAdmin($parameterselect);
41 $breakfile="labor.php".URL_APPEND;
43 # Start Smarty templating here
44 /**
45 * LOAD Smarty
48 # Note: it is advisable to load this after the inc_front_chain_lang.php so
49 # that the smarty script can use the user configured template theme
51 require_once($root_path.'gui/smarty_template/smarty_care.class.php');
52 $smarty = new smarty_care('common');
54 # Title in toolbar
55 $smarty->assign('sToolbarTitle',$LDTestParameters);
57 # href for help button
58 $smarty->assign('pbHelp',"javascript:gethelp('lab_param_config.php')");
60 # hide return button
61 $smarty->assign('pbBack',FALSE);
63 # href for close button
64 $smarty->assign('breakfile',$breakfile);
66 # Window bar title
67 $smarty->assign('sWindowTitle',$LDTestParameters);
69 # collect extra javascript code
70 ob_start();
73 <script language="javascript" name="j1">
74 <!--
75 function chkselect(d)
77 if(d.parameterselect.value=="<?php echo $parameterselect ?>"){
78 return false;
82 function editParam(nr)
84 urlholder="<?php echo $root_path ?>modules/laboratory/labor_test_param_edit.php?sid=<?php echo "$sid&lang=$lang" ?>&nr="+nr;
85 editparam_<?php echo $sid ?>=window.open(urlholder,"editparam_<?php echo $sid ?>","width=510,height=390,menubar=no,resizable=yes,scrollbars=yes");
88 function newParam()
90 urlholder="<?php echo $root_path ?>modules/laboratory/labor_test_param_edit.php?sid=<?php echo "$sid&lang=$lang" ?>&mode=new";
91 editparam_<?php echo $sid ?>=window.open(urlholder,"editparam_<?php echo $sid ?>","width=510,height=390,menubar=no,resizable=yes,scrollbars=yes");
93 // -->
94 </script>
96 <?php
98 $sTemp = ob_get_contents();
99 ob_end_clean();
101 $smarty->append('JavaScript',$sTemp);
103 $sTempNew = '<a href="javascript:newParam()"><img '.createLDImgSrc($root_path,'newplan.gif','0').'></a>';
104 $paramName = &$lab_obj->getGroupName($parameterselect);
105 if(isset($paramName) && !empty($paramName)) {
106 $paramName = $paramName->fetchRow();
108 # Assign elements
109 $smarty->assign('sParamNew',$sTempNew);
110 $smarty->assign('sParamGroup',$sTemp. $paramName['name'] );
111 $smarty->assign('LDParameter',$LDParameter);
112 $smarty->assign('LDMsrUnit',$LDMsrUnit);
113 $smarty->assign('LDMedian',$LDMedian);
114 $smarty->assign('LDLowerBound',$LDLowerBound);
115 $smarty->assign('LDUpperBound',$LDUpperBound);
116 $smarty->assign('LDLowerCritical',$LDLowerCritical);
117 $smarty->assign('LDUpperCritical',$LDUpperCritical);
118 $smarty->assign('LDLowerToxic',$LDLowerToxic);
119 $smarty->assign('LDUpperToxic',$LDUpperToxic);
121 $smarty->assign('sFormAction',$thisfile);
122 $smarty->assign('LDSelectParamGroup',$LDSelectParamGroup);
123 $smarty->assign('LDParamGroup',$LDParamGroup);
125 # Generate and buffer parameter rows
127 ob_start();
129 $toggle=0;
131 if(is_object($tparams)){
132 while($tp=$tparams->FetchRow()){
134 //if($toggle) $bgc='#ffffee'; else $bgc='#efefef';
135 if($toggle) $bgc='wardlistrow1'; else $bgc='wardlistrow2';
136 $toggle=!$toggle;
137 if($tp['status']=='hidden') {
138 echo '
139 <tr bgcolor="green">
140 <td ><nobr>&nbsp;';
141 } elseif($tp['status']=='deleted') {
142 echo '
143 <tr bgcolor="red">
144 <td ><nobr>&nbsp;';
145 } else {
146 echo '
147 <tr class="'.$bgc.'">
148 <td ><nobr>&nbsp;';
152 if(isset($parameters[$tp['id']])&&!empty($parameters[$tp['id']])) echo $parameters[$tp['id']];
153 else echo $tp['name'];
155 echo '&nbsp;</nobr></td>';
157 while(list($x,$v)=each($pitems)){
158 echo '
159 <td>';
160 if($x){
161 if($tp[$v]>0) echo $tp[$v];
162 }else{
163 echo $tp[$v];
165 echo '&nbsp;
166 </td>';
168 reset($pitems);
170 echo '
171 <td>
172 <a href="javascript:editParam('.$tp['nr'].')"><img '.createLDImgSrc($root_path,'edit_sm.gif','0').'></a>
173 </td>';
174 echo '
175 </tr>';
179 $sTemp = ob_get_contents();
181 ob_end_clean();
182 $sShortHelp = $sShortHelp. "<font color=\"green\">$LDHiddenParams</font><br>";
183 $sShortHelp = $sShortHelp. "<font color=\"red\">$LDDeletedParams</font><br>";
184 $smarty->assign('sTestParamsRows',$sTemp);
185 $smarty->assign('sShortHelp',$sShortHelp);
186 # Create the parameter group select
188 $sTemp = '<select name="parameterselect" size=1>';
190 while($tg=$tgroups->FetchRow()){
191 $sTemp = $sTemp.'<option value="'.$tg['id'].'"';
192 if($parameterselect==$tg['id']) $sTemp = $sTemp.' selected';
193 $sTemp = $sTemp.'>';
194 if(isset($parametergruppe[$tg['id']])&&!empty($parametergruppe[$tg['group_id']])) $sTemp = $sTemp.$parametergruppe[$tg['id']];
195 else $sTemp = $sTemp.$tg['name'];
196 $sTemp = $sTemp.'</option>';
197 $sTemp = $sTemp."\n";
199 $sTemp = $sTemp.'</select>';
201 $smarty->assign('sParamGroupSelect',$sTemp);
203 # Assign the parameter group hidden and submit inputs
206 $smarty->assign('sSubmitSelect','<input type=hidden name="sid" value="'.$sid.'">
207 <input type=hidden name="lang" value="'.$lang.'">
208 <input type="image" '.createLDImgSrc($root_path,'auswahl2.gif','0').'>');
210 $smarty->assign('sMainBlockIncludeFile','laboratory/test_params.tpl');
213 * show Template
215 $smarty->display('common/mainframe.tpl');