Example #1
0
    // erwartet einen Parameter in der Form: dateFrom=2007-12-12+08:00:00 , dateTo=2007-12-19+20:59:59
    $timeStampFrom = FX::parseDBDate(str_replace("+", " ", $d0));
    $timeStampTo = FX::parseDBDate(str_replace("+", " ", $d1));
    echo "Dateien, auf die zwischen den Daten " . FX::makeDBDate($timeStampFrom) . " und " . FX::makeDBDate($timeStampTo) . " schreibend zugegriffen wurde.\n";
    $sql = "SELECT path, fname, mtime FROM files WHERE " . "(mtime > '" . FX::makeDBDate($timeStampFrom) . "') " . " AND (mtime < '" . FX::makeDBDate($timeStampTo) . "') " . " AND (status='C')" . " ORDER BY mtime DESC;";
    $result = @mysqli_query($LNK, $sql);
    if (!$result) {
        errlog(__FILE__ . "@" . __LINE__ . ": " . mysqli_error($LNK) . " ( SQL = " . $sql . ")");
    }
    while ($row = mysqli_fetch_assoc($result)) {
        extract($row);
        echo $path . "/" . $fname . " [" . $mtime . "]" . "\n";
    }
}
if (isset($sameName)) {
    echo "Dateien mit dem Namen " . FX::html_encode($sameName) . " existieren in den Verzeichnissen:\n";
    $sql = "SELECT path, size FROM files WHERE fname LIKE '" . mysqli_escape_string($LNK, $sameName) . "' AND status='C';";
    $result = @mysqli_query($LNK, $sql);
    if (!$result) {
        errlog(__FILE__ . "@" . __LINE__ . ": " . mysqli_error($LNK) . " ( SQL = " . $sql . ")");
    }
    while ($row = mysqli_fetch_assoc($result)) {
        echo $row["path"] . " [" . $row["size"] . " bytes]" . "\n";
    }
}
if (isset($largeFiles)) {
    $sql = "SELECT path, fname, size FROM files WHERE size > (100 * 1048000) AND status='C'";
    if (isset($ext)) {
        $sql .= " AND extension LIKE '" . mysqli_escape_string($LNK, $ext) . "'";
    }
    $sql .= " ORDER BY size DESC;";
Example #2
0
 static function toHtmlTable($obj, $htmlEncode = false)
 {
     $retval = array();
     if (is_object($obj)) {
         $retval[] = '<table>';
         $retval[] = '<tr><th>' . get_class($obj) . '</th><th>&nbsp;</th></tr>';
         $retval[] = '<tr><th>Field</th><th>Value</th></tr>';
         foreach (get_object_vars($obj) as $key => $value) {
             if ($value === false) {
                 $value = '<em>false</em>';
             }
             if ($value === null) {
                 $value = '<em>null</em>';
             }
             if (is_array($value) or is_object($value)) {
                 $value = FX::toHtmlTable($value, $htmlEncode);
             } else {
                 if ($htmlEncode) {
                     $value = FX::html_encode($value);
                 }
             }
             $retval[] = '<tr><td valign="top">' . $key . '</td><td valign="top">' . $value . '</td></tr>';
         }
         $retval[] = '</table>';
     } else {
         if (is_array($obj)) {
             if (count($obj) == 0) {
                 $retval[] = '<em>(empty array)</em>';
             } else {
                 $retval[] = '<table>';
                 $retval[] = '<tr><th>Key</th><th>Value</th></tr>';
                 foreach ($obj as $key => $value) {
                     if ($value === false) {
                         $value = '<em>false</em>';
                     }
                     if ($value === null) {
                         $value = '<em>null</em>';
                     }
                     if (is_array($value) or is_object($value)) {
                         $value = FX::toHtmlTable($value, $htmlEncode);
                     } else {
                         if ($htmlEncode) {
                             $value = FX::html_encode($value);
                         }
                     }
                     $retval[] = '<tr><td valign="top">' . $key . '</td><td valign="top">' . $value . '</td></tr>';
                 }
                 $retval[] = '</table>';
             }
         } else {
             if ($htmlEncode) {
                 $obj = FX::html_encode($obj);
             }
             $retval[] = $obj;
         }
     }
     return implode("\n", $retval);
 }