Esempio n. 1
0
	
	$go = "UPDATE";	
	$form = new Form($lang->get("logfile", "View System Logs"));	
	$form->buttonbar->add("action", $lang->get("reset_logs", "Reset Logs"));		
	$form->add(new Label("lbl", $lang->get("logs_info", "The list below shows you logs made while running N/X."), "informationheader", 2));
	$form->add(new Hidden("action", ""));

	$grid = new NXGrid("grid", 3);
	$grid->setRatio(array (
		150,
		350,
		100
	));

	$grid->addTitleRow($lang->get("date", "Date"), $lang->get("message", "Message"), $lang->get("category", "Category"));
	$sql = "Select * FROM log WHERE 1 ORDER BY LOG_TIME DESC";
	$query = new query($db, $sql);
	while ($query->getrow()) {
	  $grid->addRow(array (
		new Label("lbl", $query->field("LOG_TIME"), "standardwhite"),
		new Label("lbl", $query->field("MESSAGE"), "standardwhite"),
		new Label("lbl", $query->field("CATEGORY"), "standardwhite")
	  ));			
	}
	$query->free();

	$form->add($grid);
	$page->add($form);
	$page->draw();
	$db->close();
?>
<?php

require_once "../../config.inc.php";
$auth = new auth("ANALYSE_RATINGS");
$page_action = "update";
$go = "update";
$page = new Page("Rating Results");
$form = new EditForm($lang->get("rateres", "Rate Results"));
$interval = array();
$count = countRows("pgn_rating", "RATINGID", "COMMENT <>''");
$steps = $count / 50;
for ($i = 0; $i < $steps; $i++) {
    $interval[$i][0] = $i * 50 . " - " . (($i + 1) * 50 - 1);
    $interval[$i][1] = $i;
}
$form->add(new Label("lbl", $lang->get("display", "Display"), "standard"));
$form->add(new Select("display", $interval, "standardlight", value("display"), 1));
$grid = new NXGrid("grid", 3);
$grid->setRatio(array(150, 350, 100));
$grid->addRow(array(new Label("lbl", "<b>" . $lang->get("page", "Page") . "</b>"), new Label("lbl", "<b>" . $lang->get("comment", "Comment") . "</b>"), new Label("lbl", "<b>" . $lang->get("date", "Date") . "</b>")));
$thisInterval = value("interval");
$sql = "SELECT SOURCEID, COMMENT, TIMESTAMP FROM pgn_rating WHERE COMMENT <> '' ORDER BY TIMESTAMP DESC";
$query = new query($db, $sql);
while ($query->getrow()) {
    $grid->addRow(array(new Label("lbl", resolvePageToLink($query->field("SOURCEID"))), new Label("lbl", str_replace('\\\\', '\\', $query->field("COMMENT"))), new Label("lbl", formatDBTimestamp($query->field('TIMESTAMP')))));
}
$query->free();
$form->add($grid);
$page->add($form);
$page->draw();
		/**
		 * Draws the objects and their corresponding buttons. 
		 * makes use of draw_dispatcher.
		 */
		function draw_objects() {
			global $lang;
			$grid = new NXGrid("grid", 7);
			$grid->setRatio(array (	140,
									140,
									150,
									20,
									30,
									70,									
									70));
			
			$grid->addTitleRow(array( $lang->get("name"), $lang->get("type"), $lang->get("status"), "&nbsp;", "&nbsp;", "&nbsp;", "&nbsp;"));

			for ($i=1; $i <= count( $this->objects ); $i++) {
				$grid->addRow( 	array( 	new Label("lbl", "<b>".$i.". ".$this->objects[$i]["name"]."</b>", "cwhite_small" ),
			  							new Label("lbl", $this->getType($i), "cwhite_small"),
			  							new Label("lbl", $this->getInformation($i), "cwhite_small"),			  							
			  							new LinkButtonInCell("s".$this->objects[$i]["id"], $lang->get("up"), "navelement", "submit"),
			  					 		new LinkButtonInCell("s".$this->objects[$i]["id"], $lang->get("down"), "navelement", "submit"),
										new LinkButtonInCell("s".$this->objects[$i]["id"], $lang->get("config"), "navelement", "submit"),
			  					 		new LinkButtonInCell("s".$this->objects[$i]["id"], $lang->get("delete"), "navelement", "submit")));
			  retain("s".$this->objects[$i]["id"], "");
			}			
				
			echo '<tr><td colspan="2" class="informationheader">';
			$lbi = new ButtonInline("neu", $lang->get("new"), "navelement", "submit");
			echo $lbi->draw().'<br><br>';
			retain("neu", "");
			echo '<tr>';
			$cl = new Cell("clc", "standardwhite", 2, 600, 1);
			$cl->draw();
			echo '</tr>';
			echo '</td></tr>';
			echo '<tr>';
			$grid->draw();
			echo '</tr>';

		}