예제 #1
0
function post_params($phpvars)
{
    global $config, $editpostparamid, $FormMethod;
    $postprocessconfig = LoadPostProcessConfig($config);
    if (!isset($postprocessconfig)) {
        return;
    }
    echo '<form action="status.php" method=' . $FormMethod . '">';
    echo '<input type="hidden" name="save" value="1">';
    echo '<input type="hidden" name="editpostparam" value="1">';
    echo '<input type="hidden" name="id" value="' . $editpostparamid . '">';
    $hasparams = false;
    $cur_queued = null;
    if (isset($phpvars['activegroup']) && $phpvars['activegroup']['LastID'] == $editpostparamid) {
        $cur_queued = $phpvars['activegroup'];
    } else {
        foreach ($phpvars['queuedgroups'] as $cur) {
            if ($cur['LastID'] == $editpostparamid) {
                $cur_queued = $cur;
                break;
            }
        }
    }
    if ($cur_queued != null) {
        echo '<div class = "block"><center>Postprocessing parameters</center><br>';
        echo '<table width="100%">';
        echo '<tr><td></td><td>name</td><td width="20">category</td><td width="60" align="right">total</td><td width="60" align="right">left</td><td width="100" align="right">estimated time</td></tr>';
        $grouppaused = $cur_queued['PausedSizeLo'] != 0 && $cur_queued['RemainingSizeLo'] == $cur_queued['PausedSizeLo'];
        if ($grouppaused) {
            echo '<tr class="pausedgroup">';
        } else {
            echo '<tr class="unpausedgroup">';
        }
        echo '<td width="10"><a href="javascript:updatestatus(\'status.php?action=groupdelete&offset=0&id=' . $cur_queued['LastID'] . '\')"><IMG src=images/cancel.gif width=15 height=15 alt="remove nzb" title="remove nzb"></a></td>';
        echo '<td>' . namereplace($cur_queued['NZBNicename']) . '</td>';
        echo '<td width="20">';
        add_category_combo($cur_queued['Category'], $cur_queued['LastID'], false);
        echo '</td>';
        echo '<td align="right">' . formatSizeMB($cur_queued['FileSizeMB']) . '</td>';
        echo '<td align="right">' . formatSizeMB($cur_queued['RemainingSizeMB'] - $cur_queued['PausedSizeMB']) . '</td>';
        if ($phpvars['status']['DownloadRate'] > 0) {
            echo '<td align="right">' . sec2hms(($cur_queued['RemainingSizeMB'] - $cur_queued['PausedSizeMB']) / ($phpvars['status']['DownloadRate'] / 1024 / 1024)) . '</td>';
        } else {
            echo '<td align="right"></td>';
        }
        echo '</tr>';
        echo '<tr><td>&nbsp;</td></tr>';
        echo '<tr><td colspan="6">';
        MergePostValues($config, $cur_queued['Parameters']);
        $hasparams = count($config) > 0;
        BuildOptionsContent($config, null, false);
        echo '</td></tr>';
        echo '</table>';
        echo '</div>';
    }
    if (!$hasparams) {
        echo '<div class="block"><table width="100%"><tr><td>';
        echo '<span class="INFO">INFO</span> Current postprocessing-script does not have any postprocessing parameters.';
        echo '</td></tr></table></div>';
    }
    echo '<div class="block"><table width="100%"><tr><td>';
    if ($hasparams) {
        echo '<input type="submit" value="Save changes">&nbsp;&nbsp;';
    }
    echo '<input type="button" value="Cancel" onClick="location=\'?\'">';
    // TIP: uncomment for debug purposes
    //echo '&nbsp;&nbsp;<input type="button" value="Reload (for testing)" onClick="javascript:updatestatus(\'status.php?editpostparam=1&id='.$editpostparamid.'\')">';
    echo '</td></tr></table></div>';
    echo '</form><br>';
}
예제 #2
0
파일: mini.php 프로젝트: hank/nzbgetweb
function serverinfobox($phpvars)
{
    global $webversion;
    echo '<div class = "block"><center>';
    echo "NZBGet " . $phpvars['version'] . "<br/>";
    echo '<center>Web Interface ' . $webversion . '</center><br/>';
    echo "<table width='250'>";
    echo "<tr><td>uptime:</td><td align=right><nobr>" . sec2hms($phpvars['status']['UpTimeSec']) . "</nobr></td></tr>";
    echo "<tr><td>download time:</td><td align=right><nobr>" . sec2hms($phpvars['status']['DownloadTimeSec']) . "</nobr></td></tr>";
    echo "<tr><td><nobr>average download rate:</nobr></td><td align=right><nobr>" . round0($phpvars['status']['AverageDownloadRate'] / 1024) . " KB/s</nobr></td></tr>";
    echo "<tr><td>total downloaded:</td><td align=right><nobr>" . formatSizeMB($phpvars['status']['DownloadedSizeMB']) . "</nobr></td></tr>";
    echo "<tr><td>free disk space:</td><td align=right><nobr>" . formatSizeMB(freediskspace()) . "</nobr></td></tr>";
    echo '</table>';
    echo '</center></div><br>';
}