- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / include / inc_resolve_dept_dept.php
blob8699bd8d5781f93d6f1f4dbebb9fbf37d7c7573a
1 <?php
2 /*------begin------ This protection code was suggested by Luki R. luki@karet.org ---- */
3 if (eregi("inc_resolve_dept_dept.php",$PHP_SELF))
4 die('<meta http-equiv="refresh" content="0; url=../">');
5 /*------end------*/
7 if(!isset($dept)) $dept='';
8 if(!isset($ck_thispc_dept)) $ck_thispc_dept='';
9 if(!isset($ck_thispc_station)) $ck_thispc_station='';
10 if(!isset($ck_thispc_room)) $ck_thispc_room='';
11 if(!isset($checkdept)) $checkdept='';
13 if(!(trim($dept)))
16 if($ck_thispc_dept)
18 $dept=$ck_thispc_dept;
19 $checkdept=1;
21 elseif($ck_thispc_station)
23 $dept=$ck_thispc_station;
24 $checkdept=1;
26 elseif($ck_thispc_room)
28 $dept=$ck_thispc_station;
29 $checkdept=1;
31 else $dept='plast';
34 if($checkdept)
36 if(trim($dept)=='') $dept='plast';
37 $Dept2Dept=get_meta_tags($root_path.'global_conf/$lang/resolve_dept_dept.pid');
39 $dx=strtolower($dept);
40 //print $Dept2Dept[deptfilter];
41 $df=explode(',',$Dept2Dept[deptfilter]);
42 while(list($x,$v)=each($df))
44 $dx=str_replace($v,'',$dx);
47 $dx=strtr($dx,'/-_*:;><+ ','~~~~~~~~~~');
48 $dx=str_replace('~','',$dx);
49 //print "init $dept <br>";
50 //print $dx." dx <p>";
51 while(list($x,$v)=each($Dept2Dept))
53 //print "$x $v <br>";
54 if(stristr($v,$dx))
56 $dept=$x;
57 $deptOK=1;
58 break;
61 //print $dept;
62 if(!$deptOK) $dept='plast';