Call Us Now 3177 4550

What Time Is My Class?

Please select your activity, class group and rank

‘;

print ‘

‘;
print ‘

‘;

//Second Select
print ‘

‘;

//Third Select
print ‘

‘;

if (isset($_POST[‘rank’])) {
$_SESSION[‘rank’] = $_POST[‘rank’];
$query = $pdo->query(“SELECT ClassID FROM `classes` WHERE `activity` = ‘$_SESSION[activity]’ AND `class group` = ‘$_SESSION[group]’ AND `current rank` = ‘$_SESSION[rank]'”);
$ClassID = $query->fetchColumn();
print ‘

‘;
print ““;
print ‘‘;
print ‘

‘;
}
print ‘

‘;
}

/* print results */
if (isset($_POST[‘ClassID’])) {
$query = $pdo->prepare(“SELECT ClassID, `Activity`, `Class Group`, `Class Type`, `Current Rank` FROM `classes` WHERE ClassID = :ClassID”);
$query->bindValue(‘ClassID’,$_POST[‘ClassID’],PDO::PARAM_INT);
$query->execute();
$results = $query->fetch();
$ClassID = $results[0];
$Activity = $results[1];
$ClassGroup = $results[2];
$ClassType = $results[3];
$ClassRank = $results[4];

$query = $pdo->query(“SELECT Class2,Class3,Class4,Class5,Class6,Class7,Class8 FROM timetable WHERE ClassID = $ClassID”);
$results = $query->fetch(PDO::FETCH_ASSOC);

//Counter for how many classes
$counter = 0;
foreach ($results as $time) {
if ($time != null || $time != ”) {$counter++;}
}
$dynamicWidth = ((round((100/$counter),0,PHP_ROUND_HALF_DOWN)) – 7);

//Print name of class
print “

$Activity -> $ClassGroup -> $ClassRank

“;
print “

“;
foreach ($results as $time) {
if ($time != null || $time != ”) {print “

$time

“;}
}
print “


“;

//Get FAQ using ClassID
$query = $pdo->query(“SELECT FAQ FROM classes WHERE ClassID = $ClassID”);
$FAQ = $query->fetchColumn();
print “

FAQ

$FAQ

“;

//Get related links
$query = $pdo->query(“SELECT `Class Type` FROM classes WHERE `Class Type` NOT IN (‘$ClassType’) AND Activity = ‘$Activity’ AND `Class Group` = ‘$ClassGroup’ AND `Current Rank` = ‘All'”);
$Related = $query->fetchAll(PDO::FETCH_NUM);
print “

Related Classes

“;
foreach ($Related as $RelatedClass) {
print “$RelatedClass[0]“;
}
print “

“;
print ‘

‘;
print ‘‘;
}

?>