$sql_totavg = "SELECT idtktinPK,timereported,timeclosed FROM tktin \n\t\t\t\tWHERE date(tktin.timereported)>='" . $_SESSION['timestart'] . "' \n\t\t\t\tAND date(tktin.timereported)<='" . $_SESSION['timestop'] . "' \n\t\t\t\tAND (tktstatus_idtktstatus=4 OR tktstatus_idtktstatus=5)\n\t\t\t\tAND timeclosed!='0000-00-00 00:00:00'";
$res_totavg = mysql_query($sql_totavg);
$fet_totavg = mysql_fetch_array($res_totavg);
$num_totavg = mysql_num_rows($res_totavg);
if ($num_totavg > 0) {
    $differenceInSeconds_total_2 = 0;
    do {
        $differenceInSeconds_2 = 0;
        $timereported_2 = strtotime($fet_totavg['timereported']);
        $timeclosed_2 = strtotime($fet_totavg['timeclosed']);
        $differenceInSeconds_2 = $timeclosed_2 - $timereported_2;
        $differenceInSeconds_total_2 = $differenceInSeconds_total_2 + $differenceInSeconds_2;
    } while ($fet_totavg = mysql_fetch_array($res_totavg));
    //Get the average number of seconds for the closed tickets
    $differenceInSeconds_avg_2 = $differenceInSeconds_total_2 / $num_totavg;
    echo seconds2human($differenceInSeconds_avg_2);
} else {
    echo "--";
}
?>
          	</td>
        </tr>  
    </table>  
         </td>
    <td width="5%">
    </td>
    <td width="40%" valign="top">
    	 <table width="100%" border="0" cellpadding="2" cellspacing="0" style="border:1px solid #999999">
        <tr>
            <td width="30%" class="tbl_h">Legend Title</td>
            <td width="70%" class="tbl_h" style="color:#cccccc">-</td>
Exemplo n.º 2
0
                if (isset($p->port->service['banner'])) {
                    $banner = $p->port->service['banner'];
                } else {
                    $banner = '';
                }
                $title = '';
            }
        } else {
            $service = '';
            $banner = '';
            $title = '';
        }
        $state = (string) $p->port->state['state'];
        $reason = (string) $p->port->state['reason'];
        $reason_ttl = (string) $p->port->state['reason_ttl'];
        $q = "INSERT INTO data SET id = null,\n                ip = " . $ip . ",\n                port_id = " . (int) $port . ",\n                scanned_ts = '" . DB::escape($scanned_ts) . "',\n                protocol = '" . DB::escape($protocol) . "',\n                state = '" . DB::escape($state) . "',\n                reason = '" . DB::escape($reason) . "',\n                reason_ttl = '" . (int) $reason_ttl . "',\n                service = '" . DB::escape($service) . "',\n                banner = '" . DB::escape($banner) . "',\n                title = '" . DB::escape($title) . "'";
        $total++;
        if (DB::execute($q)) {
            $inserted++;
        }
    }
}
$end_ts = time();
echo PHP_EOL;
echo "Summary:";
echo PHP_EOL;
echo "Total records:" . $total . "\n";
echo "Inserted records:" . $inserted . "\n";
$secs = $end_ts - $start_ts;
echo "Took about:" . seconds2human($secs);
echo PHP_EOL;
Exemplo n.º 3
0
<?php

theme::header_start('Cache', 'Manage "' . $current_cache . '" cache.');
Plugin_search_sort::field();
o_dialog::confirm_button($controller_path . '/clear', 'All', 'trash', 'Cached Entries', 'Do you want to delete all cached entries?', ['redirect' => 'true']);
theme::header_end();
theme::table_start(['Name', 'Size' => 'text-center', 'Created', 'Expires', 'Actions' => 'text-center'], [], $records);
foreach ($records as $record) {
    $record = (object) $record;
    theme::table_start_tr();
    theme::e($record->name);
    theme::table_row('text-center');
    theme::e(byte_format($record->size));
    $total_bytes += $record->size;
    theme::table_row();
    theme::e(date('m/d/y g:ia', $record->date));
    theme::table_row();
    theme::e(date('m/d/y g:ia', $record->date + $ttl_txt));
    theme::table_row('actions text-center');
    o_dialog::confirm_a_delete($this->controller_path . '/delete/' . urlencode($record->name));
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
if ($total_bytes > 0) {
    echo '<p><strong>Total Size <span class="badge">' . byte_format($total_bytes) . '</span></strong></p>';
}
if ($ttl_txt > 0) {
    echo '<p><strong>Time to live <span class="badge">~' . seconds2human($ttl_txt) . '</span></strong></p>';
}
Exemplo n.º 4
0
<?php

theme::header_start('Lockouts', 'Login Max Attempts <span class="badge badge-info">' . $attempts . '</span> Login Attempts Expire After <span class="badge badge-info">' . seconds2human($expire) . '</span>');
Plugin_search_sort::field();
if (count($records) > 0) {
    o_dialog::confirm_button($controller_path . '/clear', 'All', 'trash', 'Login Attempts', 'Do you want to remove all login attempts?', ['redirect' => 'true']);
}
theme::header_end();
theme::table_start(['IP Address', 'Login', 'Time', 'Actions' => 'text-center'], [], $records);
foreach ($records as $record) {
    theme::table_start_tr();
    theme::e($record->ip_address);
    theme::table_row();
    theme::e($record->login);
    theme::table_row();
    theme::date($record->time);
    theme::table_row('actions text-center');
    o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();