{
	$where 	= ($_SESSION['cs_nivel_administracao'] <> 1 &&
			   $_SESSION['cs_nivel_administracao'] <> 2 ? ' AND redes.id_local = '.$_SESSION['id_local']:'');

	// Caso hajam locais secundários associados ao usuário, incluo-os na cláusula Where
	if ($_SESSION['te_locais_secundarios']<>'' && $where <> '')
		{
		// Faço uma inserção de "(" para ajuste da lógica para consulta
		$where = str_replace('redes.id_local = ','(redes.id_local = ',$where);
		$where .= ' OR redes.id_local in ('.$_SESSION['te_locais_secundarios'].')) ';
		}					   
	}
else
	$where = $_GET['where'];

require '../include/monta_consulta_acessos.php';
	
$CreatePie 		= 1;
$Sort      		= 1;
$ShowText		= 0;
$DisplaySequence= 0;
$width 			= 700;
$height 		= 500;//250;
$DisplaySequence= 0; // Quantidade de posições para o sequencial
$ImgType		= 'PNG';
$myLineSize		= 263;
$CenterX		= 450;
$DiameterX		= 480;

phPie($arr_acessos, $width, $height, $CenterX, $CenterY, $DiameterX, $DiameterY, $MinDisplayPct, $DisplayColors, $BackgroundColor, $LineColor, true, 3,$CreatePie, $Sort,$DisplaySequence, $ShowText, $ImgType, $myLineSize); 
?>
Esempio n. 2
0
 /* 
 Copyright 2000, 2001, 2002, 2003, 2004, 2005 Dataprev - Empresa de Tecnologia e Informa��es da Previd�ncia Social, Brasil

 Este arquivo � parte do programa CACIC - Configurador Autom�tico e Coletor de Informa��es Computacionais

 O CACIC � um software livre; voc� pode redistribui-lo e/ou modifica-lo dentro dos termos da Licen�a P�blica Geral GNU como 
 publicada pela Funda��o do Software Livre (FSF); na vers�o 2 da Licen�a, ou (na sua opni�o) qualquer vers�o.

 Este programa � distribuido na esperan�a que possa ser  util, mas SEM NENHUMA GARANTIA; sem uma garantia implicita de ADEQUA��O a qualquer
 MERCADO ou APLICA��O EM PARTICULAR. Veja a Licen�a P�blica Geral GNU para maiores detalhes.

 Voc� deve ter recebido uma c�pia da Licen�a P�blica Geral GNU, sob o t�tulo "LICENCA.txt", junto com este programa, se n�o, escreva para a Funda��o do Software
 Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
session_start(); 
/*
 * verifica se houve login e tamb�m regras para outras verifica��es (ex: permiss�es do usu�rio)!
 */
if(!isset($_SESSION['id_usuario'])) 
  die('Acesso negado (Access denied)!');
else { // Inserir regras para outras verifica��es (ex: permiss�es do usu�rio)!
}

include_once '../include/library.php'; 
include_once '../include/piechart.php';

$CreatePie = 0;
$Sort      = 1;
		
phPie($_SESSION['arr_mac'], 420 ,	50, $CenterX, $CenterY, $DiameterX, $DiameterY, $MinDisplayPct, $DisplayColors, $BackgroundColor, $LineColor, true, 3,$CreatePie, $Sort);
?>
		$v_row_result = substr($v_row_result,1,$v_pontos_preenchimento - 1);
		}

	while (strpos($v_row_result,'  ')>0) 
		{
		$v_row_result = str_replace('  ',' ',$v_row_result);
		}
	$v_row_result = str_pad($v_row_result,$v_pontos_preenchimento,'.',STR_PAD_RIGHT);

	if ($v_total == 0 || str_replace('.','',$v_row_result) == '') 
		{
		$v_nao_identificado ++;
		}
	else
		{
		$v_array[$v_row_result] = $v_total;				
		}
	}
	
if ($v_nao_identificado > 0)
	{
	$v_array[str_pad('Não Identificado',$v_pontos_preenchimento,'.',STR_PAD_RIGHT)] = $v_nao_identificado;				
	}

	
