titelgrafikEsh4

Test

<?php

include 'db.php';

mysql_connect($host, $username, $password);
mysql_select_db($database);

echo "<table width='500' border='0'>";

$query="select
ID,
Name,
YEAR(Datum1) AS Jahr1,
MONTH(Datum1) AS Monat1,
DAYOFMONTH(Datum1) AS Tag1,
YEAR(Datum2) AS Jahr2,
MONTH(Datum2) AS Monat2,
DAYOFMONTH(Datum2) AS Tag2,
Ort,
Referent,
Info,
Extra,
Kategorie,
Veranstalter
from prog_esh WHERE DATE_ADD(CURDATE(),INTERVAL 40 DAY) >= Datum1 && CURDATE() <= Datum1 && Veranstalter = 'esh' ORDER BY Datum1";

$erg=mysql_query($query);

$anz_ver=mysql_numrows($erg);

$i=1;

while($row2 = mysql_fetch_array($erg))
{


echo "<tr>";

 

$id=$row2["ID"];
$name=$row2["Name"];
$jahr1=substr($row2["Jahr1"], -2);
$monat1=$row2["Monat1"];
$tag1=$row2["Tag1"];
$jahr2=substr($row2["Jahr2"],-2);
$monat2=$row2["Monat2"];
$tag2=$row2["Tag2"];
$ort=$row2["Ort"];
$referent=$row2["Referent"];
$info=$row2["Info"];
$extra1=$row2["Extra"];
$extra2=$row2["Kategorie"];

switch ($extra2) {
case 0:
$background="#B0DDAC";
break;
case 1:
$background="#FAAFAA";
break;
case 2:
$background="#C8C8C8";
break;
case 3:
$background="#B0C1EA";
break;

}

echo "<td valign=top width=100><span style='background: $background;'>";
// include datum der veranstaltung
include 'va_date.php';
echo "</span></td>";

 

echo "<td valign=top>";
// include informationen zur Veranstaltung + Link zur Anmeldung
include 'va_info.php';
echo "<br></td></tr>";

 

$i++;
}
echo "</table>";
?>