<?php
	require_once "pageBase.php";
	require_once "../dal/count_lastDAL.php";
	require_once "../bin/web/repeater.php";

	class _countLast100 extends pageBase {
		public function load() {
			$this->limitID = "42";
			if (!parent::chkUserLimit()) {
				$this->alertMsg = "您沒有使用此頁面的權限!如有疑問請洽主管理者!";
				$this->locationHref = "index.php";
			} else {
				$this->loadData();
			}
			parent::loadTemplateFile(dirname(__FILE__) . "/templates/countLast100.html");
			parent::load();
		}
		
		public function loadData() {
			$dalL = new count_lastDAL();
			$dataL = $dalL->executeRecordset([], "", "a.`CountID` DESC", 0, 100);
			foreach ($dataL as &$entry) {
				$entry["dis"] = ($entry["RefererHost"] == "") ? "d_none" : "";
			}
			$listL = new repeater();
			$listL->id = "listL";
			$listL->dataSource = $dataL;
			parent::addControl($listL);

			parent::loadData();
		}
	}

	$page = new _countLast100();
	$page->load();
	$page->render();
?>