'.$opt.''; else return ''; }; function AddOption($val, $opt, $sel) { if ($val == $sel) return ''; else return ''; }; function AddSelect($name, $options, $default = "0", $fields = "") { global $$name; if (isset($$name)) $selected = $$name; else $selected = $default; $sel = ''; return $sel; }; function AddAutoSelect($name, $options, $default = "0") { return AddSelect($name, $options, $default, ' onchange="submit()"'); }; function AddSessionToAllHrefs($inHtml, $inSession) { if ($inSession <> "") { $search = array('/href="([^?]*)\?([^"]*)"/','/href="([^?"]*)"/'); $replace = array("href=\"\\1?\\2&$inSession\"", "href=\"\\1?$inSession\""); return preg_replace($search, $replace, $inHtml); } else return ''; }; function ob_stop() { $results = ob_get_contents(); ob_end_clean(); return $results; }; function ParsePhp($inPath, $inDir) { ob_start(); // $oldDir = getcwd(); if ($inDir <> "") chdir($inDir); // include $inPath; // if ($inDir <> "") chdir($oldDir); // return ob_stop(); }; function DbGrid($inRecordSet) { ob_start(); echo '
| '.$field.' | '; echo "
|---|
| '.$val.' | '; echo "