summaryrefslogtreecommitdiff
path: root/www-ssl/inc/funktion_xml_room.php
blob: a8f626d1950e353029706a176a24b5f97fb0bb46 (plain)
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
<?PHP


/*##############################################################################################
				           R o o m
  ##############################################################################################*/
echo "\n\n<br>\n<h1>Rooms:</h1>\n";

function saveRoomData()
{
	global $con;
	if( isset($_GET["NameXML"]))
	{
		$SQL= "INSERT INTO `Room` ( `Name`, `FromPentabarf` ) ".
			"VALUES ('". mysql_escape_string($_GET["NameXML"]). "', 'Y');";
		$Erg = mysql_query($SQL, $con);
		if( $Erg )
			echo "Aenderung, an Raum ". $_GET["NameXML"]. ", war erfogreich<br>";
		else
			echo "Aenderung, an Raum ". $_GET["NameXML"]. ", war <u>nicht</u> erfogreich.(".
				mysql_error($con). ")<br>[$SQL]<br>";
	}
	else 
		echo "Fehler in den Parametern!<br>";
} /*function saveRoomData*/

if( isset($_GET["RoomUpdate"]))
	saveRoomData();

//INIT Status counter
$DS_KO = 0;

//Ausgabe
echo "<table border=\"0\">\n";
echo "<tr><th>Name</th><th>state</th></tr>\n";
if( $EnableSchudle)
foreach($XMLmain->sub as $EventKey => $Event)
{
        if( $Event->name == "VEVENT")
	{
		$NameXML = getXMLsubData( $Event, "LOCATION");
		if( !isset( $RoomName[$NameXML]))
		{
			$RoomName[$NameXML] = "";

			if( isset($_GET["UpdateALL"]))
			{
				$_GET["NameXML"] = $NameXML;
				saveRoomData();
				CreateRoomArrays();
			}
			else
			{
				echo "<form action=\"dbUpdateFromXLS.php\">\n";
				echo "\t<tr>\n";
				echo "\t<td><input name=\"NameXML\" type=\"text\" value=\"$NameXML\" readonly></td>\n";
				echo "\t<td><input type=\"submit\" name=\"RoomUpdate\" value=\"update\"></td>\n";
				$DS_KO++;
				echo "\t</tr>\n";
				echo "</form>\n";
				echo "<br>";
			}
		}
	}
}
echo "<tr><td colspan=\"6\">status: $DS_KO nicht vorhanden.</td></tr>\n";
echo "</table>\n";

?>