1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Besprechungsbericht</title>
<link rel="stylesheet" href="file:///R|/styles/oe322.css">
<style type="text/css">
<!--
.Stil2 {font-size: x-small}
.Stil4 {font-size: x-small; font-weight: bold; }
-->
</style>
</head>
<body>
<?php
error_reporting(E_ALL);
$timestamp = time();
$datum = date("d.m.Y",$timestamp);
define('MYSQL_HOST', 'localhost');
define('MYSQL_USER', 'root');
define('MYSQL_PASS', '');
define('MYSQL_DATABASE', 'teammeeting');
$link = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS);
if (!$link) {
die('Verbindung nicht möglich : ' . mysql_error());
}
$db_selected = mysql_select_db(MYSQL_DATABASE, $link);
if (!$db_selected) {
die ('Kann Datenbank \"MYSQL_DATABASE\" nicht benutzen : ' . mysql_error());
}
if ("2" == $_POST['Author']) {
$author = "H. Billion";
} else if ("3" == $_POST['Author']) {
$author = "T. Koch";
} else if ("4" == $_POST['Author']) {
$author = "J. Ketabchy";
} else if ("5" == $_POST['Author']) {
$author = "I. Praum";
} else if ("6" == $_POST['Author']) {
$author = "M. Schroeder";
} else if ("7" == $_POST['Author']) {
$author = "F. Luettgens";
} else { $author = "Kein Schriftführer angegeben!"; }
echo <<<EOT
<table width="1000" border="1">
<tr>
<td colspan="6"><h2 align="center">Besprechungsbericht</h2></td>
</tr>
<tr>
<td width="100"><strong>Betreff:</strong></td>
<td colspan="5">Team-Meeting AIX </td>
</tr>
<tr>
<td><strong>Datum:</strong></td>
<td width="206">$datum</td>
<td width="75"><strong>Uhrzeit:</strong></td>
<td width="305">$_POST[startzeit] bis $_POST[endzeit]</td>
<td width="94"><strong>Wöchentlich:</strong></td>
<td width="180">Donnerstags</td>
</tr>
<tr>
<td><strong>Abteilung/Ort:</strong></td>
<td colspan="5">OE322/1 - Höherweg 200 - V15 </td>
</tr>
<tr>
<td><strong>Teilnehmer:</strong></td>
<td colspan="5">
EOT;
function id2name($user) {
$get = ("SELECT nachname FROM teilnehmer WHERE id = '$user'");
$answer = mysql_result(mysql_query($get),0);
return $answer;
}
if (isset ($_POST['teilnehmer'])) {
foreach ($_POST['teilnehmer'] as $k) {
$dood = id2name($k);
print "$dood, ";
}
}
echo <<<EOT
</td>
</tr>
<tr>
<td><strong>Verteiler:</strong></td>
<td colspan="5">Teilnehmer, I. Opitz, C. Ramm, W. Beckers </td>
</tr>
</table>
<br>
<table width="1000" border="1">
<tr>
<td width="756"><div align="center"><strong>Thema</strong></div></td>
<td width="45"><div align="center"><strong>Aktion</strong></div></td>
<td width="82"><div align="center"><strong>Bearbeitung</strong></div></td>
<td width="89"><div align="center"><strong>Termin</strong></div></td>
</tr>
<tr>
<td>Früh/Spätdienst kommende Woche</td>
<td><div align="center">A</div></td>
<td><div align="center">Alle</div></td>
<td><div align="center">Heute</div></td>
</tr>
<tr>
EOT;
foreach ($_POST['thema'] as $key => $thema) {
$writedb = sprintf("INSERT INTO meetings (thema, aktion, bearbeitung, termin, startzeit, endzeit, author, erstellung) VALUES ('%s', '%s', '%s', '%s', '$_POST[startzeit]',
'$_POST[endzeit]', '$_POST[Author]', curdate())",
$thema,
$_POST['aktion'][$key],
$_POST['bearbeitung'][$key],
$_POST['termin'][$key]
);
mysql_query($writedb)or die (mysql_error() . "<br />" . $writedb);
$res = mysql_query("SELECT max(id) AS id FROM meetings");
$row = mysql_fetch_assoc($res);
$meetingId = $row['id'];
if ($meetingId === null) {
echo "Something went wrong ...";
} else {
// Alles okay, weiter verarbeiten ...
}
if (isset ($_POST['teilnehmer'])) {
foreach ($_POST['teilnehmer'] as $teilnehmerId => $teilnehmer) {
$addteilnehmer = ("INSERT INTO meeting_teilnehmer (meeting_id, teilnehmer_id) VALUES ($meetingId, $teilnehmerId)");
mysql_query($addteilnehmer) or die (mysql_error() . "<br />" . $addteilnehmer);
}
}
printf("<tr><td>%s</td><td align=\"center\">%s</td><td align=\"center\">%s</td><td align=\"center\">%s</td></tr>\n",
$thema,
$_POST['aktion'][$key],
$_POST['bearbeitung'][$key],
$_POST['termin'][$key]);
}
echo <<<EOT
</table><br><br>\n
<table width="151" border="1">
<tr>
<td width="37"><span class="Stil4">Author:</span></td>
<td width="147"><span class="Stil2">$author</span></td>
</tr>
</table>
EOT;
?>