function getXTemplate($template, $endung = "tmpl") { $file = file("templates/" . $template . "." . $endung); $txt = implode("", $file); debugOutput($txt); return str_replace("\"", "\\\"", $txt); }
function getDbValue($tab, $col, $where) { //Liefert die angeforderten Werte aus der public_vars - Tabelle als Array ($title=>$text) $sql = "select " . $col . " from " . $tab . " where " . $where . " limit 1 "; $res = $_SESSION['config']->DBCONNECT->executeQuery($sql); $row = mysql_fetch_array($res); debugOutput("getDbValue(" . $tab . ", " . $col . ", " . $where . " ) -> " . $row[$col] . "<br>"); return $row[$col]; }
function executeQuery($query) { // sendet einen query $err_msg = "Fehler bei der Datenbankabfrage!"; if (isset($_SESSION['config']) && isset($_SESSION['config']->CURRENTUSER) && $_SESSION['config']->CURRENTUSER->STATUS == "admin") { // echo $query; $res = @mysql_query($query) or die($err_msg . "<br><br>" . mysql_error() . "<br> ||" . $query . "||"); } else { $res = @mysql_query($query); // or die ($err_msg ."<br><br>".mysql_error()."<br> ||".$query."||"); } debugOutput($query); return $res; }
/** * holt alle Daten neu aus der Datenbank */ function refresh() { //RESET $this->ROWS = array(); //----------------------------- // DB abfragen //----------------------------- $tn1 = explode(',', $this->TABLENAME); $preTabAliasx = explode(' ', $tn1[0]); if (count($preTabAliasx) > 1) { $preTabAlias = $preTabAliasx[1] . "."; } else { $preTabAlias = ""; } $limitFrom = ($this->CURRENT_PAGE - 1) * $this->getMaxRowsToFetch(); //SQL zusammenbauen für aktualisierung $stmt = "SELECT " . $this->COLNAMESTRING . ", " . $preTabAlias . "id as rowid FROM " . $this->TABLENAME . " " . $this->getWhere() . $this->ORDERBY; if ($this->isLimitActive()) { $stmt .= " limit " . $limitFrom . ", " . $this->getMaxRowsToFetch(); } debugOutput($stmt . "<br>"); $result = $this->DBCONNECT->executeQuery($stmt); if ($result) { if (mysql_num_rows($result) <= 0) { return; } } else { //echo $stmt; return; } while ($dbRow = mysql_fetch_array($result)) { $newRow = $this->createRow(); for ($i = 0; $i < mysql_num_fields($result); $i++) { $newRow->setAttribute($i, $dbRow[$i]); } $this->addRow($newRow); } $this->prepareFonts(); }