<p>
          Hieronder een aantal gegevens over de inschrijvingen.
        </p>
      </div>

      <div class="medium-12 columns field" style="padding: 0;">
        <h5 style="text-align: center;">Gegevens</h5>
        <table style="width: 100%; margin:0;">
          <tr>
            <th width="80%">Inschrijvingen</th>
            <th>Aantal</th>
          </tr>

          <?php 
require_once 'resources/includes/MySQL_Manager.php';
$mysql = new MySQL_Manager();
try {
    $mysql->connect();
    $results = $mysql->getSubsByDay();
    $mysql->closeConnection();
    $vrijdag = 0;
    $zaterdag = 0;
    $beide = 0;
    $les = 0;
    $i = 0;
    while ($row = mysql_fetch_row($results)) {
        /*echo "<tr>";
          echo "<td>$row[0] $row[1]</td>";
          echo "<td style=\"text-align: center\">$row[2]</td>";
          echo "</tr>";*/
        if ($row[0] && $row[1]) {
示例#2
0
<?php

if (is_string($_POST["password"])) {
    $config = (include 'config.php');
    if ($_POST["password"] == $config["results-password"]) {
        $mode = 0;
        // Correct password
        require_once 'sql/MySQL_Manager.php';
        $mySQL = new MySQL_Manager();
        $results = $mySQL->getExamPoll_SQL()->get_results();
        $mySQL->closeConnection();
        $vote_options = (include 'options.php');
    } else {
        $mode = 1;
        // Wrong password
    }
} else {
    $mode = 2;
    // No password yet
}
?>

<!DOCTYPE html>
<html>
  <head>
    <title>Poll resultaten</title>
    <link type="text/css" rel="stylesheet" href="foundation/css/foundation.css">
    <link type="text/css" rel="stylesheet" href="foundation/css/exampoll.css">
    <script src="chartjs/Chart.js"></script>
    <meta charset='utf-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
if ($mode === 0) {
    ?>
          <table>
            <tr>
              <th>Voornaam</th>
              <th>Achternaam</th>
              <th>Email</th>
              <th>Examenjaar</th>
              <th>Beroep</th>
              <th>Vrijdag</th>
              <th>Zaterdag</th>
              <th>Les</th>
            </tr>
            <?php 
    require_once 'resources/includes/MySQL_Manager.php';
    $mysql = new MySQL_Manager();
    try {
        $mysql->connect();
        $results = $mysql->getResults();
        $mysql->closeConnection();
        while ($row = mysql_fetch_row($results)) {
            $vrijdag = $row[6] == 1 ? 'Ja' : 'Nee';
            $zaterdag = $row[7] == 1 ? 'Ja' : 'Nee';
            $les = $row[8] == 1 ? 'Ja' : 'Nee';
            echo "<tr>";
            echo "<td>{$row['1']}</td>";
            echo "<td>{$row['2']}</td>";
            echo "<td>{$row['3']}</td>";
            echo "<td>{$row['4']}</td>";
            echo "<td>{$row['5']}</td>";
            echo "<td>{$vrijdag}</td>";
              <div class="padding-top-1"></div>
 
              <input type="button" class="button green" value="Versturen"
                       style="margin-bottom: 0;" onclick="validate();"/>
              <p class="error" id="err_submit"></p>
            </div>
          </form>
        </div>
 
<?php 
} else {
    ?>
 
        <?php 
    require_once 'resources/includes/MySQL_Manager.php';
    $mysql = new MySQL_Manager();
    $vrijdag = $_POST['vrijdag'] == 'on' ? 1 : 0;
    $zaterdag = $_POST['zaterdag'] == 'on' ? 1 : 0;
    $les = $_POST['les'] == 'on' ? 1 : 0;
    $examenjaar = intval($_POST["examenjaar"]) != 0 && intval($_POST["examenjaar"]) != 1 && intval($_POST["examenjaar"]) > 1900 ? $_POST["examenjaar"] : null;
    try {
        $mysql->connect();
        $mysql->insertNewSubscription($_POST["voornaam"], $_POST["achternaam"], $_POST['email'], $examenjaar, $_POST['beroep'], $vrijdag, $zaterdag, $les);
        $mysql->closeConnection();
    } catch (\Exception $e) {
        echo $e->getMessage();
    }
    /* 
              // Sending bevestigingsmail
              $to = $_POST["email"];
              $subject = "Bevestiging inschrijving Nehalenniareünie";