setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //echo "Connected successfully"; } catch(PDOException $e) { echo "Database connection failed: " . $e->getMessage(); } //modus normaal: komende en voorbije activiteiten worden weergegeven, archief niet //modus archief: komende en voorbija activiteiten worden niet weergegeven, archief wel $modus = 'normaal'; $query = 'SELECT * FROM clubact WHERE einde >= date(now()) ORDER BY start'; $result = $conn->query($query); $row = $result->fetch(); $num = $result->rowCount(); $i = 0; $tekstrechts = ''; if (isset($_GET["p"])) { $pagina = $_GET["p"]; $modusquery = 'select year(einde) as eindejaar from clubact where id='.$pagina; $modusresult = $conn->query($modusquery)->fetch(); $modusjaar = $modusresult["eindejaar"]; if ($modusjaar < date("Y")) { $modus = 'archief'; } } else if ($num == 0) { $pagina = 0; } else { $pagina = $row["id"]; } //Titel if ($pagina) { $query2 = 'SELECT * FROM clubact WHERE id = '.$pagina; $row2 = $conn->query($query2)->fetch(); $titel = $row2["naam"]; } echo "".$titel." | Oude Trekker Club Roeselare"; ?>
'; //Menu links echo ''; } echo '>'.$naam.''; $i++; } echo''; } } $query = 'SELECT * FROM clubact WHERE year( einde ) < year( now( ) ) ORDER BY start'; $result = $conn->query($query); $rij = $result->fetch(); $num = $result->rowCount(); $archiefid = $rij["id"]; echo '

Archief

'; if ($modus == 'archief') { echo '
'; } echo '>'.$naam.''; $i++; } echo ''; } echo ''; //Hoofdtekst echo '
'; echo $tekstrechts; echo '
'; ?>