view show.php @ 136:aeebfedb5709

Add some copyright headers.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 22 Oct 2013 22:04:22 +0300
parents 0436079bcf46
children 75cf14ee99a7
line wrap: on
line source

<?
//
// FAPWeb Simple Demoparty System
// Party information display system
// (C) Copyright 2012-2013 Tecnic Software productions (TNSP)
//
require "mconfig.inc.php";
require "msite.inc.php";
require "mcommon.inc.php";
require "majax.php";

stSetupCacheControl();

// Initiate SQL database connection
if (!stConnectSQLDB())
  die("Could not connect to SQL database.");

// Fetch non-"hardcoded" settings from SQL database
stReloadSettings();

cmPrintPageHeader("PARTY DISPLAY", "", FALSE);
stCommonAJAX("showajax.php", "show.php", TRUE);
?>

<!-- ========================== -->

<noscript>
  <div class="notice">
    <h1>Javascript required</h1>
    <p>
    The compo system page requires Javascript to be enabled for the AJAX functionality.
    <br />
    <a href="#">Please enable Javascript and reload this page</a>.
    </p>
  </div>
</noscript>

<div class="showView" id="mainView0">
  <div class="showHeader">
    <img src="img/fapsm.png" />
  </div>
  <div class="showText">
    <h1>Next up</h1>
    <h2>4k intro competition</h2>
  </div>
</div>

<div class="showView" id="mainView1">
</div>

<!-- ========================== -->

<script type="text/javascript">

var failCount = 0;
var prevView = -1, activeView = 0;
var errorView = false;


function tickAnim()
{
  if (activeView != prevView)
  {
    document.getElementById("mainView0").style.display = (activeView == 0) ? "block" : "none";
    document.getElementById("mainView1").style.display = (activeView == 1) ? "block" : "none";
    prevView = activeView;
  }
}


function displayError()
{
  // Increase failure count
  if (++failCount > 5 && !errorView)
  {
    errorView = true;
    updateView("... error ...");
  }
}


//
// Update view when triggered by main tick
//
function viewChanged()
{
  var msuccess = function(txt)
  {
    // Successfully fetched new data, initiate view update
    failCount = 0;
    errorView = false;
    updateView(txt);
  }

  sendPOSTRequest("mode=get", msuccess, displayError);
}


//
// Main tick function, check for updates from server
//
function tickMain()
{
  var msuccess = function(txt)
  {
    failCount = 0;
    if (txt == "changed")
      viewChanged();
  }

  sendPOSTRequest("mode=check", msuccess, displayError);
}


setTimeout("tickMain();", 500);
setTimeout("tickAnim();", 20);

</script>
<?
cmPrintPageFooter(FALSE);
?>