# HG changeset patch # User ethanzonca # Date 2010-07-13 23:22:41 # Node ID 7e40416a721378d33f38ec53562ef585e6e753de # Parent fcd0768aa12da9503bd5c0ac9a8a799f125dd20c Added page class diff --git a/inc/class.page.php b/inc/class.page.php new file mode 100644 --- /dev/null +++ b/inc/class.page.php @@ -0,0 +1,93 @@ + + $(document).ready(function(){ + $(".tablestripe tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");}); + $(".tablestripe tr:even").addClass("alt"); + $(".tablestripe tr:odd").addClass("alto"); + }); + '; + + private $title = ''; // Title of page + private $scripts = ''; // Scripts to include on page + + public function __construct($ntitle, $nscripts = ''){ + $this->title = $ntitle; + $this->scripts .= $nscripts; + if($ntitle != "NOHEAD") + $this->head(); + } + + private function top(){ + echo ' +
'; + } + +// Public functions/vars + + public function head(){ + session_start(); + + // @TODO: Add capability to load additional javascripts and stylesheets in array form + + $this->pageGenTime = round(microtime(), 3); + + echo 'doctype . '> + htmlargs . '> + + ' . $this->title . ' :: ' . $this->base_title . ' + + '; + + echo $this->scripts; + echo ' + bodyargs.' >'; + echo $this->top(); // Write out top + } + + + public function foot(){ + echo '
'; + $this->pageGenTime = round(microtime(), 3); + echo ''; + echo $this->trackingcode; + echo ''; + } + + + public function secondsToCompound($seconds) { + $ret = ""; + $hours = intval(intval($seconds) / 3600); + $ret .= "$hours:"; + $minutes = bcmod((intval($seconds) / 60),60); + $ret .= "$minutes:"; + $seconds = bcmod(intval($seconds),60); + $ret .= "$seconds"; + return $ret; + } + +} + +?> \ No newline at end of file