probleme mit leeren tabellen beseitigt

git-svn-id: svn://svn.cccv.de/engel-system@157 29ba0400-6e00-0410-a75a-ca02368028f8
This commit is contained in:
cookie 2006-11-10 19:37:59 +00:00
parent f57b0c9137
commit e87e62d953
4 changed files with 22 additions and 14 deletions

View File

@ -50,8 +50,11 @@ $SQL = "SELECT `DateS` FROM `Shifts` ORDER BY `DateS` LIMIT 1";
$Erg = mysql_query($SQL, $con); $Erg = mysql_query($SQL, $con);
$Pos=0; $Pos=0;
do
if( mysql_num_rows($Erg)>0)
{ {
do
{
//Startdatum einlesen und link ausgeben //Startdatum einlesen und link ausgeben
$DateS = substr(mysql_result($Erg, 0 , 0), 0,10); $DateS = substr(mysql_result($Erg, 0 , 0), 0,10);
$VeranstaltungsTage[$Pos++] = $DateS; $VeranstaltungsTage[$Pos++] = $DateS;
@ -77,7 +80,8 @@ do
"ORDER BY `DateS` ". "ORDER BY `DateS` ".
"LIMIT 1"; "LIMIT 1";
$Erg = mysql_query($SQL, $con); $Erg = mysql_query($SQL, $con);
} while( mysql_fetch_row($Erg) > 0); } while( mysql_fetch_row($Erg) > 0);
}
$VeranstaltungsTageMax = $Pos-1; $VeranstaltungsTageMax = $Pos-1;
?> ?>

View File

@ -13,9 +13,9 @@ function Printlink( $Datum)
echo "'>$Datum</a></li>\n"; echo "'>$Datum</a></li>\n";
} //function Printlink( } //function Printlink(
foreach( $VeranstaltungsTage as $k => $v) if( isset ($VeranstaltungsTage))
{ foreach( $VeranstaltungsTage as $k => $v)
Printlink( $v); Printlink( $v);
}
?> ?>

View File

@ -4,15 +4,16 @@
include ("./inc/funktion_schichtplan_aray.php"); include ("./inc/funktion_schichtplan_aray.php");
foreach( $Room as $RoomEntry ) if( isset ($Room))
{ foreach( $Room as $RoomEntry )
{
if(isset($ausdatum)) if(isset($ausdatum))
echo "\t<li><a href='./schichtplan.php?ausdatum=$ausdatum&raum=". $RoomEntry["RID"]. "'>". echo "\t<li><a href='./schichtplan.php?ausdatum=$ausdatum&raum=". $RoomEntry["RID"]. "'>".
$RoomEntry["Name"]. "</a></li>\n"; $RoomEntry["Name"]. "</a></li>\n";
else else
echo "\t<li><a href='./schichtplan.php?raum=". $RoomEntry["RID"]. "'>". echo "\t<li><a href='./schichtplan.php?raum=". $RoomEntry["RID"]. "'>".
$RoomEntry["Name"]. "</a></li>\n"; $RoomEntry["Name"]. "</a></li>\n";
} }
echo "<br>"; echo "<br>";
if(isset($ausdatum)) if(isset($ausdatum))
echo "<li><a href='./schichtplan.php?ausdatum=$ausdatum&raum=-1'>alle</a></li>"; echo "<li><a href='./schichtplan.php?ausdatum=$ausdatum&raum=-1'>alle</a></li>";

View File

@ -51,7 +51,10 @@ if( !isset($ausdatum) )
$sql = "SELECT `DateS` FROM `Shifts` ORDER BY `DateS` ASC LIMIT 0, 1"; $sql = "SELECT `DateS` FROM `Shifts` ORDER BY `DateS` ASC LIMIT 0, 1";
$Erg = mysql_query($sql, $con); $Erg = mysql_query($sql, $con);
} }
$ausdatum = substr(mysql_result($Erg,0,"DateS"),0,10); if( mysql_num_rows( $Erg ) > 0 )
$ausdatum = substr(mysql_result($Erg,0,"DateS"),0,10);
else
$ausdatum = gmdate("Y-m-d", time()+3600);
} }
@ -61,10 +64,10 @@ if ( !isset($raum) )
{ {
// Ausgabe wenn kein Raum Ausgewählt: // Ausgabe wenn kein Raum Ausgewählt:
echo Get_Text("pub_schicht_auswahl_raeume"). "<br><br>\n"; echo Get_Text("pub_schicht_auswahl_raeume"). "<br><br>\n";
if( isset($Room))
foreach( $Room as $RoomEntry ) foreach( $Room as $RoomEntry )
echo "\t<li><a href='./schichtplan.php?ausdatum=$ausdatum&raum=". $RoomEntry["RID"]. "'>". echo "\t<li><a href='./schichtplan.php?ausdatum=$ausdatum&raum=". $RoomEntry["RID"]. "'>".
$RoomEntry["Name"]. "</a></li>\n"; $RoomEntry["Name"]. "</a></li>\n";
echo "<br><br>"; echo "<br><br>";
echo Get_Text("pub_schicht_alles_1"). "<a href='./schichtplan.php?ausdatum=$ausdatum&raum=-1'> <u>". echo Get_Text("pub_schicht_alles_1"). "<a href='./schichtplan.php?ausdatum=$ausdatum&raum=-1'> <u>".