Location: PHPKode > projects > ARTIS WaterMon > artis-watermon-beta/line.class.php
<?php

// Toowoomba City Council Water Monitoring System
// Developed by Sam Moffatt (hide@address.com)
// Line Data Class

require_once("functions.php");

class line {
	// Variables
	var $lineid;		// Line ID
	var $top,$left;		// res HTML position	
	var $bottom,$right;	// res HTML position (bottom right corner of line)
	
	// Constructor
	function line($newlineid, $left,$top, $right, $bottom) {
		$this->top = $top;
		$this->left = $left;
		$this->bottom = $bottom;
		$this->right = $right;
		$this->lineid = $newlineid;
	}

	function getID() {
		return $this->lineid;
	}
	
	function getName() {		
		return "LINE {$this->lineid}";
	}
	
	function setTop($top) {
		$this->top = $top;
	}
	
	function setLeft($left) {
		$this->left = $left;
	}
	
	function setBottom($bottom) {
		$this->bottom = $bottom;
	}
	
	function setRight($right) {
		$this->right = $right;
	}
		
	// Return the meterervoir with div
	// - Allows position override
	function getHTML($left=0,$top=0,$bottom=0,$right=0) {
	if($top == 0) { $top = $this->top; }
	if($left == 0) { $left = $this->left; }
	if($bottom == 0) { $bottom = $this->bottom; }
	if($right == 0) { $right = $this->right; }	
	?>
  <div style="font-size:1px; position: absolute; left: <?php echo $left; ?>; top: <?php echo $top; ?>; height: <?php echo $bottom-$top; ?>; width: <?php echo $right-$left; ?>; border: 1px solid; background: #80ff80; padding: 0;" align="center"></div>

		 <?php
	}
	

}
?>
Return current item: ARTIS WaterMon