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’];

echo “

Filter:

“;
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]

“;

}

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

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

echo ““;
$newstartdate = date(‘d-M-Y’, strtotime($row[1]));
$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];

}
$trbgcolor = “cae4ff”;

echo “

“;

echo “

“;

echo “

“;

echo “

“;

echo “

“;
echo “

“;

echo “

“;

echo “$newenddate”;

echo “

$row[3]

“;

echo “

“;

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

“;
echo “

“;
echo “

“;
}

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

“;
echo “

“;
echo “

“;
}

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

“;
echo “

“;
echo “

“;
}

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

“;
echo “

“;
echo “

“;
}

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

“;
echo “

“;
echo “

“;
}

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

“;
echo “

“;
echo “

“;
}

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

“;
echo “

“;
echo “

“;
}

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

“;
echo “

“;
echo “

“;
}

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

“;
echo “

“;
echo “

“;
}

echo “

Date: $row[1]
Venue: $row[4]
Time: $row[5]
Contact Name: $row[7]
Email Address: $row[8]
More Info: $row[10]
Phone Number: $row[9]
Notes: $row[11]

“;

}

mysql_close();

[/insert_php]

[/vc_row]