Files
sternwarte_server/html/sternwarte/bildergalerie/kat_uebersicht.php
2025-11-02 22:52:08 +01:00

93 lines
2.5 KiB
PHP
Executable File

<!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=utf-8" />
<title>Sternwarte Welzheim</title>
<!--[if IE 5]>
<link href="css/ie5.css" rel="stylesheet" type="text/css" />
<![endif]--><!--[if IE]>
<style type="text/css">
<link href="css/ie.css" rel="stylesheet" type="text/css" />
</style>
<![endif]-->
<link href="../css/sternwarte1.css" rel="stylesheet" type="text/css" />
</head>
<body class="thrColFixHdr">
<div id="container">
<div id="header"><img src="../bilder/header1.jpg" width="960" height="150" alt="Sternwarte Welzheim"/><!-- end #header --></div>
<?php include '../navi.php'; ?>
<div id="sidebar2">
<?php include '../fdatum.php'; ?>
<?php include '../himmelerg.php'; ?>
</div>
<div id="mainContent">
<h1>Bildergalerien </h1>
<?php include '../config_stern.php';
$sql_selkat="SELECT kid, kategorie, bild FROM kategorien order by kategorie ASC" ;
$sql_get_data = mysqli_query($db,"SELECT kid, kategorie, bild FROM kategorien order by kategorie ASC");
while ( $row = mysqli_fetch_array( $sql_get_data ) )
{
$array[ 0 ][] = $row[ 'bild' ]; // 0 = bild, eine spalte zugewiesen
$array[ 1 ][] = $row[ 'kid' ]; // 1 = id, eine spalte zugewiesen
$array[ 2 ][] = $row[ 'kategorie' ]; // 2 = kat, eine spalte zugewiesen
$array[ 3 ][] = $row[ 'frei' ];
}
/*
array im format
[Zeile1] => [Spalte1][Spalte2][Spalte3][...]
[Zeile2] => [Spalte1][Spalte2][Spalte3][...]
[Zeile3] => [Spalte1][Spalte2][Spalte3][...]
*/
$labels_ger = array( 'bild', 'kid', 'kat' );
$max = max( count( $row[ 0 ] ), count( $row[ 1 ] ), count( $row[ 2 ] ) );
echo "<table>";
for ( $i = 0; $i < 3; $i++ ) // 3 zeilen sind vorgegeben
{
echo '<tr> <td>' . $labels_ger[ $i ] . '</td>';
for ( $n = 0; $n < count( $array[ $i ] ); $n++ )
{
echo '<td>' . $array[ $i ][ $n ] . '</td>'; //daten als zeilen
}
for ( $n; $n < $max; $n++ ) //leere felder für valides html
{
echo '<td></td>';
}
echo '</tr>';
}
echo '</table>';
$count=count( $array[ $i ]);
echo"count".$count;
echo"<br />-----------<br />" ;
?>
<!-- end #mainContent --></div>
<!-- Dieses clear-Element sollte direkt auf das #mainContent-div folgen, um das #container-div anzuweisen, alle untergeordneten Floats aufzunehmen. --><br class="clearfloat" />
<!-- end #container --></div>
</body>
</html>