1 && $_REQUEST['cs_nivel_administracao'] <> 2 ? ' AND c.id_local = '.$_REQUEST['id_local']:''); if ($_SESSION['te_locais_secundarios']<>'' && $where <> '') { // Faço uma inserção de "(" para ajuste da lógica para consulta $where = str_replace('c.id_local = ','(c.id_local = ',$where); $where .= ' OR c.id_local in ('.$_SESSION['te_locais_secundarios'].')) '; } if ($_GET['in_detalhe']) $where = ' AND c.id_local = '.$_GET['in_detalhe']; $query = 'SELECT count(a.id_so) as qtd, b.te_desc_so FROM computadores a, so b, redes c WHERE (a.id_so = b.id_so OR a.te_so = b.te_so) AND a.te_nome_computador IS NOT NULL AND a.dt_hr_ult_acesso IS NOT NULL AND a.id_rede = c.id_rede '. $where . ' GROUP BY a.id_so ORDER BY a.id_so'; $result = mysql_query($query) or die($oTranslator->_('Ocorreu um erro no acesso a tabela %1 ou sua sessao expirou!',array('computadores, redes, so'))); while ($row_result = mysql_fetch_assoc($result)) { $v_row_result = str_pad($row_result['te_desc_so'],20,'.',STR_PAD_RIGHT); $arr[$v_row_result] = $row_result['qtd']; } $CreatePie = substr_count($te_exibe_graficos,'[so]'); $Sort = 1; $width = 550; $height = 250; phPie($arr, $width, $height, $CenterX, $CenterY, $DiameterX, $DiameterY, $MinDisplayPct, $DisplayColors, $BackgroundColor, $LineColor, true, 3,$CreatePie, $Sort); ?>