Exemplo n.º 1
0
</a> <----</a> Go to  
----><a href="#" onclick='getJobsListing("<?php 
print $_GET['search_type'] . "\",\"" . $next_timeperiod;
?>
"); return false;'><?php 
print $next_timeperiod;
?>
</a>

<?php 
// view fetching, using the view option limit
try {
    $start_time = $unixtime;
    $end_time = $start_time + 86400;
    $client->startkey($start_time);
    $client->endkey($end_time);
    $view = $client->limit(100)->asArray()->getView('cronview', 'by_unixtime');
} catch (Exception $e) {
    echo "ERROR while getting view contents: " . $e->getMessage() . "<BR>\n";
}
##############################################################
# Did we get any response for the key we were looking for
##############################################################
if (sizeof($view["rows"]) > 0) {
    if (isset($_GET['search_type']) && $_GET['search_type'] == "errors") {
        print "<p><h2>Displaying jobs that ran on " . date("Y-m-d", $unixtime) . " and had errors</h2><p>";
    }
    print "\n  <table cellspacing=1 class=tablesorter border=1>\n  <thead>\n  <tr><th>Start time</th><th>Job duration</th><th>Return code</th>\n  <th>Username</th><th>Hostname</th><th>Command</th>\n  <th>StdOut (Bytes)</th><th>StdErr (Bytes)</th>\n  </tr>\n  </thead>\n  <tbody>";
    foreach ($view["rows"] as $key => $row) {
        if (isset($_GET['search_type']) && $_GET['search_type'] == "errors") {
            if (!$row["value"]["_attachments"]["stderr"]["length"] > 0) {