2 error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
);
3 require('./roots.php');
4 require($root_path.'include/inc_environment_global.php');
6 * CARE2X Integrated Hospital Information System Deployment 2.2 - 2006-07-10
7 * GNU General Public License
8 * Copyright 2002,2003,2004,2005,2006 Elpidio Latorilla
11 * See the file "copy_notice.txt" for the licence notice
14 # If cache must be deactivated, set $force_no_cache to true
17 $lang_tables[]='departments.php';
18 $lang_tables[]='prompt.php';
19 define('LANG_FILE','doctors.php');
20 define('NO_2LEVEL_CHK',1);
21 require_once($root_path.'include/inc_front_chain_lang.php');
23 require_once($root_path.'include/care_api_classes/class_core.php');
30 case "docs": $breakfile='doctors.php'.URL_APPEND
; break;
31 case "op": $breakfile=$root_path.'main/op-doku.php'.URL_APPEND
; break;
32 default: $breakfile='doctors.php'.URL_APPEND
;
35 $thisfile=basename(__FILE__
);
46 if($dept_nr) $hilitedept=$dept_nr;
50 # Prepare the date. We need to consider the early morning hours or until the DOC_CHANGE_TIME value has passed
53 $plan_yesterday=date('Y-m-d',mktime(0,0,0,date('m'),date('d')-1,date('Y')));
55 if(date('H.i')<DOC_CHANGE_TIME
){
56 $plan_date=$plan_yesterday;
57 $plan_day=date('d',mktime(0,0,0,date('m'),date('d')-1,date('Y')));
59 $plan_date=date('Y-m-d');
63 # If plan date is today, attempt to delete the cached plan of yesterday
65 $core->deleteDBCache('DOCS_'.$plan_yesterday);
67 //echo "$plan_date $plan_day";
72 if(!$is_cached=$core->getDBCache('DOCS_'.$plan_date,$cached_plan)) $force_no_cache=true;
75 if($force_no_cache ||
(!$force_no_cache && !$is_cached)){
77 if($dept_nr) $hilitedept=$dept_nr;
79 # Load the department list with oncall doctors
80 include_once($root_path.'include/care_api_classes/class_department.php');
81 $dept_obj=new Department
;
82 $dept_DOC=$dept_obj->getAllActiveWithDOC();
83 include_once($root_path.'include/care_api_classes/class_personell.php');
84 $pers_obj=new Personell
;
85 $quicklist=&$pers_obj->getDOCQuicklist($dept_DOC,$pyear,$pmonth);
88 # Start Smarty templating here
93 # Note: it is advisable to load this after the inc_front_chain_lang.php so
94 # that the smarty script can use the user configured template theme
96 require_once($root_path.'gui/smarty_template/smarty_care.class.php');
97 $smarty = new smarty_care('common');
100 $smarty->assign('sToolbarTitle',$LDDocsOnDuty);
102 # href for help button
103 $smarty->assign('pbHelp',"javascript:gethelp('docs_duty_quickview.php')");
105 # href for close button
106 $smarty->assign('breakfile',$breakfile);
108 # Body onLoad javascript
109 $smarty->assign('sOnLoadJs','onUnload="killchild()"');
112 $smarty->assign('sWindowTitle',$LDDocsOnDuty);
114 # Collect extra javascript
120 <script language
="javascript">
123 function popinfo(l
,d
)
125 urlholder
="doctors-dienstplan-popinfo.php<?php echo URL_REDIRECT_APPEND ?>&nr="+l+
"&dept_nr="+d+
"&user=<?php echo $aufnahme_user.'"' ?>;
127 infowin=window.open(urlholder,"dienstinfo","width=400,height=300,menubar=no,resizable=yes,scrollbars=yes");
136 $sTemp=ob_get_contents();
138 $smarty->append('JavaScript
',$sTemp);
146 <table cellpadding="2" cellspacing=0 border="0" >
147 <tr class="wardlisttitlerow" align=center>
150 for($j=0;$j<sizeof($LDTabElements);$j++)
151 echo '<td
> 
; '.$LDTabElements[$j].'  
; 
;</td
>';
155 if(!$force_no_cache&&$is_cached){
158 <td colspan
=6><font face
="verdana,arial" size
=2> <img
'.createComIcon($root_path,'warn
.gif
','0').'> <font color
=red
>'.$LDCachedInfo.'</font
> <a href
="'.$thisfile.URL_APPEND.'&force_no_cache=1&retpath='.$retpath.'">'.$LDClkNoCache.'</a
>
162 $cached_plan=str_replace('URLAPPEND
',URL_APPEND,$cached_plan);
163 $cached_plan=str_replace('IMGALT
',$LDShowActualPlan,$cached_plan);
164 $cached_plan=str_replace('SHOWBUTTON
',$LDShow,$cached_plan);
165 echo str_replace('URLREDIRECTAPPEND
',URL_REDIRECT_APPEND,$cached_plan);
172 # Start generating the DOC list
176 while(list($x,$v)=each($dept_DOC)){
178 if(in_array($v['nr
'],$quicklist)){
179 if($dutyplan=$pers_obj->getDOCDutyplan($v['nr
'],$pyear,$pmonth)){
181 $a=unserialize($dutyplan['duty_1_txt
']);
182 $r=unserialize($dutyplan['duty_2_txt
']);
183 $ha=unserialize($dutyplan['duty_1_pnr
']);
184 $hr=unserialize($dutyplan['duty_2_pnr
']);
185 if($ha['ha
'.($plan_day-1)]) $DOC_1=$pers_obj->getPersonellInfo($ha['ha
'.($plan_day-1)]);
186 if($hr['hr
'.($plan_day-1)]) $DOC_2=$pers_obj->getPersonellInfo($hr['hr
'.($plan_day-1)]);
190 if(isset($a)) unset($a);
191 if(isset($r)) unset($r);
192 if(isset($ha)) unset($ha);
193 if(isset($hr)) unset($hr);
194 if(isset($DOC_1)) unset($DOC_1);
195 if(isset($DOC_2)) unset($DOC_2);
201 if($hilitedept==$v['nr
']){
202 $temp_out.='<tr
class="hilite">'; $bold="<font color=\"red\" size=2><b>";$boldx="</b></font>";
204 elseif ($toggler==0) {
205 $temp_out.='<tr
class="wardlistrow1">'; $toggler=1;
207 $temp_out.='<tr
class="wardlistrow2">'; $toggler=0;
210 $temp_out.='<td
><font size
="1" > 
;'.$bold;
212 if(isset($$buff)&&!empty($$buff)) $temp_out.=$$buff;
213 else $temp_out.=$v['name_formal
'];
214 $temp_out.=$boldx.' 
;</td
><td
> 
;
215 <img
'.createComIcon($root_path,'mans
-gr
.gif
','0','',TRUE).'> 
;';
217 //if ($aelems[l]!="") echo $aelems[l].', ';
218 //echo $aelems[f].'</b
></a
></td
>';
219 if(in_array($v['nr
'],$quicklist)&&$DOC_1['name_last
']){$temp_out.='<a href
="javascript:popinfo(\''.$ha['ha'.(date('d')-1)].'\',\''.$v['nr'].'\')" title
="Click f�r mehr Info."><b
>'.$DOC_1['name_last
'].', '.$DOC_1['name_first
'].'</b
></a
>'; }
222 if ($a['a
'.(date('d
')-1)]!='')
224 $temp_out.=' <font color
=red
> '.$DOC_1['funk1
'].'</font
>';
225 if($DOC_1['inphone1
']) $temp_out.=' / '.$DOC_1['inphone1
'];
227 $temp_out.=' 
;</td
><td
>
228 <img
'.createComIcon($root_path,'mans
-red
.gif
','0','',TRUE).'> 
;';
230 if(in_array($v['nr
'],$quicklist)&&$DOC_2['name_last
']){$temp_out.='<a href
="javascript:popinfo(\''.$hr['hr'.(date('d')-1)].'\',\''.$v['nr'].'\')" title
="Click f�r mehr Info."><b
>'.$DOC_2['name_last
'].', '.$DOC_2['name_first
'].'</b
></a
>';}
233 if ($r['r
'.(date('d
')-1)]!='')
235 $temp_out.=' <font color
=red
> '.$DOC_2['funk1
'].'</font
>';
236 if($DOC_2['inphone1
']) $temp_out.=' / '.$DOC_2['inphone1
'];
240 </td
><td
> 
; <a href
="doctors-dienstplan.phpURLAPPEND&dept_nr='.$v['nr'].'&retpath=qview">
241 <button onClick
="javascript:window.location.href=\'doctors-dienstplan.phpURLREDIRECTAPPEND&dept_nr='.$v['nr'].'&retpath=qview\'"><img
'.createComIcon($root_path,'new_address
.gif
','0','absmiddle
',FALSE).' alt
="IMGALT" ><font size
=1> SHOWBUTTON
</font
></button
></a
> </td
></tr
>';
245 if(!$force_no_cache || ($force_no_cache && !$is_cached)) $dept_obj->saveDBCache('DOCS_
'.date('Y
-m
-d
'),addslashes($temp_out));
247 $temp_out=str_replace('URLAPPEND
',URL_APPEND,$temp_out);
248 $temp_out=str_replace('IMGALT
',$LDShowActualPlan,$temp_out);
249 $temp_out=str_replace('SHOWBUTTON
',$LDShow,$temp_out);
250 echo str_replace('URLREDIRECTAPPEND
',URL_REDIRECT_APPEND,$temp_out);
255 <a href="<?php echo $breakfile ?>"><img <?php echo createLDImgSrc($root_path,'close2
.gif
','0') ?> alt="<?php echo $LDCloseAlt ?>">
260 $sTemp = ob_get_contents();
263 # Assign the buffer output to main frame template
265 $smarty->assign('sMainFrameBlockData
',$sTemp);
270 $smarty->display('common
/mainframe
.tpl
');