Subversion Repositories public

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 andreas 1
<?php
2
function Output($db, $pos, $text, $v1="", $v2="", $v3="", $v4="", $v5="", $v6="", $v7="", $v8="", $v9="", $v10="") {
3
	global $unum;
4
	global $language;
5
	$flag = false;
6
 
7
	if (!isset($db) || $db == -1) {
8
	   $db = OpenDB();
9
	   $flag = true;
10
	}
11
 
12
	if (!isset($unum) || $unum <= 0) {
13
	   $lang = $language;
14
	} else {
15
	   $query = "select mi_lang from mitarbeiter where mi_num = $unum";
16
 
17
	   if (!($result = QueryDB($db, $query)))
18
	      $lang = "ger";
19
	   else {
20
	      if (numrowsDB($result) > 0) {
21
	         $data = fetchDB($result, 0);
22
	         $lang = $data[0];
23
	      } else
24
	         $lang = $language;
25
	   }
26
	}
27
 
28
	$query = "select la_text from language where ";
29
	$query .= "la_tnum = $pos and la_lang = '$lang'";
30
 
31
	if (!($result = QueryDB($db, $query))) {
32
	   printf ($text, $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10);
33
 
34
	   if ($flag)
35
	      closeDB($db);
36
 
37
	   return;
38
	}
39
 
40
	if (numrowsDB($result) > 0) {
41
	   $data = fetchDB($result, 0);
42
	   printf ($data[0], $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10);
43
	} else
44
	   printf ($text, $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10);
45
 
46
	if ($flag)
47
	   closeDB($db);
48
}
49
 
50
function GetMessage($db, $pos, $text, $v1="", $v2="", $v3="", $v4="", $v5="", $v6="", $v7="", $v8="", $v9="", $v10="") {
51
	global $unum;
52
	global $language;
53
	$flag = false;
54
 
55
	if (!isset($db) || $db == -1) {
56
	   $db = OpenDB();
57
	   $flag = true;
58
	}
59
 
60
	if (!isset($unum) || $unum <= 0) {
61
	   $lang = $language;
62
	} else {
63
	   $query = "select mi_lang from mitarbeiter where mi_num = $unum";
64
 
65
	   if (!($result = QueryDB($db, $query)))
66
	      $lang = "ger";
67
	   else {
68
	      if (numrowsDB($result) > 0) {
69
	         $data = fetchDB($result, 0);
70
	         $lang = $data[0];
71
	      } else
72
	         $lang = $language;
73
	   }
74
	}
75
 
76
	$query = "select la_text from language where ";
77
	$query .= "la_tnum = $pos and la_lang = '$lang'";
78
 
79
	if (!($result = QueryDB($db, $query))) {
80
	   printf ($text, $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10);
81
 
82
	   if ($flag)
83
	      closeDB($db);
84
 
85
	   return sprintf ($text, $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10);
86
	}
87
 
88
	if (numrowsDB($result) > 0) {
89
	   $data = fetchDB($result, 0);
90
	   $out = sprintf ($data[0], $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10);
91
	} else
92
	   $out = sprintf ($text, $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10);
93
 
94
	if ($flag)
95
	   closeDB($db);
96
 
97
	return $out;
98
}
99
 
100
function GetMessageLang($db, $lang, $pos, $text, $v1="", $v2="", $v3="", $v4="", $v5="", $v6="", $v7="", $v8="", $v9="", $v10="") {
101
	global $unum;
102
	$flag = false;
103
 
104
	if (!isset($db) || $db == -1) {
105
	   $db = OpenDB();
106
	   $flag = true;
107
	}
108
 
109
	$query = "select la_text from language where ";
110
	$query .= "la_tnum = $pos and la_lang = '$lang'";
111
 
112
	if (!($result = QueryDB($db, $query))) {
113
	   printf ($text, $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10);
114
 
115
	   if ($flag)
116
	      closeDB($db);
117
 
118
	   return sprintf ($text, $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10);
119
	}
120
 
121
	if (numrowsDB($result) > 0) {
122
	   $data = fetchDB($result, 0);
123
	   $out = sprintf ($data[0], $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10);
124
	} else
125
	   $out = sprintf ($text, $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10);
126
 
127
	if ($flag)
128
	   closeDB($db);
129
 
130
	return $out;
131
}
132
?>