function yearly()
{
    include 'opendb.php';
    include 'libchart/libchart.php';
    header("Content-type: image/png");
    $chart = new VerticalChart(680, 500);
    $sql = "SELECT count(AcctStartTime), YEAR(AcctStartTime) AS Year from " . $configValues['CONFIG_DB_TBL_RADACCT'] . " group by Year;";
    $res = $dbSocket->query($sql);
    while ($row = $res->fetchRow()) {
        $chart->addPoint(new Point("{$row['1']}", "{$row['0']}"));
    }
    $chart->setTitle("Distribución de ingresos por año");
    $chart->render();
    include 'closedb.php';
}
function yearly($username)
{
    include 'opendb.php';
    include 'libchart/libchart.php';
    $username = $dbSocket->escapeSimple($username);
    header("Content-type: image/png");
    $chart = new VerticalChart(680, 500);
    $sql = "SELECT UserName, count(AcctStartTime), YEAR(AcctStartTime) AS Year FROM " . $configValues['CONFIG_DB_TBL_RADACCT'] . " WHERE username='******' GROUP BY Year;";
    $res = $dbSocket->query($sql);
    while ($row = $res->fetchRow()) {
        $chart->addPoint(new Point("{$row['2']}", "{$row['1']}"));
    }
    $chart->setTitle("Total Users");
    $chart->render();
    include 'closedb.php';
}
function yearly($username)
{
    include 'opendb.php';
    include 'libchart/libchart.php';
    $username = $dbSocket->escapeSimple($username);
    header("Content-type: image/png");
    $chart = new VerticalChart(680, 500);
    $sql = "SELECT UserName, sum(AcctInputOctets) as Uploads, year(AcctStartTime) AS year FROM " . $configValues['CONFIG_DB_TBL_RADACCT'] . " WHERE username='******' GROUP BY year;";
    $res = $dbSocket->query($sql);
    while ($row = $res->fetchRow()) {
        $uploads = floor($row[1] / 1024 / 1024);
        $chart->addPoint(new Point("{$row['2']}", "{$uploads}"));
    }
    $chart->setTitle("Total Uploads based on Yearly distribution");
    $chart->render();
    include 'closedb.php';
}
예제 #4
0
 function MultiVerticalChart($width = 600, $height = 250, $sections)
 {
     parent::VerticalChart($width, $height);
     $this->sections = $sections;
     $this->setLabelMarginLeft(intval($height / 5));
     $this->setLabelMarginRight(intval($height / 8));
     $this->setLabelMarginTop(intval($height / 5));
     $this->setLabelMarginBottom(intval($height / 5));
     $this->setLabelMarginLeft(50);
     $this->setLabelMarginRight(20);
     $this->setLabelMarginTop(20);
     $this->setLabelMarginBottom(20);
 }
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 *********************************************************************************************************
 * Description:
 *              this extension creates a pie chart of new users
 *
 * Authors:     Liran Tal <*****@*****.**>
 *              Filippo Maria Del Prete <*****@*****.**>
 *
 *********************************************************************************************************
 */
include 'checklogin.php';
if (isset($_GET['startdate'])) {
    $startdate = $_GET['startdate'];
}
if (isset($_GET['enddate'])) {
    $enddate = $_GET['enddate'];
}
include 'opendb.php';
include 'libchart/libchart.php';
header("Content-type: image/png");
$chart = new VerticalChart(680, 500);
$sql = "SELECT COUNT(*), CONCAT(YEAR(Creationdate),'-',MONTH(Creationdate), '-01') AS Month from " . $configValues['CONFIG_DB_TBL_DALOUSERINFO'] . " WHERE CreationDate >='{$startdate}' AND CreationDate <='{$enddate}' " . " GROUP BY Month ORDER BY Date(Month);";
$res = $dbSocket->query($sql);
while ($row = $res->fetchRow()) {
    $chart->addPoint(new Point("{$row['1']}", "{$row['0']}"));
}
$chart->setTitle("New Users by Month");
$chart->render();
include 'closedb.php';
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 *********************************************************************************************************
 * Description:
 *		this extension creates a pie chart of online users
 *
 * Authors:	Neville <*****@*****.**>
 *
 *********************************************************************************************************
 */
