This program 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. ------------------------------------------------------------------------------- */ function msg($messages) { global $_SERVER, $_colors; if(empty($messages)) return; $messages = explode("\n", $messages); echo "
\n\n
\n"; } class table { var $row = 0; var $col = 0; var $colmax = 0; var $packages; var $params; var $thId; var $tdId; var $tableId; var $innerBorder = TRUE; function setCol($input = "", $inputparams = "") { $this->col++; if($this->col > $this->colmax) $this->colmax = $this->col; $this->data[$this->row][$this->col]["data"] = $input; $this->data[$this->row][$this->col]["params"] = $inputparams; } function setRow() { $this->row++; $this->col = 0; } function show() { $h = "height=\"13\""; $w = "width=\"7\""; $colspan = $this->colmax; if(isset($this->summary)) $summary = "summary=\"".$this->summary."\""; echo "tableId."\" $summary cellspacing=\"0\" cellpadding=\"3\">\n"; $k = 1; foreach($this->data as $row) { echo "\n"; $i = 0; foreach($row as $col) { unset($class_tag); unset($style_tag); unset($class); unset($style); if($empty_cells > 1 && $i == 0) { $empty_cells--; $i++; continue; } if(ereg("header", $col["params"])) { $tagname = "th id=\"".$this->thId."\""; if($this->innerBorder) $class = "border_bottom "; } elseif(empty($col["params"])) { unset($style); $tagname = "td id=\"".$this->tdId."\""; } else { $class = $col["params"]; $tagname = "td id=\"".$this->tdId."\""; } $empty_cells = 0; while(empty($this->data[$k+$empty_cells][1]["data"]) && $empty_cells+$k <= count($this->data)) { $empty_cells++; } if($empty_cells > 1 && $i == 0) { $span = " rowspan=\"$empty_cells\""; $class.= " top_align"; } elseif($i == count($row)-1 && $i < $this->colmax-1) { $colspan = $this->colmax - $i; $span.= " colspan=\"$colspan\""; } else unset($span); if($i != $this->colmax-1 && !($i == count($row)-1 && $i < $this->colmax-1) && $this->innerBorder) $class = "border_right $class"; if(!empty($class)) { $class_tag = " class=\"".trim($class)."\""; } if(!empty($style)) { $style_tag = " style=\"".trim($style)."\""; } if(empty($col["data"])) $col["data"] = " "; echo "\t<$tagname".$class_tag.$style_tag.$span.">".$col["data"]."\n"; $i++; } echo "\n"; $k++; } echo "
\n"; } } ?>