<?php
///////////////////////////////////////////////////////////////////////////////////////
// PHPizabi 0.848b C1 [ALICIA]                               http://www.phpizabi.net //
///////////////////////////////////////////////////////////////////////////////////////
// Please read the license.txt file before using / modifying this software           //
// Original author:         Claude Desjardins, R - feedback@realitymedias.com        //
// Last modification date:  August 26th 2006                                         //
// Version:                 PHPizabi 0.848b C1                                       //
//                                                                                   //
// (C) 2005, 2006 Real!ty Medias / PHPizabi - All rights reserved                    //
///////////////////////////////////////////////////////////////////////////////////////

	/* Check Structure Availability */
	if (!defined("CORE_STRAP")) die("Out of structure call");
	
	// TEMPLATE HANDLING ////////////////////////////////////////////////////////////////// FINAL //
	/*
		Initialize the template engine and
		load the template file. 
	*/
	$tpl = new template;
	$tpl -> Load("staff");
	$tpl -> GetObjects();
	
	
	

	
	// GET EVENTS //////////////////////////////////////////////////////////////////
	/*
		Select all events for this day
	*/
	$staffSelect = myQ("
		SELECT *
		FROM `[x]users` 
		WHERE (`is_administrator` = 1
		)
		ORDER BY `username` ASC
	");

		
	/*
		Loop in the results, create the looping array
	*/
	$i=0;
	while ($staffRow = myF($staffSelect)) {

		$staffReplacementArray[$i]["staff.username"] = $staffRow["username"];
		$staffReplacementArray[$i]["staff.id"] = $staffRow["id"];
		$staffReplacementArray[$i]["staff.gender"] = $staffRow["gender"];
		$staffReplacementArray[$i]["staff.age"] = $staffRow["age"];
		$staffReplacementArray[$i]["staff.mainpicture"] = $staffRow["mainpicture"];

		$i++;
	}

	/*
		Assign the array to the loop engine
	*/
	if (isset($staffReplacementArray)) {
		$tpl->Loop("staffList", $staffReplacementArray);
		$tpl->Zone("staffBlock", "enabled");
	}
	
	/*
		No event on that day
	*/
	else $tpl->Zone("staffBlock", "noEvent");
	
	
	

	$tpl->Flush();
?>