コード例 #1
0
/**
 * Método que sirve de reemplazo al mecanismo de paloSantoGraph y paloSantoGraphLib
 * para generar gráficos a partir de una clase que devuelve datos.
 *
 * @param   string  $module     Módulo que contiene la clase fuente de datos
 * @param   string  $class      Clase a instanciar para obtener fuente de datos
 * @param   string  $function   Método a llamar en la clase para obtener datos
 * @param   array   $arrParameters  Lista de parámetros para la invocación 
 * @param   string  $functionCB 
 */
function displayGraph($G_MODULE, $G_CLASS, $G_FUNCTION, $G_PARAMETERS, $G_FUNCTIONCB = "")
{
    global $arrConf;
    if ($G_MODULE != '') {
        require_once "apps/{$G_MODULE}/libs/{$G_CLASS}.class.php";
        //lib del modulo
        require_once "apps/{$G_MODULE}/configs/default.conf.php";
        //archivo configuracion del modulo
        global $arrConfModule;
        $dsn = isset($arrConfModule["dsn_conn_database"]) ? $arrConfModule["dsn_conn_database"] : "";
    } else {
        require_once "libs/{$G_CLASS}.class.php";
        //lib del modulo
        require_once "configs/default.conf.php";
        //archivo de configuracion general
        $dsn = isset($arrConf['elastix_dsn']['elastix']) ? $arrConf['elastix_dsn']['elastix'] : "";
    }
    $oPaloClass = new $G_CLASS($dsn);
    $arrParam = $G_PARAMETERS;
    $result = call_user_func_array(array(&$oPaloClass, $G_FUNCTION), $arrParam);
    if ($G_FUNCTIONCB != '') {
        $result['FORMAT_CALLBACK'] = array($oPaloClass, $G_FUNCTIONCB);
    }
    return displayGraphResult($result);
}
コード例 #2
0
ファイル: index.php プロジェクト: hardikk/HNH
 function handleJSON_graphic($smarty, $module_name, $appletlist)
 {
     $value = $_REQUEST['percent'];
     if (!is_numeric($value)) {
         return;
     }
     $size = '140,140';
     $result = array();
     $result['ATTRIBUTES'] = array('TYPE' => 'gauge', 'SIZE' => $size);
     // bar => gauge
     $result['MESSAGES'] = array('ERROR' => 'Error', 'NOTHING_SHOW' => 'Nada que mostrar');
     $temp = array();
     $temp['DAT_1'] = array('VALUES' => array("value" => $value));
     $result['DATA'] = $temp;
     displayGraphResult($result);
 }
コード例 #3
0
ファイル: statistics.php プロジェクト: precurse/netharbour
include_once 'classes/DeviceForm.php';
//Make a new contact, a new tool bar, and a new form
$tool = new EdittingTools();
$deviceForm = new DeviceForm("auto", 4);
//get the new contact corresponding to the ID
$devices = new Device($_GET['ID']);
$status;
$keyword = $_POST['keyword'];
$options = array('THIS DEVICE', 'GLOBAL');
if ($_GET['action'] == showGraph) {
    $result = $_POST['list'];
    displayGraph($devices, $result);
} else {
    if ($_GET['action'] == showGraphResult) {
        //get the new contact corresponding to the ID
        displayGraphResult($keyword);
    } else {
        if ($_GET['action'] == showGraphList) {
            if ($_POST['options'] == 'GLOBAL') {
                displayGraphListResult($keyword);
            } else {
                //get the new contact corresponding to the ID
                displayGraphList($devices);
            }
        } else {
            if ($_GET['action'] == showGraphListResult) {
                //get the new contact corresponding to the ID
                displayGraphListResult($keyword);
            } else {
                if ($_GET['action'] == showGraphDetail) {
                    //get the new contact corresponding to the ID
コード例 #4
0
ファイル: index.php プロジェクト: lordbasex/elastix-gui
 function handleJSON_graphic($smarty, $module_name, $appletlist)
 {
     $result = $this->_sampler_CallsMemoryCPU();
     displayGraphResult($result);
 }
コード例 #5
0
ファイル: index.php プロジェクト: hardikk/HNH
 function handleJSON_graphic($smarty, $module_name, $appletlist)
 {
     $value = $_REQUEST['percent'];
     if (!is_numeric($value)) {
         return;
     }
     $result = array();
     $result['ATTRIBUTES'] = array('TITLE' => '', 'TYPE' => 'plot3d2', 'SIZE' => "220,100", 'POS_LEYEND' => "0.06,0.3", "COLOR" => "#fafafa", "SIZE_PIE" => "50", "MARGIN_COLOR" => "#fafafa");
     $result['MESSAGES'] = array('ERROR' => 'Error', 'NOTHING_SHOW' => 'Nada que mostrar');
     $arrTemp = array();
     for ($i = 1; $i <= 2; $i++) {
         $data = array();
         $data['VALUES'] = $i == 1 ? array('VALUE' => $value) : array('VALUE' => 100 - $value);
         $data['STYLE'] = array('COLOR' => $i == 1 ? '#3184d5' : '#6e407e', 'LEYEND' => $i == 1 ? 'Used' : 'Free');
         $arrTemp["DAT_{$i}"] = $data;
     }
     $result['DATA'] = $arrTemp;
     displayGraphResult($result);
 }