| 1 |
lars |
1 |
<?php
|
|
|
2 |
/*******************************************************
|
|
|
3 |
* Projekt: Wochenkarte für cafe-schwarte.de *
|
|
|
4 |
* Datei: index.php *
|
|
|
5 |
* Datum: 26.05.2008 *
|
|
|
6 |
* Autor: Patrick Lautsch *
|
|
|
7 |
* *
|
|
|
8 |
* Beschreibung: *
|
|
|
9 |
* Dieses Projekt ist das Modul 'Wochenkarte' *
|
|
|
10 |
* im Redaktionssystem der Webagentur Niewerth. *
|
|
|
11 |
* Ziel dieses Moduls ist es, dem User zu *
|
|
|
12 |
* ermöglichen Wochen anzulegen, zu bearbeiten *
|
|
|
13 |
* und zu löschen. Die Wochen kann der User *
|
|
|
14 |
* dann mit Mittagsgerichten zu füllen. *
|
|
|
15 |
*******************************************************/
|
|
|
16 |
|
|
|
17 |
if ($_SERVER['HTTP_HOST'] == "server2")
|
|
|
18 |
include "includes/connect.php";
|
|
|
19 |
else
|
|
|
20 |
include "../Online-Shop/connect2.php";
|
|
|
21 |
|
|
|
22 |
// Datenbanken 'mittagsgericht' und 'woche' erstellen, wenn diese nicht existieren
|
|
|
23 |
$sql = "CREATE TABLE IF NOT EXISTS `mittagsgericht` (
|
|
|
24 |
`id` int(11) NOT NULL auto_increment,
|
|
|
25 |
`beschreibung` text NOT NULL,
|
|
|
26 |
`drei_gang_menu` varchar(255) NOT NULL default '0',
|
|
|
27 |
`seniorenmenu` varchar(255) NOT NULL default '0',
|
|
|
28 |
`grosse_portion` varchar(255) NOT NULL default '0',
|
|
|
29 |
`seniorengedeck` varchar(255) NOT NULL default '0',
|
|
|
30 |
`preis` varchar(255) NOT NULL default '0',
|
|
|
31 |
`wochentag` tinyint(4) NOT NULL,
|
|
|
32 |
`woche` int(11) NOT NULL,
|
|
|
33 |
PRIMARY KEY (`id`)
|
|
|
34 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=28 ;";
|
|
|
35 |
mysql_query($sql,$remoteServer_dbh) OR die(mysql_error()."<hr />".$sql);
|
|
|
36 |
|
|
|
37 |
$sql = "CREATE TABLE IF NOT EXISTS `woche` (
|
|
|
38 |
`id` int(11) NOT NULL auto_increment,
|
|
|
39 |
`gueltig_von` int(11) NOT NULL,
|
|
|
40 |
`gueltig_bis` int(11) NOT NULL,
|
|
|
41 |
`letzte_aenderung_von` varchar(255) NOT NULL,
|
|
|
42 |
`letzte_aenderung_am` int(11) NOT NULL,
|
|
|
43 |
`erstellt_von` varchar(255) NOT NULL,
|
|
|
44 |
`erstellt_am` int(11) NOT NULL,
|
|
|
45 |
PRIMARY KEY (`id`)
|
|
|
46 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;";
|
|
|
47 |
|
|
|
48 |
mysql_query($sql,$remoteServer_dbh) OR die(mysql_error()."<hr />".$sql);
|
|
|
49 |
// ENDE --> Datenbanken 'mittagsgericht' und 'woche' erstellen, wenn diese nicht existieren
|
|
|
50 |
|
|
|
51 |
// Hole Wochendaten aus der Datenbank
|
|
|
52 |
$sql = "SELECT * FROM woche";
|
|
|
53 |
$result = mysql_query($sql,$remoteServer_dbh) OR die(mysql_error());
|
|
|
54 |
$id = 0;
|
|
|
55 |
while ($row = mysql_fetch_assoc($result)) {
|
|
|
56 |
$id++;
|
|
|
57 |
$woche[$row['id']]['gueltig_von'] = date("d.m.Y", $row['gueltig_von']);
|
|
|
58 |
$woche[$row['id']]['gueltig_bis'] = date("d.m.Y", $row['gueltig_bis']);
|
|
|
59 |
}
|
|
|
60 |
?>
|
|
|
61 |
|
|
|
62 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
|
|
63 |
"http://www.w3.org/TR/HTML4.01/loose.dtd">
|
|
|
64 |
|
|
|
65 |
<html>
|
|
|
66 |
<head>
|
|
|
67 |
<title>Wochenkarte für cafe-schwarte.de</title>
|
|
|
68 |
<script language="JavaScript" type="text/javascript">
|
|
|
69 |
function list2textarea(tag) {
|
|
|
70 |
switch(tag)
|
|
|
71 |
{
|
|
|
72 |
case 1:
|
|
|
73 |
document.formular.textarea_mo.value = document.formular.select_mo.value;
|
|
|
74 |
break;
|
|
|
75 |
case 2:
|
|
|
76 |
document.formular.textarea_di.value = document.formular.select_di.value;
|
|
|
77 |
break;
|
|
|
78 |
case 3:
|
|
|
79 |
document.formular.textarea_mi.value = document.formular.select_mi.value;
|
|
|
80 |
break;
|
|
|
81 |
case 4:
|
|
|
82 |
document.formular.textarea_do.value = document.formular.select_do.value;
|
|
|
83 |
break;
|
|
|
84 |
case 5:
|
|
|
85 |
document.formular.textarea_fr.value = document.formular.select_fr.value;
|
|
|
86 |
break;
|
|
|
87 |
case 6:
|
|
|
88 |
document.formular.textarea_s1.value = document.formular.select_s1.value;
|
|
|
89 |
break;
|
|
|
90 |
case 7:
|
|
|
91 |
document.formular.textarea_s2.value = document.formular.select_s2.value;
|
|
|
92 |
break;
|
|
|
93 |
case 8:
|
|
|
94 |
document.formular.textarea_s3.value = document.formular.select_s3.value;
|
|
|
95 |
break;
|
|
|
96 |
case 9:
|
|
|
97 |
document.formular.textarea_s4.value = document.formular.select_s4.value;
|
|
|
98 |
break;
|
|
|
99 |
}
|
|
|
100 |
}
|
|
|
101 |
</script>
|
|
|
102 |
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
|
|
|
103 |
</head>
|
|
|
104 |
|
|
|
105 |
<body>
|
|
|
106 |
|
|
|
107 |
<div style="position: absolute; left 5%; top: 5%">
|
|
|
108 |
<div style="position: relative; width: 662px">
|
|
|
109 |
<?php
|
|
|
110 |
switch($_GET['action']) {
|
|
|
111 |
case 'new':
|
|
|
112 |
include "new.php";
|
|
|
113 |
break;
|
|
|
114 |
|
|
|
115 |
case 'delete':
|
|
|
116 |
include "delete.php";
|
|
|
117 |
break;
|
|
|
118 |
|
|
|
119 |
case 'wochen_uebersicht':
|
|
|
120 |
include "wochen_uebersicht.php";
|
|
|
121 |
break;
|
|
|
122 |
|
|
|
123 |
default:
|
|
|
124 |
include "uebersicht.php";
|
|
|
125 |
|
|
|
126 |
}
|
|
|
127 |
?>
|
|
|
128 |
</div>
|
|
|
129 |
<div style="position: absolute; top: 0; left: 670px">
|
|
|
130 |
<?php include "includes/navigation.inc.php" ?>
|
|
|
131 |
</div>
|
|
|
132 |
</div>
|
|
|
133 |
|
|
|
134 |
</body>
|
|
|
135 |
|
|
|
136 |
</html>
|