4 |
andreas |
1 |
<?php
|
|
|
2 |
$menuHeight = 0;
|
|
|
3 |
|
|
|
4 |
if (!isset($login)) {
|
|
|
5 |
if (!isset($unum)) {
|
|
|
6 |
$unum = $_COOKIE['TPMunum'];
|
|
|
7 |
}
|
|
|
8 |
|
|
|
9 |
if (!isset($rstufe)) {
|
|
|
10 |
$rstufe = $_COOKIE['TPMrstufe'];
|
|
|
11 |
}
|
|
|
12 |
|
|
|
13 |
if (!isset($unum) || !isset($rstufe)) {
|
|
|
14 |
$s = "<p>Dieses System arbeitet mit ";
|
|
|
15 |
$s .= "<a href=\"http://www.www-kurs.de/cookies.htm\" target=\"_blank\">Cookies</a>. ";
|
|
|
16 |
$s .= "Leider hat ihr Browser mein <i>Cookie</i> nicht akzeptiert. ";
|
|
|
17 |
$s .= "Bitte aktivieren Sie die Annahme von Cookies in Ihrem Browser, ";
|
|
|
18 |
$s .= "da sonst ein Arbeiten hier nicht möglich ist.<br><br>\n";
|
|
|
19 |
$s .= "Alle hier gesetzten Cookies werden von Ihrem Browser <b>automatisch</b> ";
|
|
|
20 |
$s .= "nach dem Abmelden oder spätestens nach 24 Stunden gelöscht! ";
|
|
|
21 |
$s .= "Was immer früher eintritt.</p>\n";
|
|
|
22 |
Output(-1, 141, $s);
|
|
|
23 |
include('footer.inc');
|
|
|
24 |
exit;
|
|
|
25 |
}
|
|
|
26 |
|
|
|
27 |
$unum = decrypt($unum);
|
|
|
28 |
$rstufe = decrypt($rstufe);
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
if (!isset($menu)) {
|
|
|
32 |
$menu = $_REQUEST['menu'];
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
if (!isset($headline)) {
|
|
|
36 |
$headline = $_REQUEST['headline'];
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
function CheckDRM($r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7=false) {
|
|
|
40 |
global $unum;
|
|
|
41 |
global $rstufe;
|
|
|
42 |
$check = false;
|
|
|
43 |
|
|
|
44 |
if ($r0 && $rstufe == 0) // Verwalter
|
|
|
45 |
$check = true;
|
|
|
46 |
|
|
|
47 |
if ($r1 && $rstufe == 1) // Administrator
|
|
|
48 |
$check = true;
|
|
|
49 |
|
|
|
50 |
if ($r2 && $rstufe == 2) // Projektmanager
|
|
|
51 |
$check = true;
|
|
|
52 |
|
|
|
53 |
if ($r3 && $rstufe == 3) // Mitarbeiter
|
|
|
54 |
$check = true;
|
|
|
55 |
|
|
|
56 |
if ($r4 && $rstufe == 4) // Kontroller
|
|
|
57 |
$check = true;
|
|
|
58 |
|
|
|
59 |
if ($r5 && $rstufe == 5) // Kein Zugang!!
|
|
|
60 |
$check = true;
|
|
|
61 |
|
|
|
62 |
if ($r6 && $rstufe == 6) // Ressourcenmanager
|
|
|
63 |
$check = true;
|
|
|
64 |
|
|
|
65 |
if ($r7 && $rstufe == 7) // Revisor
|
|
|
66 |
$check = true;
|
|
|
67 |
|
|
|
68 |
if (!$check)
|
|
|
69 |
return true;
|
|
|
70 |
|
|
|
71 |
$db = OpenDB();
|
|
|
72 |
$query = "select mi_hacker from mitarbeiter where mi_num = $unum";
|
|
|
73 |
$result = QueryDB($db, $query);
|
|
|
74 |
|
|
|
75 |
if (!$result) {
|
|
|
76 |
WarnHacker(0);
|
|
|
77 |
closeDB($db);
|
|
|
78 |
return false;
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
$numrows = numrowsDB($result);
|
|
|
82 |
|
|
|
83 |
if ($numrows > 0) {
|
|
|
84 |
$data = fetchDB($result, 0);
|
|
|
85 |
$mi_hacker = $data[0] + 1;
|
|
|
86 |
$query = "update mitarbeiter set mi_hacker = $mi_hacker where mi_num = $unum";
|
|
|
87 |
TqueryDB($db, $query);
|
|
|
88 |
}
|
|
|
89 |
else
|
|
|
90 |
$mi_hacker = 0;
|
|
|
91 |
|
|
|
92 |
closeDB($db);
|
|
|
93 |
WarnHacker($mi_hacker);
|
|
|
94 |
return false;
|
|
|
95 |
}
|
|
|
96 |
|
|
|
97 |
function MenuButton($text, $func, $nav, $akt=false) {
|
|
|
98 |
echo "<td><img src=\"nav/button_left.png\" alt=\"\" height=\"24px\"></td>\n";
|
|
|
99 |
echo "<td class=\"tabs\"><a href=\"#\" ";
|
|
|
100 |
|
|
|
101 |
if ($akt == true)
|
|
|
102 |
echo "class=\"aktiv\" ";
|
|
|
103 |
|
|
|
104 |
echo "onClick=\"javascript:MoveTo('$func','$nav')\">$text</a></td>\n";
|
|
|
105 |
echo "<td><img src=\"nav/button_right.png\" alt=\"\" height=\"24px\"></td>\n";
|
|
|
106 |
}
|
|
|
107 |
|
|
|
108 |
function MenuMain($nav, $rstufe = 0) {
|
|
|
109 |
global $headline;
|
|
|
110 |
global $pmlight;
|
|
|
111 |
|
|
|
112 |
if ($rstufe == 1 || $rstufe == 2 || $rstufe == 3 || $rstufe == 4) {
|
|
|
113 |
if ($pmlight)
|
|
|
114 |
MenuButton(GetMessage(-1, 189, "IST-Erfassung"), "istpm.php", "$nav", ($headline == 10) ? true : false);
|
|
|
115 |
else
|
|
|
116 |
MenuButton(GetMessage(-1, 189, "IST-Erfassung"), "ist.php", "$nav", ($headline == 10) ? true : false);
|
|
|
117 |
}
|
|
|
118 |
|
|
|
119 |
if ($rstufe == 1 || $rstufe == 2) {
|
|
|
120 |
MenuButton(GetMessage(-1, 190, "Planung"), "plan.php", "plan=plan&$nav");
|
|
|
121 |
}
|
|
|
122 |
|
|
|
123 |
MenuButton(GetMessage(-1, 191, "Auswertungen"), "forms.php", "auswert=auswert&$nav");
|
|
|
124 |
MenuButton(GetMessage(-1, 192, "Verwaltung"), "forms.php", "verwalt=verwalt&$nav");
|
|
|
125 |
MenuButton(GetMessage(-1, 193, "Abmelden"), "index.php", "header=3");
|
|
|
126 |
}
|
|
|
127 |
|
|
|
128 |
function MenuPlan($nav) {
|
|
|
129 |
global $menu;
|
|
|
130 |
global $headline;
|
|
|
131 |
|
|
|
132 |
if ($menu == 2)
|
|
|
133 |
$target = "plan.php";
|
|
|
134 |
else
|
|
|
135 |
$target = "forms.php";
|
|
|
136 |
|
|
|
137 |
MenuButton(GetMessage(-1, 194, "Leeren Plan erstellen"), $target, "plneu=plneu&$nav", ($headline == 19) ? true : false);
|
|
|
138 |
MenuButton(GetMessage(-1, 195, "Plan Ändern"), "plan.php", "plchange=plchange&$nav", ($headline == 20) ? true : false);
|
|
|
139 |
}
|
|
|
140 |
|
|
|
141 |
function MenuReport($nav) {
|
|
|
142 |
global $rstufe;
|
|
|
143 |
global $headline;
|
|
|
144 |
|
|
|
145 |
$ini_array = parse_ini_file("setup/menu.dat", true);
|
|
|
146 |
|
|
|
147 |
for ($i = 1; $i <= 10; $i++) {
|
|
|
148 |
$slot = "slot_" . $i;
|
|
|
149 |
|
|
|
150 |
if (isset($ini_array[$slot]['prog'])) {
|
|
|
151 |
$flag = false;
|
|
|
152 |
$prog = $ini_array[$slot]['prog'];
|
|
|
153 |
$func = $ini_array[$slot]['func'];
|
|
|
154 |
$button = $ini_array[$slot]['button'];
|
|
|
155 |
$alt = $ini_array[$slot]['alt'];
|
|
|
156 |
$head = $ini_array[$slot]['slot'];
|
|
|
157 |
$access = $ini_array[$slot]['access'];
|
|
|
158 |
$acc = explode(",", $access);
|
|
|
159 |
|
|
|
160 |
for ($j = 0; $j < 7; $j++) {
|
|
|
161 |
if ($acc[$j] == $rstufe) {
|
|
|
162 |
$flag = true;
|
|
|
163 |
break;
|
|
|
164 |
}
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
if ($flag)
|
|
|
168 |
MenuButton($alt, $prog, "$func=$func&headline=$head&$nav", ($headline == $head) ? true : false);
|
|
|
169 |
}
|
|
|
170 |
}
|
|
|
171 |
}
|
|
|
172 |
|
|
|
173 |
function MenuManage($nav) {
|
|
|
174 |
global $rstufe;
|
|
|
175 |
global $phase;
|
|
|
176 |
global $headline;
|
|
|
177 |
global $pmlight;
|
|
|
178 |
global $verrmodul;
|
|
|
179 |
global $menuHeight;
|
|
|
180 |
global $pj_lock;
|
|
|
181 |
|
|
|
182 |
$manz = 1;
|
|
|
183 |
$height = 0;
|
|
|
184 |
|
|
|
185 |
if ($pj_lock && ($rstufe == 1 || $rstufe == 4)) {
|
|
|
186 |
MenuButton(GetMessage(-1, 139, "Projektteilabschluß"), "pjclose.php", "pjclose=pjclose&$nav", ($headline == 41) ? true : false); $manz++;
|
|
|
187 |
}
|
|
|
188 |
|
|
|
189 |
if ($rstufe > 1) {
|
|
|
190 |
MenuButton(GetMessage(-1, 196, "Passwort ändern"), "forms.php", "pw=pw&$nav", ($headline == 32) ? true : false); $manz++;
|
|
|
191 |
|
|
|
192 |
if ($rstufe == 4 && $verrmodul) {
|
|
|
193 |
MenuButton(GetMessage(-1, 197, "Kunden"), "kunden.php", "kunde=kunde&$nav", ($headline == 34) ? true : false); $mamz++;
|
|
|
194 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
195 |
MenuButton(GetMessage(-1, 198, "Mitarbeiter"), "edit_mi.php", "mi=mi&$nav", ($headline == 5) ? true : false); $manz++;
|
|
|
196 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
197 |
MenuButton(GetMessage(-1, 199, "Tagsatz"), "forms.php", "temptagsatz=temptagsatz&$nav", ($headline == 40) ? true : false); $manz++;
|
|
|
198 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
199 |
MenuButton(GetMessage(-1, 209, "Kostenstellen"), "forms.php", "costloc=costloc&$nav", ($headline == 38) ? true : false); $manz++;
|
|
|
200 |
}
|
|
|
201 |
|
|
|
202 |
if ($rstufe != 6)
|
|
|
203 |
return;
|
|
|
204 |
}
|
|
|
205 |
|
|
|
206 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
207 |
MenuButton(GetMessage(-1, 198, "Mitarbeiter"), "edit_mi.php", "mi=mi&$nav", ($headline == 5) ? true : false); $manz++;
|
|
|
208 |
|
|
|
209 |
if ($rstufe != 6) {
|
|
|
210 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
211 |
MenuButton(GetMessage(-1, 200, "Projekte"), "forms.php", "pj=pj&$nav", ($headline == 11) ? true : false); $manz++;
|
|
|
212 |
}
|
|
|
213 |
|
|
|
214 |
if (!$pmlight) {
|
|
|
215 |
MenuButton(GetMessage(-1, 201, "TM-Gruppe"), "forms.php", "tm=tm&$nav", ($headline == 14) ? true : false);
|
|
|
216 |
$manz++;
|
|
|
217 |
}
|
|
|
218 |
|
|
|
219 |
MenuButton(GetMessage(-1, 202, "Auftraggeber"), "forms.php", "sgf=sgf&$nav", ($headline == 15) ? true : false); $manz++;
|
|
|
220 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
221 |
MenuButton(GetMessage(-1, 203, "Abteilung"), "forms.php", "abt=abt&$nav", ($headline == 16) ? true : false); $manz++;
|
|
|
222 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
223 |
MenuButton(GetMessage(-1, 204, "Länder"), "forms.php", "land=land&$nav", ($headline == 17) ? true : false); $manz++;
|
|
|
224 |
|
|
|
225 |
if (!$pmlight) {
|
|
|
226 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
227 |
MenuButton(GetMessage(-1, 205, "Rollen"), "forms.php", "role=role&$nav", ($headline == 18) ? true : false);
|
|
|
228 |
$manz++;
|
|
|
229 |
}
|
|
|
230 |
|
|
|
231 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
232 |
|
|
|
233 |
if ($phase && $rstufe != 6) {
|
|
|
234 |
MenuButton(GetMessage(-1, 206, "Phasen"), "forms.php", "phase=phase&$nav", ($headline == 24) ? true : false);
|
|
|
235 |
$manz++;
|
|
|
236 |
}
|
|
|
237 |
|
|
|
238 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
239 |
|
|
|
240 |
if ($verrmodul && $rstufe != 6) {
|
|
|
241 |
MenuButton(GetMessage(-1, 199, "Tagsatz"), "forms.php", "temptagsatz=temptagsatz&$nav", ($headline == 40) ? true : false); $manz++;
|
|
|
242 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
243 |
MenuButton(GetMessage(-1, 207, "Anrede"), "forms.php", "anrede=anrede&$nav", ($headline == 36) ? true : false); $manz++;
|
|
|
244 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
245 |
MenuButton(GetMessage(-1, 208, "Kategorie"), "forms.php", "category=category&$nav", ($headline == 37) ? true : false); $manz++;
|
|
|
246 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
247 |
MenuButton(GetMessage(-1, 209, "Kostenstellen"), "forms.php", "costloc=costloc&$nav", ($headline == 38) ? true : false); $manz++;
|
|
|
248 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
249 |
MenuButton(GetMessage(-1, 197, "Kunden"), "kunden.php", "kunde=kunde&$nav", ($headline == 34) ? true : false); $manz++;
|
|
|
250 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
251 |
MenuButton(GetMessage(-1, 210, "Kundengruppen"), "kunden.php", "kgroup=kgroup&$nav", ($headline == 39) ? true : false); $manz++;
|
|
|
252 |
}
|
|
|
253 |
|
|
|
254 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
255 |
|
|
|
256 |
if ($rstufe == 1) {
|
|
|
257 |
MenuButton(GetMessage(-1, 211, "E-Journal"), "ejournal.php", "journal=journal&$nav", ($headline == 33) ? true : false);
|
|
|
258 |
$manz++;
|
|
|
259 |
}
|
|
|
260 |
|
|
|
261 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
262 |
|
|
|
263 |
if ($rstufe == 1) {
|
|
|
264 |
MenuButton(GetMessage(-1, 212, "Einstellungen"), "forms.php", "settings=settings&$nav", ($headline == 23) ? true : false); $manz++;
|
|
|
265 |
if ($manz >= 8) { $manz = 0; $menuHeight++; echo "</tr><tr>\n"; }
|
|
|
266 |
MenuButton(GetMessage(-1, 213, "Templates"), "forms.php", "templates=templates&$nav", ($headline == 28) ? true : false); $manz++;
|
|
|
267 |
}
|
|
|
268 |
|
|
|
269 |
$span = 8 - $manz;
|
|
|
270 |
echo "<td colspan=$span> </td>\n";
|
|
|
271 |
}
|
|
|
272 |
|
|
|
273 |
# Bevor noch ein Menue angezeigt werden kann, prufen wir ob der User
|
|
|
274 |
# ueberhaupt berechtigt ist.
|
|
|
275 |
#
|
|
|
276 |
if (isset($drm)) {
|
|
|
277 |
if (!CheckDRM($drm[0], $drm[1], $drm[2], $drm[3], $drm[4], $drm[5], $drm[6], $drm[7]))
|
|
|
278 |
exit;
|
|
|
279 |
}
|
|
|
280 |
|
|
|
281 |
# An dieser Stelle werten wir aus, welches Menue und in welchem Umfang es
|
|
|
282 |
# angezeigt wird.
|
|
|
283 |
#
|
|
|
284 |
if ((!isset($header) || $header == 3) && isset($headline)) {
|
|
|
285 |
if (isset($login))
|
|
|
286 |
echo "<td></td></tr></table>\n";
|
|
|
287 |
|
|
|
288 |
if (isset($rstufe) && $rstufe > 0 && $header != 3) { // && isset($menu) && $menu > 1) {
|
|
|
289 |
MenuButton(GetMessage(-1, 214, "Hauptmenü"), "forms.php", "headline=3&menu=1", ($headline == 3) ? true : false);
|
|
|
290 |
}
|
|
|
291 |
}
|
|
|
292 |
|
|
|
293 |
if ((!isset($header) || $header == 3) && isset($menu) && $menu != 0) {
|
|
|
294 |
$nav = "menu=$menu";
|
|
|
295 |
|
|
|
296 |
if (isset($headline)) {
|
|
|
297 |
$nav .= "&headline=$headline";
|
|
|
298 |
}
|
|
|
299 |
|
|
|
300 |
if (isset($dbname)) {
|
|
|
301 |
$nav .= "&dbname=$dbname";
|
|
|
302 |
}
|
|
|
303 |
|
|
|
304 |
switch ($menu) {
|
|
|
305 |
case 1: MenuMain($nav, $rstufe); break;
|
|
|
306 |
case 2: MenuPlan($nav); break;
|
|
|
307 |
case 3: MenuReport($nav); break;
|
|
|
308 |
case 4: MenuManage($nav); break;
|
|
|
309 |
}
|
|
|
310 |
|
|
|
311 |
echo " </tr>\n";
|
|
|
312 |
echo "</table>\n";
|
|
|
313 |
}
|
|
|
314 |
|
|
|
315 |
echo "</td></tr><tr><td colspan=2 height=\"2px\" style=\"background-color: $menucolor;\"></td></tr>\n";
|
|
|
316 |
echo "<tr><td colspan=2 height=\"3px\" style=\"background-color: white;\"></td>\n";
|
|
|
317 |
echo "</tr></table></div>\n<div id=\"norm\"";
|
|
|
318 |
$browser = get_browser();
|
|
|
319 |
|
|
|
320 |
if ($browser["browser"] != "IE" && $menuHeight > 0) { // Ignore brain dead IE
|
|
|
321 |
$h = $menuHeight * 24;
|
|
|
322 |
echo " style=\"top:". $h . "px;\">\n";
|
|
|
323 |
} else
|
|
|
324 |
echo ">\n";
|
|
|
325 |
?>
|