Example #1
0
function historydisplay($history, $showlog)
{
    global $HistoryTimeFormat, $TimeZoneCorrection, $LogTimeFormat;
    echo '<tr><td colspan="3"></td><td>time</td><td>name</td><td>category</td><td width="60" align="right">size</td><td width="40" align="right">files</td><td width="10"></td><td width="80">Par Status</td><td width="80">Script Status</td></tr>';
    foreach ($history as $hist) {
        echo '<tr>';
        echo '<td width="10"><a href="javascript:updatestatus(\'status.php?action=historydelete&offset=0&id=' . $hist['NZBID'] . '\')"><IMG src="images/cancel.gif" width="15" height="15" alt="remove from history" title="remove from history"></a></td>';
        echo '<td width="10">' . ($hist['RemainingFileCount'] > 0 ? '<a href="javascript:updatestatus(\'status.php?action=historyreturn&offset=0&id=' . $hist['NZBID'] . '\')">' : '') . '<IMG src="images/return' . ($hist['RemainingFileCount'] > 0 ? '' : '-disabled') . '.gif" width="15" height="15" alt="return to download queue" title="return to download queue' . ($hist['RemainingFileCount'] > 0 ? '' : ' (not possible, there are no files left for download)') . '">' . ($hist['RemainingFileCount'] > 0 ? '</a>' : '') . '</td>';
        echo '<td width="10"><a href="javascript:updatestatus(\'status.php?action=historyprocess&offset=0&id=' . $hist['NZBID'] . '\')"><IMG src="images/reprocess.gif" width="15" height="15" alt="post-process again" title="post-process again"></a></td>';
        echo '<td valign="top" class="date">' . date($HistoryTimeFormat, $hist['HistoryTime'] + $TimeZoneCorrection * 60 * 60) . '</td>';
        echo '<td valign="top">' . namereplace($hist['NZBNicename']) . '</td>';
        echo '<td valign="top"><span class="category">' . $hist['Category'] . '</span></td>';
        echo '<td valign="top" align="right">' . formatSizeMB($hist['FileSizeMB']) . '</td>';
        echo '<td valign="top" align="right">' . $hist['FileCount'] . '</td>';
        echo '<td></td>';
        echo '<td valign="top"><span class="' . $hist['ParStatus'] . '">' . $hist['ParStatus'] . '</span></td>';
        echo '<td valign="top"><span class="' . $hist['ScriptStatus'] . '">' . $hist['ScriptStatus'] . '</span></td>';
        echo '</tr>';
        if ($showlog) {
            $log = $hist['Log'];
            if (count($log) > 0) {
                echo '<tr>';
                echo '<td></td>';
                echo '<td colspan="11"><table width="100%">';
                foreach ($log as $info) {
                    echo "<tr class='history-log'><td valign='top' class='" . $info['Kind'] . "'>" . $info['Kind'] . "</td><td valign='top'><span class='date'>" . date($LogTimeFormat, $info['Time'] + $TimeZoneCorrection * 60 * 60) . "</span> " . FormatLogText($info['Text']) . "</td></tr>";
                }
                echo '<small></table></td>';
                echo '</tr>';
            }
        }
    }
}
Example #2
0
function logging($phpvars, $page)
{
    global $NewMessagesFirst, $MessagesPerPage, $LogTimeFormat, $MiniLogColumns, $TimeZoneCorrection;
    $a = $phpvars['log'];
    if ($NewMessagesFirst) {
        $a = array_reverse($a);
    }
    $cnt = count($a);
    $pagecount = pagecount($cnt, $MessagesPerPage);
    if ($page > $pagecount) {
        $page = $pagecount;
    }
    if ($page < 1) {
        $page = 1;
    }
    $per_page = $MessagesPerPage;
    if ($NewMessagesFirst) {
        $start = ($page - 1) * $MessagesPerPage;
    } else {
        $start = $cnt - $page * $MessagesPerPage;
        if ($start < 0) {
            $per_page = $MessagesPerPage + $start;
            $start = 0;
        }
    }
    echo '<div class = "block"><center>Messages</center><br>';
    echo '<table width="100%">';
    foreach (array_slice($a, $start, $per_page) as $info) {
        if ($MiniLogColumns) {
            echo "<tr><td valign='top' class='" . $info['Kind'] . "'>" . $info['Kind'] . "&nbsp;</td><td valign='top' width='100%'>" . ($LogTimeFormat != '' ? "<span class='date'>" . date($LogTimeFormat, $info['Time'] + $TimeZoneCorrection * 60 * 60) . "</span><br>" : "") . FormatLogText($info['Text']) . "</td></tr>";
        } else {
            echo "<tr><td> <span class='" . $info['Kind'] . "'>" . $info['Kind'] . '&nbsp;</span>' . ($LogTimeFormat != '' ? '<span class="date">' . date($LogTimeFormat, $info['Time'] + $TimeZoneCorrection * 60 * 60) . '</span><br>' : '') . FormatLogText($info['Text']) . '</td></tr>';
        }
    }
    echo '</table>';
    if ($cnt > $MessagesPerPage) {
        pagelist($cnt, $page, $MessagesPerPage, 'logpage');
    }
    echo '</div><br>';
}