| 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: | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Unbenanntes Dokument</title>
<style type="text/css">
<!--
body {
	background-image: url(../images/muster.gif);
}
-->
</style></head>
<link href="admin/style.css" rel="stylesheet" type="text/css">
<script language="javascript">
function reserveSeat(id) {
  chk_box = document.getElementById(id);
  if (chk_box && chk_box.checked==true) document.form1.submit();
}
</script>
<body>
</html>
<?php  require_once('../inc/connection.php');
mysql_select_db($database_login, $login);
$query_rangid = "SELECT * from rang where rangbez='".$rang."'";
$rangid = mysql_query($query_rangid, $login) or die(mysql_error());
$row_rangid = mysql_fetch_assoc($rangid);
$totalRows_rangid = mysql_num_rows($rangid);
mysql_select_db($database_login, $login);
$query_reihe1 = "SELECT * from platz where rangid='".$row_rangid['rangid']."'";
$reihe1 = mysql_query($query_reihe1, $login) or die(mysql_error());
$row_reihe1 = mysql_fetch_assoc($reihe1);
$totalRows_reihe1 = mysql_num_rows($reihe1);
mysql_select_db($database_login, $login);
$query_kategorie = "SELECT kategorie, farbe from kategorie where kategorieid='".$row_reihe1['kategorieid']."'";
$kategorie = mysql_query($query_kategorie, $login) or die(mysql_error());
$row_kategorie = mysql_fetch_assoc($kategorie);
$totalRows_kategorie = mysql_num_rows($kategorie);
mysql_select_db($database_login, $login);
$query_status = "SELECT * from reservierung where vorhaid=1";
$status = mysql_query($query_status, $login) or die(mysql_error());
$row_status = mysql_fetch_assoc($status);
$totalRows_status = mysql_num_rows($status);
if ($row_status['checked']==1) {
$checked="checked=\"checked\"";
}
//$disablet="disabled=\"disabled\"";
// Formaktion 
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
 $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
// Eingtragen neuer Stücke in die Datenbank 
if ((isset($_POST["insert"])) && ($_POST["insert"] == "form1")) {
$insertSQL = "INSERT INTO reservierung (platzid, uid, vorhaid) values ('".$platzid."', '".$_GET['uid']."', '".$_GET['vorhaid']."')";
$Result2 = mysql_query($insertSQL, $login) or die(mysql_error());
 // Nach dem Insert wird in folgende Datei gesprungen
 $insertGoTo = "";
 if (isset($_SERVER['QUERY_STRING'])) {
   $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
   $insertGoTo .= $_SERVER['QUERY_STRING'];
 }
}
mysql_select_db($database_login, $login); $selReihenSQL = "SELECT reihe, COUNT(platz) AS anzplaetze FROM platz where rangid='".$row_rangid['rangid']."' GROUP BY reihe"; 
$dsReihen = mysql_query($selReihenSQL, $login) or die(mysql_error());
$arReihen = array();
while ($row = mysql_fetch_assoc($dsReihen)) {
	$arReihen[$row['reihe']] = $row['anzplaetze']; }
$iMaxReihen = count($arReihen); // Anzahl Reihen $iMaxPlaetze = max($arReihen); // max. Anzahl Plaetze pro Reihe
$query_reihe = "SELECT platzid, platz, reihe FROM platz where rangid='".$row_rangid['rangid']."' ORDER BY reihe, platz" ; 
$reihe = mysql_query($query_reihe, $login) or die(mysql_error()); $row_reihe = mysql_fetch_assoc($reihe);
$a = 0;
$sReihe = "";
$out = "<form action=\"{$editFormAction}\" method=\"post\" id=\"form1\" name=\"form1\">\n<table  cellpadding=\"0\" cellspacing=\"0\">\n";
do {
	if ($iReihe != $row_reihe['reihe']) {
		$out .= "<tr  bgcolor=\"{$row_kategorie['farbe']}\">\n";
		$out .= "<td>Reihe {$row_reihe['reihe']}</td>\n";
	}
	$out .= "<td><input id=\"{$row_reihe['platzid']}\" type=\"checkbox\" name=\"platzid\" value=\"{$row_reihe['platzid']}\" onClick=\"javascript:reserveSeat('{$row_reihe['platzid']}')\"  ></td>\n";
	$iReihe = $row_reihe['reihe'];
	$a++;
	if (!($arReihen[$iReihe] - $a)) {
		$iColSpan = $iMaxPlaetze - $a;
		if ($iColSpan > 1) {
			$out .= "<td colspan=\"{$iColSpan}\"> </td>\n";
		} elseif ($iColSpan == 1) {
			$out .= "<td> </td>\n";
		} else {
			$out = $out;
		}
	}
} while ($row_reihe = mysql_fetch_assoc($reihe));$out .= "</tr>\n"; $out .= "</table>\n <input type=\"hidden\" name=\"uid\" value=\"{$uid}\">\n<input type=\"hidden\" name=\"insert\" value=\"form1\"> \n
\n</form>"; 
echo $out; 
?> |