function fill($params) { if (!$this->valid) { FX::errlog(__FILE__ . '@' . __LINE__ . ': TemplateUTF8 ist !valid!'); return false; } $retval = array(); $this->success = true; foreach ($this->components as $component) { list($t, $idx) = explode(":", $component); if ($t == "string") { $retval[] = $this->strings[$idx]; } if ($t == "var") { if (isset($params[$this->vars[$idx]])) { $retval[] = $params[$this->vars[$idx]]; } else { $this->success = false; FX::errlog(__FILE__ . '@' . __LINE__ . ', ' . $_SERVER["PHP_SELF"] . ': unset param "' . $this->vars[$idx] . '"', 'W'); } } } // echo FX::toHtmlTable($retval, true); $retval = implode("", $retval); // echo FX::toHtmlTable($retval, true); return $retval; }
function __construct($msg, $severity = '!', $filename = FALSE) { global $LNK; if ($severity == '!' && $severity != 'ERROR') { FX::errlog($msg, $severity); } $meldung = mysql_escape_string($msg); $klasse = 'INFO'; if ($severity == '!') { $klasse = 'ERROR'; } if ($severity == 'ERROR') { $klasse = 'ERROR'; } if ($severity == 'NOTICE') { $klasse = 'NOTICE'; } if ($severity == 'WARN') { $klasse = 'WARNING'; } if ($severity == 'WARNING') { $klasse = 'WARNING'; } if ($severity == 'ADMIN') { $klasse = 'ADMIN'; } $datei = ''; if ($filename !== FALSE) { $datei = mysqli_escape_string($LNK, $filename); } $sql = "INSERT DELAYED INTO reports (klasse, meldung, datei, datum)" . " VALUES ('" . $klasse . "', '" . $meldung . "', '" . $datei . "', NOW() )"; $result = @mysqli_query($LNK, $sql); if (!$result) { FX::errlog(__FILE__ . "@" . __LINE__ . ": " . mysqli_error($LNK) . " ( SQL = " . $sql . ")"); return FALSE; } }
function getRowByName($paramName) { if (!$this->has_rownames) { FX::errlog("UTF8Spreadsheet->getRowByName({$paramName}): trying, although !{$this->has_rownames}"); return false; } foreach ($this->rownames as $idx => $rowName) { if ($paramName == $rowName) { return $idx; } } //not found - error! return false; }
static function legal($message) { FX::errlog($message, "L"); }