- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / registration_admission / gui_bridge / default / gui_show.php
blob46b9e277ada36fe4173e3236ec75f16a605d63d2
1 <?php
3 $returnfile=$HTTP_SESSION_VARS['sess_file_return'];
5 $HTTP_SESSION_VARS['sess_file_return']=$thisfile;
7 if($HTTP_COOKIE_VARS["ck_login_logged".$sid]) $breakfile = $root_path."main/startframe.php".URL_APPEND;
8 else $breakfile = $breakfile.URL_APPEND."&target=entry";
10 # Start Smarty templating here
11 /**
12 * LOAD Smarty
14 # Note: it is advisable to load this after the inc_front_chain_lang.php so
15 # that the smarty script can use the user configured template theme
17 require_once($root_path.'gui/smarty_template/smarty_care.class.php');
18 $smarty = new smarty_care('common');
20 if($parent_admit) $sTitleNr= ($HTTP_SESSION_VARS['sess_full_en']);
21 else $sTitleNr = ($HTTP_SESSION_VARS['sess_full_pid']);
23 # Title in the toolbar
24 $smarty->assign('sToolbarTitle',"$page_title ($sTitleNr)");
26 # href for help button
27 $smarty->assign('pbHelp',"javascript:gethelp('submenu1.php','$LDPatientRegister')");
29 $smarty->assign('breakfile',$breakfile);
31 # Window bar title
32 $smarty->assign('title',"$page_title ( $sTitleNr)");
34 # Onload Javascript code
35 $smarty->assign('sOnLoadJs',"if (window.focus) window.focus();");
37 # href for help button
38 $smarty->assign('pbHelp',"javascript:gethelp('notes_router.php','echo $notestype','".strtr($subtitle,' ','+')."','$mode','$rows')");
40 # href for return button
41 $smarty->assign('pbBack',$returnfile.URL_APPEND.'&pid='.$HTTP_SESSION_VARS['sess_pid'].'&target='.$target.'&mode=show&type_nr='.$type_nr);
43 # Start buffering extra javascript output
44 ob_start();
48 <script language="javascript">
49 <!--
51 <?php require($root_path.'include/inc_checkdate_lang.php'); ?>
53 function popRecordHistory(table,pid) {
54 urlholder="./record_history.php<?php echo URL_REDIRECT_APPEND; ?>&table="+table+"&pid="+pid;
55 HISTWIN<?php echo $sid ?>=window.open(urlholder,"histwin<?php echo $sid ?>","menubar=no,width=400,height=550,resizable=yes,scrollbars=yes");
57 -->
58 </script>
59 <?php
60 if($parent_admit) include($root_path.'include/inc_js_barcode_wristband_popwin.php');
62 $sTemp = ob_get_contents();
63 ob_end_clean();
64 $smarty->append('JavaScript',$sTemp);
66 /* Load the tabs */
67 if($parent_admit) {
68 $tab_bot_line='#66ee66';
69 include('./gui_bridge/default/gui_tabs_patadmit.php');
70 $smarty->assign('sTabsFile','registration_admission/admit_tabs.tpl');
71 $smarty->assign('sClassItem','class="adm_item"');
72 $smarty->assign('sClassInput','class="adm_input"');
73 }else{
74 $tab_bot_line='#66ee66';
75 include('./gui_bridge/default/gui_tabs_patreg.php');
76 $smarty->assign('sTabsFile','registration_admission/reg_tabs.tpl');
77 $smarty->assign('sClassItem','class="reg_item"');
78 $smarty->assign('sClassInput','class="reg_input"');
81 # If encounter is already discharged, show warning
83 if($parent_admit&&$is_discharged){
85 $smarty->assign('is_discharged',TRUE);
86 $smarty->assign('sWarnIcon',"<img ".createComIcon($root_path,'warn.gif','0','absmiddle',TRUE).">");
87 if($current_encounter) $smarty->assign('sDischarged',$LDEncounterClosed);
88 else $smarty->assign('sDischarged',$LDPatientIsDischarged);
91 if($parent_admit) $smarty->assign('LDCaseNr',$LDAdmitNr);
92 else $smarty->assign('LDCaseNr',$LDRegistrationNr);
94 if($parent_admit) $smarty->assign('sEncNrPID',$HTTP_SESSION_VARS['sess_full_en']);
95 else $smarty->assign('sEncNrPID',$HTTP_SESSION_VARS['sess_full_pid']);
97 $smarty->assign('img_source',"<img $img_source>");
99 $smarty->assign('LDTitle',$LDTitle);
100 $smarty->assign('title',$title);
101 $smarty->assign('LDLastName',$LDLastName);
102 $smarty->assign('name_last',$name_last);
103 $smarty->assign('LDFirstName',$LDFirstName);
104 $smarty->assign('name_first',$name_first);
106 # If person is dead show a black cross and assign death date
108 if($death_date && $death_date != DBF_NODATE){
109 $smarty->assign('sCrossImg','<img '.createComIcon($root_path,'blackcross_sm.gif','0','',TRUE).'>');
110 $smarty->assign('sDeathDate',@formatDate2Local($death_date,$date_format));
113 # Set a row span counter, initialize with 7
114 $iRowSpan = 7;
116 if($GLOBAL_CONFIG['patient_name_2_show']&&$name_2){
117 $smarty->assign('LDName2',$LDName2);
118 $smarty->assign('name_2',$name_2);
119 $iRowSpan++;
122 if($GLOBAL_CONFIG['patient_name_3_show']&&$name_3){
123 $smarty->assign('LDName3',$LDName3);
124 $smarty->assign('name_3',$name_3);
125 $iRowSpan++;
128 if($GLOBAL_CONFIG['patient_name_middle_show']&&$name_middle){
129 $smarty->assign('LDNameMid',$LDNameMid);
130 $smarty->assign('name_middle',$name_middle);
131 $iRowSpan++;
134 $smarty->assign('sRowSpan',"rowspan=\"$iRowSpan\"");
136 $smarty->assign('LDBday',$LDBday);
137 $smarty->assign('sBdayDate',@formatDate2Local($date_birth,$date_format));
139 $smarty->assign('LDSex',$LDSex);
140 if($sex=='m') $smarty->assign('sSexType',$LDMale);
141 elseif($sex=='f') $smarty->assign('sSexType',$LDFemale);
143 $smarty->assign('LDBloodGroup',$LDBloodGroup);
144 if($blood_group){
145 $buf='LD'.$blood_group;
146 $smarty->assign('blood_group',$$buf);
149 /* Buffer and load the options table */
151 ob_start();
153 if($parent_admit) include('./gui_bridge/default/gui_patient_encounter_showdata_options.php');
154 else include('./gui_bridge/default/gui_patient_reg_options.php');
156 $sTemp = ob_get_contents();
157 ob_end_clean();
159 $smarty->assign('sOptionsMenu',$sTemp);
161 # If mode = show then display data
163 if($mode=='show'){
165 if($parent_admit) $bgimg='tableHeaderbg3.gif';
166 else $bgimg='tableHeader_gr.gif';
168 $tbg= 'background="'.$root_path.'gui/img/common/'.$theme_com_icon.'/'.$bgimg.'"';
170 if($rows){
172 # Buffer the option block
173 ob_start();
174 include('./gui_bridge/default/gui_'.$thisfile);
175 $sTemp = ob_get_contents();
176 ob_end_clean();
177 $smarty->assign('sOptionBlock',$sTemp);
179 }else{
181 $smarty->assign('bShowNoRecord',TRUE);
183 $smarty->assign('sMascotImg','<img '.createMascot($root_path,'mascot1_r.gif','0','absmiddle').'>');
184 $smarty->assign('norecordyet',$norecordyet);
186 if($parent_admit && !$is_discharged && $thisfile!='show_diagnostics_result.php'){
187 $smarty->assign('sPromptIcon','<img '.createComIcon($root_path,'bul_arrowgrnlrg.gif','0','absmiddle',TRUE).'>');
188 $smarty->assign('sPromptLink','<a href="'.$thisfile.URL_APPEND.'&pid='.$HTTP_SESSION_VARS['sess_pid'].'&target='.$target.'&mode=new">'.$LDEnterNewRecord.'</a>');
189 }else{
190 if(file_exists('./gui_bridge/default/gui_person_createnew_'.$thisfile)) include('./gui_bridge/default/gui_person_createnew_'.$thisfile);
193 }else {
195 # Buffer the option input block
196 ob_start();
197 include('./gui_bridge/default/gui_input_'.$thisfile);
198 $sTemp = ob_get_contents();
199 ob_end_clean();
200 $smarty->assign('sOptionBlock',$sTemp);
203 # Buffer the bottom controls
205 ob_start();
207 if($parent_admit) {
208 include('./include/bottom_controls_admission_options.inc.php');
209 }else{
210 include('./include/bottom_controls_registration_options.inc.php');
213 # Get buffer contents and stop buffering
215 $sTemp= ob_get_contents();
216 ob_end_clean();
218 $smarty->assign('sBottomControls',$sTemp);
221 $smarty->assign('pbBottomClose','<a href="'.$breakfile.'"><img '.createLDImgSrc($root_path,'close2.gif','0').' title="'.$LDCancel.'" align="absmiddle"></a>');
224 $smarty->assign('sMainBlockIncludeFile','registration_admission/common_option.tpl');
227 $smarty->display('common/mainframe.tpl');