/**
  * Method to show the Flash Graph
  *
  * Developers - DO NOT FORGET TO USE THE FLASH GRAPH DATA OBJECT FOR THE DATA
  *
  * @return string
  */
 public function show()
 {
     // Fix URL
     $this->dataSource = str_replace('&', '&', $this->dataSource);
     // Return Flash Object
     return open_flash_chart_object_str($this->width, $this->height, $this->dataSource, FALSE, $this->getResourceUri('openflashchart/1.9.6/'));
 }
function grafico($uri = null, $options = array())
{
    $options = _parse_attributes($options);
    $options['width'] = isset($options['width']) ? $options['width'] : '300';
    $options['height'] = isset($options['height']) ? $options['height'] : '200';
    $ruta = sfContext::getInstance()->getUser()->getAttribute('ruta', null);
    $direccion = $ruta . "/index.php/" . $uri;
    $value = null;
    try {
        $value = open_flash_chart_object_str($options['width'], $options['height'], $direccion, true, $ruta . "/");
        return $value ? $value : null;
    } catch (Exception $e) {
        return null;
    }
}
Beispiel #3
0
<?php

$ACCESS_LEVEL = ACCESS_LEVEL_ADMIN;
include_once DOC_ROOT . '/includes/authorization.php';
include_once LIB_ROOT . '/users/statistics.class.php';
$stats = new Statistics();
$stats->select = ' sum(amount) as sum ';
$deposited = $stats->getLines(array('d'), 2);
$reinvested = $stats->getLines(array('i'), 1);
$earned = $stats->getLines(array('e'), 1);
$withdrawn = $stats->getLines(array('w'), 1);
$referral_bonuses = $stats->getLines(array('r'), 1);
Project::getInstance()->getSmarty()->assign('deposited', $deposited[0]['sum'] - abs($reinvested[0]['sum']));
Project::getInstance()->getSmarty()->assign('reinvested', $reinvested[0]['sum']);
Project::getInstance()->getSmarty()->assign('earned', $earned[0]['sum']);
Project::getInstance()->getSmarty()->assign('withdrawn', $withdrawn[0]['sum']);
Project::getInstance()->getSmarty()->assign('referral_bonuses', $referral_bonuses[0]['sum']);
include_once LIB_ROOT . '/liberty.class.php';
$LR = new LibertyReserve(get_setting('lr_api'), get_setting('lr_api_secword'));
Project::getInstance()->getSmarty()->assign('lr_balance', $LR->getBalance(get_setting('lr_account')));
include_once LIB_ROOT . '/perfect.class.php';
$PM = new PerfectMoney(get_setting('pm_member_id'), get_setting('pm_password'));
$balance = $PM->getBalance();
Project::getInstance()->getSmarty()->assign('pm_balance', $balance[get_setting('pm_account')]);
include_once LIB_ROOT . '/php-ofc-library/open-flash-chart-object.php';
Project::getInstance()->getSmarty()->assign('chart', open_flash_chart_object_str(1000, 500, 'chart-data.php', false, '/admin/'));
Project::getInstance()->getSmarty()->display('../default/admin/statistics.tpl');