<?php
/*
 * @version $Id: HEADER 15930 2011-10-30 15:47:55Z tsmr $
 -------------------------------------------------------------------------
 Eventlog plugin for GLPI
 Copyright (C) 2003-2011 by the Eventlog Development Team.

 https://forge.indepnet.net/projects/eventlog
 -------------------------------------------------------------------------

 LICENSE
		
 This file is part of Eventlog.

 Eventlog is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 Eventlog is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with Eventlog. If not, see <http://www.gnu.org/licenses/>.
 --------------------------------------------------------------------------
 */

define('GLPI_ROOT', '../../..');
include (GLPI_ROOT."/inc/includes.php");

Html::header($LANG['plugin_eventlog']['title'][0],'',"plugins","eventlog");

$eventlog=new PluginEventlogEventlog();
if ($eventlog->canView() || Session::haveRight("config","w")) {

	if (isset($_GET)) $tab = $_GET;
	if (empty($tab) && isset($_POST)) $tab = $_POST;
	if (!isset($tab["id"])) $tab["id"] = "";
	if (!isset($tab["computer"])) $tab["computer"] = "";
	if (!isset($_GET["start"])) $_GET["start"] = 0;
	if (!isset($_GET["order"])) $_GET["order"] = "DESC";
	if (!isset($_GET["field"])) $_GET["field"] = "events.date";
	if (!isset($_GET["phrasetype"])) $_GET["phrasetype"] = "contains";
	if (!isset($_GET["contains"])) $_GET["contains"] = "";
	if (!isset($_GET["sort"])) $_GET["sort"] = "events.date";
	if (!isset($_GET["computer"])) $_GET["computer"] = "";
	if (!isset($_GET["acked"])) $_GET["acked"] = 0;

   

	echo "<div align='center'>";
	echo "<table width='750' class='tab_cadre'>";
	echo "<tr>";
	echo "<th>".$LANG['plugin_eventlog'][11]." - ".
            $LANG['plugin_eventlog'][3]. " ".$_GET["computer"]."</th>";
	echo "</tr>";
	echo "</table>";
	echo "</div>";

	$eventlog->searchForm($_GET);

	$eventlog->showList($_GET);

} else {
	Html::displayRightError();
}

Html::footer();

?>