Ich habe im WHMCS Forum ein tolles Widget gefunden. Dieses Widget zeigt euch im Admin-Dashboard die monatlichen Einkünfte an und stellt diese dem Monat aus dem Vorjahr gegenüber.
So hat man einen schönen Überblick.
Ihr müsst einfach eine PHP Datei mit folgendem Inhalt erstellen und diese ins Widget Verzeichnis kopieren /modules/widgets/ und das Widget dann in den Berechtigungseinstellungen aktivieren..
PHP
<?php
if (!defined("WHMCS"))
die("This file cannot be accessed directly");
function widget_monthly_compare() {
$startmonth = date('Y-m');
$previousyear = date('Y-m', strtotime('-1 year', strtotime($startmonth)) );
$content = '<table bgcolor="#cccccc" align="center" style="margin-bottom:5px;width:100%;" cellspacing="1">
<tr bgcolor="#efefef" style="text-align:center;font-weight:bold;"><td width="25%">Month</td><td width="25%">Income</td><td width="25%">Income</td><td width="25%">Month</td></tr>';
$x=1;
while($x<=12) {
$result = mysql_query("SELECT SUM((amountin-fees-amountout)/rate) FROM tblaccounts WHERE date LIKE '".$startmonth."-%'");
while ($data = @mysql_fetch_array ($result)) {
$content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td>'.date('F Y', strtotime($startmonth)).'</td><td>'.formatCurrency($data['SUM((amountin-fees-amountout)/rate)']).'</td>';
}
$result = mysql_query("SELECT SUM((amountin-fees-amountout)/rate) FROM tblaccounts WHERE date LIKE '".$previousyear."-%'");
while ($data = @mysql_fetch_array ($result)) {
$content .= '<td>'.formatCurrency($data['SUM((amountin-fees-amountout)/rate)']).'</td><td>'.date('F Y', strtotime($previousyear)).'</td></tr>';
}
$startmonth = date('Y-m', strtotime('-1 month', strtotime($startmonth)) );
$previousyear = date('Y-m', strtotime('-1 month', strtotime($previousyear)) );
$x++;
}
$content .= '</table>';
return array( 'title' => 'Monthly Income Comparison', 'content' => $content );
}
add_hook("AdminHomeWidgets",1,"widget_monthly_compare");
?>
Alles anzeigen
Quelle: http://forum.whmcs.com/showthr…-From-This-Year-Last-Year (Beitrag 6 hat die aktuellste Version)