Example #1
0
function widget_activity_log($vars)
{
    global $_ADMINLANG;
    $title = $_ADMINLANG['utilities']['activitylog'];
    $content = '';
    $patterns = $replacements = array();
    $patterns[] = '/User ID: (.*?) /';
    $patterns[] = '/Service ID: (.*?) /';
    $patterns[] = '/Domain ID: (.*?) /';
    $patterns[] = '/Invoice ID: (.*?) /';
    $patterns[] = '/Order ID: (.*?) /';
    $patterns[] = '/Transaction ID: (.*?) /';
    $replacements[] = '<a href="clientssummary.php?userid=$1">User ID: $1</a> ';
    $replacements[] = '<a href="clientshosting.php?id=$1">Service ID: $1</a> ';
    $replacements[] = '<a href="clientsdomains.php?id=$1">Domain ID: $1</a> ';
    $replacements[] = '<a href="invoices.php?action=edit&id=$1">Invoice ID: $1</a> ';
    $replacements[] = '<a href="orders.php?action=view&id=$1">Order ID: $1</a> ';
    $replacements[] = '<a href="transactions.php?action=edit&id=$1">Transaction ID: $1</a> ';
    $result = select_query("tblactivitylog", "", "", "id", "DESC", "0,10");
    while ($data = mysql_fetch_array($result)) {
        $description = $data["description"] . ' ';
        $description = whmcsHtmlspecialchars($description);
        $description = preg_replace($patterns, $replacements, $description);
        $content .= $description . '<br /><span style="font-size:11px;">&nbsp; - ' . fromMySQLDate($data["date"], true) . ' - ' . $data['user'] . ' - ' . $data['ipaddr'] . '</span><br />';
    }
    if (!$content) {
        $content = '<div align="center">No Activity Recorded Yet</div>';
    } else {
        $content .= '<div align="right"><a href="systemactivitylog.php">' . $_ADMINLANG['home']['viewall'] . ' &raquo;</a></div>';
    }
    return array('title' => $title, 'content' => $content);
}
Example #2
0
$patterns[] = "/Domain ID: (.*?) /";
$patterns[] = "/Invoice ID: (.*?) /";
$patterns[] = "/Quote ID: (.*?) /";
$patterns[] = "/Order ID: (.*?) /";
$patterns[] = "/Transaction ID: (.*?) /";
$replacements[] = "";
$replacements[] = "<a href=\"clientsservices.php?id=\$1\">Service ID: \$1</a> ";
$replacements[] = "<a href=\"clientsdomains.php?id=\$1\">Domain ID: \$1</a> ";
$replacements[] = "<a href=\"invoices.php?action=edit&id=\$1\">Invoice ID: \$1</a> ";
$replacements[] = "<a href=\"quotes.php?action=manage&id=\$1\">Quote ID: \$1</a> ";
$replacements[] = "<a href=\"orders.php?action=view&id=\$1\">Order ID: \$1</a> ";
$replacements[] = "<a href=\"transactions.php?action=edit&id=\$1\">Transaction ID: \$1</a> ";
$result = select_query("tblactivitylog", "", $where, "id", "DESC", $page * $limit . ("," . $limit));
while ($data = mysql_fetch_array($result)) {
    $id = $data['id'];
    $description = $data['description'];
    $username = $data['user'];
    $date = $data['date'];
    $ipaddr = $data['ipaddr'];
    $description .= " ";
    $description = whmcsHtmlspecialchars($description);
    $description = preg_replace($patterns, $replacements, $description);
    $tabledata[] = array(fromMySQLDate($date, "time"), "<div align=\"left\">" . $description . "</div>", $username, $ipaddr);
}
echo $aInt->sortableTable(array("Date", "Description", "User", "IP Address"), $tabledata);
$content = ob_get_contents();
ob_end_clean();
$aInt->content = $content;
$aInt->jquerycode = $jquerycode;
$aInt->jscode = $jscode;
$aInt->display();