view pages/visitors.inc.php @ 1075:7e497188e4c6

Use long tags.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 24 Jan 2017 17:59:55 +0200
parents ffacd904fd1f
children bbc0a3d0b51e
line wrap: on
line source

<?php
//
// FAPWeb - Simple Web-based Demoparty Management System
// Attendee list page
// (C) Copyright 2012-2015 Tecnic Software productions (TNSP)
//
if (stCheckRegistrationAvailable())
  echo stGetSetting("visitorsPageRegLink");

echo
  "\n".
  "<div class=\"visitorInfo\">Total of <b>".$numAttendees.
  "</b> people registered to attend";

if ($maxAttendeesHard > 0)
 echo " (<b>".$maxAttendeesHard."</b> max)";

echo
  ".</div>\n".
  " <table class=\"attendees\">\n".
  "  <tr>\n".
  "   <th class=\"name\">Name</th>\n".
  "   <th class=\"groups\">Group(s)</th>\n".
  "   <th class=\"regtime\">Registered</th>\n".
  "   <th class=\"oneliner\">Oneliner</th>\n".
  "  </tr>\n";

if (($res = stExecSQL("SELECT * FROM attendees ORDER BY regtime DESC")) !== FALSE)
{
  $index = $numAttendees;
  $row = 0;
  foreach ($res as $item)
  {
    // Check hard limit first
    if ($maxAttendeesHard > 0)
      $over = $index > $maxAttendeesHard;
    else
    // Then check soft limit
    if ($maxAttendeesSoft > 0)
      $over = $index > $maxAttendeesSoft;

    stPrintAttendee($item, $row++, TRUE, FALSE, FALSE, $over ? " overbooked" : "");
    $index--;
  }
}

echo " </table>\n";
?>