include 'checklogin.php';
include 'opendb.php';
include 'libchart/libchart.php';
header("Content-type: image/png");
$chart = new VerticalChart(500, 300);
$sql = "SELECT shortname,count(username) FROM\n\t\t\t\t" . $configValues['CONFIG_DB_TBL_RADACCT'] . " Left Join\n\t\t\t\t" . $configValues['CONFIG_DB_TBL_RADNAS'] . " ON nasname =\n\t\t\t\t" . $configValues['CONFIG_DB_TBL_RADACCT'] . ".nasipaddress WHERE (acctstoptime\n\t\t\t\tIS NULL OR acctstoptime =  '0000-00-00 00:00:00') group by nasipaddress;";
$res = $dbSocket->query($sql);
while ($row = $res->fetchRow()) {
    $chart->addPoint(new Point("{$row['0']}", "{$row['1']}"));
}
$chart->setTitle("Online Users By NAS");
$chart->render();
include 'closedb.php';
예제 #7
0
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////////////
// Last modified 05/aug/2012 by cassio@ime.usp.br
ob_start();
header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
session_start();
$locr = $_SESSION['locr'];
$loc = $_SESSION['loc'];
require_once $locr . "/libchart/libchart.php";
header("Content-type: image/png");
ob_end_flush();
$v = explode(chr(1), rawurldecode($_GET['dados']), 100);
$chart = new VerticalChart(1000, 300);
$chart->setUpperBound($v[1]);
for ($i = 2; $i < count($v); $i += 2) {
    $chart->addPoint(new Point($v[$i], $v[$i + 1]));
}
$chart->setTitle($v[0]);
$chart->setLogo($locr . "/images/poweredbyboca.png");
$chart->render();
function yearly()
{
    global $sizeDivision;
    global $size;
    include 'opendb.php';
    include 'libchart/libchart.php';
    header("Content-type: image/png");
    $chart = new VerticalChart(680, 500);
    $sql = "SELECT sum(AcctOutputOctets) as Downloads, year(AcctStartTime) AS year from " . $configValues['CONFIG_DB_TBL_RADACCT'] . " group by year;";
    $res = $dbSocket->query($sql);
    while ($row = $res->fetchRow()) {
        $downloads = floor($row[0] / $sizeDivision);
        $chart->addPoint(new Point("{$row['1']}", "{$downloads}"));
    }
    $chart->setTitle("Distribución de volumen de trafico total anual ({$size})");
    $chart->render();
    include 'closedb.php';
}
예제 #9
0
function graph_month($month, $year)
{
    include 'opendb.php';
    include 'libchart/libchart.php';
    header("Content-type: image/png");
    $chart = new VerticalChart(780, 500);
    $month = month_alpha_to_number($month);
    $lastDay = date("d", mktime(0, 0, 0, $month + 1, 0, date("Y")));
    for ($i = 1; $i <= $lastDay; $i++) {
        $measure[$i]['min'] = 100000;
        $measure[$i]['max'] = 0;
        for ($j = 0; $j < 24; $j++) {
            //24 hours a day
            $date = "{$year}-{$month}-{$i} {$j}:00:00";
            $sql = "select count(radacctid) from radacct where (acctstarttime <= '{$date}' and acctstoptime >= '{$date}') or (acctstarttime <= '{$date}' and acctsessiontime = 0 and acctinputoctets = 0 and acctoutputoctets = 0);";
            $result = $dbSocket->query($sql);
            $row = $result->fetchRow();
            $cnt = $row[0];
            if ($cnt < $measure[$i]['min']) {
                $measure[$i]['min'] = $cnt;
            } else {
                if ($cnt > $measure[$i]['max']) {
                    $measure[$i]['max'] = $cnt;
                }
            }
        }
    }
    for ($i = 1; $i <= $lastDay; $i++) {
        $chart->addPoint(new Point("{$i} - Min", $measure[$i]['min']));
        $chart->addPoint(new Point("{$i} - Max", $measure[$i]['max']));
    }
    $chart->setTitle("Logged users by month");
    $chart->render();
    include 'closedb.php';
}
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 *********************************************************************************************************
 * Description:
 *		this extension is used to count all the records (or table entries) in the radcheck table
 *
 * Authors:	Liran Tal <*****@*****.**>
 *
 *********************************************************************************************************
 */
