Schedule

[insert_php]
$username=”p2ecalendar”;
$password=”p2ecalendar”;
$database=”p2ecalendar”;

mysql_connect(localhost,$username,$password) or die(“Failure to communicate with database”);
@mysql_select_db($database) or die( “Unable to select database”);

$filterid = $_GET[‘filterid’];
$id = $_GET[‘id’];

IF ($id == ”) {
IF ($filterid == ”){
echo ”

Filter: All

“;
} ELSE {
$resultfilterid = mysql_query(“select * from category WHERE id = $filterid”);
while ($rowfilterid = mysql_fetch_row($resultfilterid)) {
echo ”

Filter: $rowfilterid[1]

“;
}
}
} ELSE {
echo “

Filter: $id

“;
}

echo “

All

“;

$resultfilter = mysql_query(“SELECT DISTINCT category.ID, category.categorytitle, category.categorycolor FROM events, category WHERE events.active = ‘1’ AND events.categoryid = category.ID AND events.showsite1 = ‘1’ ORDER By category.ID ASC;”);
while ($row = mysql_fetch_row($resultfilter)) {

Echo ”

$row[1]

“;

}
echo “
“;

IF ($filterid == ” && $id == ”){
$result = mysql_query(“select * from events WHERE active =’1′ AND showsite1 =’1′ ORDER BY enddate Asc”);
} ELSE {
$result = mysql_query(“select * from events WHERE active =’1′ AND showsite1 =’1′ AND categoryid = $filterid ORDER BY enddate Asc”);
}

IF ($id != ”){
$result = mysql_query(“select * from events WHERE active =’1′ AND id = $id LIMIT 1″);
}

while ($row = mysql_fetch_row($result)) {

echo ”
“;
$newenddate = date(‘d-M-Y’, strtotime($row[2]));

$resulte = mysql_query(“SELECT categorycolor FROM category WHERE ID = ‘$row[15]'”);
while ($bgc = mysql_fetch_row($resulte)) {
$trbgcolor = $bgc[0];

}

echo “

“;

echo “

“;

echo “

“;

echo “

“;

IF ($row[11] != ”){
echo “

“;
echo “

“;
echo “

“;
}

IF ($row[6] != ”){
echo “

“;
echo “

“;
echo “

“;
}

echo “

“;

If ($row[16] == ‘1’ && $row[17] ==’1′) {
echo “

“;
} ELSEIf ($row[16] == ‘1’) {
echo “

“;
} ELSEIf ($row[17] == ‘1’) {
echo “

“;
} ELSE {
echo “

“;
}

echo “

“;
echo “

“;

echo “

“;

echo “$row[3]
“;

echo “$row[1]”;

IF ($row[5] != ”){
echo ” at $row[5]
“;
} ELSE {
echo ““;
}

echo “

$row[11]

Live in Person and Live Online Live in Person Live Online More Info


“;

}

mysql_close();

[/insert_php]

[/vc_row]