$CreatePie = 0;
$Sort = 0;
// O terceiro parâmetro define a altura do gráfico a ser criado.
// O fator 20 é ideal para que as tabelas tenham o tamanho exato para a matriz enviada.
phPie($v_array, 700 , (count($v_array)+1) * 20, $CenterX, $CenterY, $DiameterX, $DiameterY, $MinDisplayPct, $DisplayColors, $BackgroundColor, $LineColor, true, 3,$CreatePie, $Sort);
?>
Esempio n. 4
0
    if (isset($demomode)) {
        srand(time());
        for ($i = 1; $i < 8; $i++) {
            $data['SampleData' . $i] = rand(0, 1000);
        }
    } else {
        $data = array('NO DATA' => 1);
    }
}
$width = isset($_REQUEST['width']) ? $_REQUEST['width'] : 500;
$height = isset($_REQUEST['height']) ? $_REQUEST['height'] : 300;
$CenterX = isset($_REQUEST['CenterX']) ? $_REQUEST['CenterX'] : round($width / 2);
$CenterY = isset($_REQUEST['CenterY']) ? $_REQUEST['CenterY'] : round($height / 2);
$DiameterX = isset($_REQUEST['DiameterX']) ? $_REQUEST['DiameterX'] : round($width * 0.95);
$DiameterY = isset($_REQUEST['DiameterY']) ? $_REQUEST['DiameterY'] : round($height * 0.95);
$MinDisplayPct = isset($_REQUEST['MinDisplayPct']) ? $_REQUEST['MinDisplayPct'] : 0.01;
$DisplayColors = isset($_REQUEST['DisplayColors']) ? $_REQUEST['DisplayColors'] : '3399FF;FF9933;FF0000;66CC00;FF33FF;00FFFF;9933FF;EECC33;33FF33';
$BackgroundColor = isset($_REQUEST['BackgroundColor']) ? $_REQUEST['BackgroundColor'] : 'CCCCCC';
$LineColor = isset($_REQUEST['LineColor']) ? $_REQUEST['LineColor'] : '000000';
$Legend = isset($_REQUEST['Legend']) ? (bool) $_REQUEST['Legend'] : TRUE;
$FontNumber = isset($_REQUEST['FontNumber']) ? $_REQUEST['FontNumber'] : 3;
$SortData = isset($_REQUEST['SortData']) ? (bool) $_REQUEST['SortData'] : TRUE;
if ($Legend) {
    $DiameterX = $DiameterY;
    $CenterX = $width - $CenterY;
}
if ($width > 8192 || $height > 8192 || $width <= 0 || $height <= 0) {
    die('Image size limited to 8192 x 8192 for safety reasons');
}
phPie($data, $width, $height, $CenterX, $CenterY, $DiameterX, $DiameterY, $MinDisplayPct, $DisplayColors, $BackgroundColor, $LineColor, $Legend, $FontNumber, $SortData);
				{
				mysql_data_seek($result, 0);
				while ($reg = mysql_fetch_array($result)) 
					{
  					if ($reg[0] == $num_dias) return $reg[1]; 
					}
				}

			function ha_mais_de($result, $num_dias) 
				{
   	    		$total_dias = 0;
				mysql_data_seek($result, 0);
				while ($reg = mysql_fetch_array($result)) 
					{
   					if ($reg[0] > $num_dias) 
						$total_dias = $total_dias + $reg[1]; 
					}
					return $total_dias;
				}

		$arr['Hoje................']	= qt_comp($result, 0); 
		$arr['Ontem...............'] 	= qt_comp($result, 1);  
		$arr['Há 2 dias...........'] 	= qt_comp($result, 2); 
		$arr['Há 3 dias...........'] 	= qt_comp($result, 3); 
		$arr['Há 4 dias...........'] 	= qt_comp($result, 4); 
		$arr['Há mais de 4 dias...'] 	= ha_mais_de($result, 4);				

		$CreatePie = 1;
		$Sort = 1;
		phPie($arr, 420 ,	159, $CenterX, $CenterY, $DiameterX, $DiameterY, $MinDisplayPct, $DisplayColors, $BackgroundColor, $LineColor, true, 3,$CreatePie, $Sort); 
?>