include "checklogin.php";
include 'opendb.php';
include "libchart/libchart.php";
header("Content-type: image/png");
$chart = new VerticalChart(500, 250);
$sql = "SELECT COUNT(DISTINCT(UserName)) from " . $configValues['CONFIG_DB_TBL_RADCHECK'] . ";";
$res = $dbSocket->query($sql);
$array_users = array();
while ($row = $res->fetchRow()) {
    $chart->addPoint(new Point("Users", "{$row['0']}"));
}
$chart->setTitle("Total Users");
$chart->render();
include 'closedb.php';
?>


예제 #11
0
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 */
/**
 * Vertical bars demonstration
 *
 */
include "../libchart.php";
$chart = new VerticalChart();
$chart->addPoint(new Point("Jan 2005", 273));
$chart->addPoint(new Point("Feb 2005", 421));
$chart->addPoint(new Point("March 2005", 642));
$chart->addPoint(new Point("April 2005", 800));
$chart->addPoint(new Point("May 2005", 1200));
$chart->addPoint(new Point("June 2005", 1500));
$chart->addPoint(new Point("July 2005", 2600));
$chart->setTitle("Monthly usage for www.example.com");
$chart->render("generated/demo1.png");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Libcharts vertical bars demonstration</title>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" />
예제 #12
0
    $BL->utils->rndImage($verify_code);
    $_SESSION['captcha_key'] = md5($verify_code);
    $BL->Disconnect();
}
if (isset($REQUEST['cmd']) && $REQUEST['cmd'] == 'REPORT_IMAGE') {
    $width = 600;
    $height = 400;
    error_reporting(0);
    header("Content-type: image/png");
    require_once LIBRARIES . "libchart" . PATH_SEP . "libchart.php";
    if ($REQUEST['type'] == "pie") {
        $chart = new PieChart($width, $height);
    } elseif ($REQUEST['type'] == "hbar") {
        $chart = new HorizontalChart($width, $height);
    } elseif ($REQUEST['type'] == "vbar") {
        $chart = new VerticalChart($width, $height);
        $chart->setLabelMarginBottom(100);
    } else {
        $chart = new LineChart($width, $height);
        $chart->setLabelMarginBottom(150);
    }
    foreach ($REQUEST['datas'] as $data) {
        $chart->addPoint(new Point($data[0], $data[1]));
    }
    $chart->setLogo("");
    $chart->setTitle($REQUEST['title']);
    $chart->render();
    $BL->Disconnect();
}
//GET INVOICE/SALES/SERVERLOAD REPORT
if ($cmd == "load") {
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 *********************************************************************************************************
 * Description:
 *              this extension creates a pie chart of new users
 *
 * Authors:     Liran Tal <*****@*****.**>
 *              Filippo Maria Del Prete <*****@*****.**>
 *
 *********************************************************************************************************
 */
include 'checklogin.php';
if (isset($_GET['startdate'])) {
    $startdate = $_GET['startdate'];
}
if (isset($_GET['enddate'])) {
    $enddate = $_GET['enddate'];
}
include 'opendb.php';
include 'libchart/libchart.php';
header("Content-type: image/png");
$chart = new VerticalChart(680, 500);
$sql = "SELECT count(*), CONCAT(MONTH(Creationdate),'-',YEAR(Creationdate)) AS Month from " . $configValues['CONFIG_DB_TBL_DALOUSERINFO'] . " WHERE CreationDate >='{$startdate}' AND CreationDate <='{$enddate}' " . " group by Month;";
$res = $dbSocket->query($sql);
while ($row = $res->fetchRow()) {
    $chart->addPoint(new Point("{$row['1']}", "{$row['0']}"));
}
$chart->setTitle("Usuarios nuevos por mes");
$chart->render();
include 'closedb.php';
function yearly($username)
{
    global $sizeDivision;
    global $size;
    include 'opendb.php';
    include 'libchart/libchart.php';
    $username = $dbSocket->escapeSimple($username);
    header("Content-type: image/png");
    $chart = new VerticalChart(680, 500);
    $sql = "SELECT UserName, sum(AcctOutputOctets) as Downloads, year(AcctStartTime) AS year FROM " . $configValues['CONFIG_DB_TBL_RADACCT'] . " WHERE username='******' GROUP BY year;";
    $res = $dbSocket->query($sql);
    while ($row = $res->fetchRow()) {
        $downloads = $downloads = number_format($row[1] / $sizeDivision, 2, '.', '');
        $chart->addPoint(new Point("{$row['2']}", "{$downloads}"));
    }
    $chart->setTitle("Distribución de la descarga total por año ({$size})");
    $chart->render();
    include 'closedb.php';
}