sobre o ocomon

1. sobre o ocomon

diego navarro leme
diegonavarroleme

(usa Outra)

Enviado em 18/10/2017 - 17:29h

Galera eu fiz a configuração do ocomon neste link:
http://suporte.portalrecco.com.br/

porem ele esta dando uns erros que nao sei resolver mais e somente 3 aquivos em 3 linhas alguem podem ajudar ?

os erros sao:

Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /home/portalre/suporte.portalrecco.com.br/recco/chamado/index.php on line 101

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/portalre/suporte.portalrecco.com.br/recco/chamado/index.php on line 102

Warning: mysqli_close() expects parameter 1 to be mysqli, null given in /home/portalre/suporte.portalrecco.com.br/recco/chamado/includes/classes/conecta.class.php on line 72

o meu codigo esta dessa formaa parte do index.php

<?php
/* Copyright 2005 Flávio Ribeiro

This file is part of OCOMON.

OCOMON 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.

OCOMON 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 Foobar; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

is_file( "./includes/config.inc.php" )
or die( "Você precisa configurar o arquivo config.inc.php em OCOMON/INCLUDES/para iniciar o uso do OCOMON!<br>Leia o arquivo <a href='LEIAME.txt'>LEIAME.TXT</a> para obter as principais informações sobre a instalação do OCOMON!".
"<br><br>You have to configure the config.inc.php file in OCOMON/INCLUDES/ to start using Ocomon!<br>Read the file <a href='README.txt'>README.TXT</a>to get the main informations about the Ocomon Installation!" );
//print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
//print "<!DOCTYPE html>";
//print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
//print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
//print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">";

session_start();
//session_destroy();
if (!isset($_SESSION['s_language'])) $_SESSION['s_language']= "pt_BR.php";

if (!isset($_SESSION['s_usuario'])) $_SESSION['s_usuario']= "";
if (!isset($_SESSION['s_logado'])) $_SESSION['s_logado']= "";
if (!isset($_SESSION['s_nivel'])) $_SESSION['s_nivel']= "";

/*
Tentando arrumar a porcaria do IE

*/
$useragent = $_SERVER['HTTP_USER_AGENT'];

if (preg_match('|MSIE ([0-9].[0-9]{1,2})|',$useragent,$matched)) {
$browser_version=$matched[1];
$browser = 'IE';
} elseif (preg_match( '|Opera/([0-9].[0-9]{1,2})|',$useragent,$matched)) {
$browser_version=$matched[1];
$browser = 'Opera';
} elseif(preg_match('|Firefox/([0-9\.]+)|',$useragent,$matched)) {
$browser_version=$matched[1];
$browser = 'Firefox';
} elseif(preg_match('|Chrome/([0-9\.]+)|',$useragent,$matched)) {
$browser_version=$matched[1];
$browser = 'Chrome';
} elseif(preg_match('|Safari/([0-9\.]+)|',$useragent,$matched)) {
$browser_version=$matched[1];
$browser = 'Safari';
} else {
// browser not recognized!
$browser_version = 0;
$browser= 'other';
}

if ($browser == 'IE' && $browser_version != '6.0'){

//print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
//print "<!DOCTYPE html>";
//print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
//print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">";
//print "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE8\">";
} elseif ($browser == 'IE' && $browser_version == '6.0'){
print "SEU BROWSER NÃO DÁ SUPORTE ÀS TECNOLOGIAS UTILIZADAS POR ESSA FERRAMENTA.";
}


/*
FIM
*/

include ("PATHS.php");
//include ("".$includesPath."var_sessao.php");
include ("includes/functions/funcoes.inc");
include ("includes/javascript/funcoes.js");
include ("includes/queries/queries.php");
include ("".$includesPath."config.inc.php");
//require_once ("includes/languages/".LANGUAGE."");
include ("".$includesPath."versao.php");

include("includes/classes/conecta.class.php");
$conec = new conexao;
$conec->conecta('mysqli') ;


if (is_file("./".$iconPath."favicon.ico")) {
print "<link rel='shortcut icon' href='./".$iconPath."favicon.ico'>";
}

$qryLang = "SELECT * FROM config";
$execLang = mysqli_query($GLOBALS["___mysql_ston"], $qryLang);
$rowLang = mysqli_fetch_array($execLang);
if (!isset($_SESSION['s_language'])) $_SESSION['s_language']= $rowLang['conf_language'];


$uLogado = $_SESSION['s_usuario'];
if (empty($uLogado)) {
$USER_TYPE = TRANS('MNS_OPERADOR');//$TRANS['MNS_OPERADOR'];
$uLogado = TRANS('MNS_NAO_LOGADO'); //$TRANS['MNS_NAO_LOGADO'];
$logInfo = "<font class='topo'>".TRANS('MNS_LOGON')."</font>"; //$TRANS['MNS_LOGON']
$hnt = TRANS('HNT_LOGON');
} else {
if ($_SESSION['s_nivel'] < 3) {
$USER_TYPE = TRANS('MNS_OPERADOR');
} else
$USER_TYPE = TRANS('MNS_USUARIO');
$logInfo = "<font color='red'>".TRANS('MNS_LOGOFF')."</font>";
$hnt = TRANS('HNT_LOGOFF');
}
$marca = "HOME";


print "<html>";
print "<head>";



print "<title>SUPORTE RECCO</title>";
print "<link rel='stylesheet' href='includes/css/estilos.css.php'>"; //type='text/css'
print "<!--[if lte IE 7]>
<style>
#menuwrapper, #menubar ul a
{
height: 1%;
}
a:active {
width: auto;
border-color: #fff;
}

</style>
<![endif]-->
";
print "</head>
<body onLoad=\"setHeight('centro2');\">";

print " <table width='100%' border='0px' id='geral'><tr><td>";

//by LRG
print "<table class='topo' border='0' id='cabecalho'>
<tr>
<td width='100%'><img src='MAIN_LOGO.png' align='middle' style=\"vertical-align:middle;\"></td>
</tr>
</table>";
print "<table class='menu'><tr>";
//end
if (empty($_SESSION['s_permissoes'])&& $_SESSION['s_nivel']!=1){
print "<td width='5%'></td>";
print "<td width='7%'></td>";
print "<td width='7%'></td>";
print "<td width='5%' ></td>";
print "<td width='76%'></td>";
$conec->desconecta('mysql');
} else{

// include("includes/classes/conecta.class.php");
// $conec = new conexao;
// $conec->conecta('mysql') ;

$qryconf = $QRY["useropencall"];
$execconf = mysql_query($GLOBALS["___mysql_ston"], $qryconf) or die('Não foi possível ler as informações de configuração do sistema!');
$rowconf = mysql_fetch_array($execconf);

$qryStyle = "SELECT * FROM temas t, uthemes u WHERE u.uth_uid = ".$_SESSION['s_uid']." and t.tm_id = u.uth_thid";
$execStyle = mysql_query($GLOBALS["___mysql_ston"], $qryStyle) or die('ERRO NA TENTATIVA DE RECUPERAR AS INFORMAÇÕES DE ESTILOS!<BR>'.$qryStyle);
$rowStyle = mysql_fetch_array($execStyle);
$regs = mysql_num_rows($execStyle);
if ($regs==0){ //SE NÃO ENCONTROU TEMA ESPECÍFICO PARA O USUÁRIO
unset ($rowStyle);
$qryStyle = "SELECT * FROM styles";
$execStyle = mysql_query($GLOBALS["___mysql_ston"], $qryStyle);
$rowStyle = mysql_fetch_array($execStyle);
}

//LRg
//print "<td id='button_hid' width='5%'><input type='button' name='botao' onclick='mostra_menu()'><td>";
//print "<td id='HOME' width='5%' class='barra'><a onMouseOver=\"destaca('HOME')\" onMouseOut=\"libera('HOME')\" onclick=\"loadIframe('menu.php?sis=h','menu','home.php', 'centro',3,'HOME')\" >".TRANS('MNS_HOME')."</a></td>";




$sis="";
$sisPath="";
$sistem="home.php";
$marca = "HOME";

//MENU OPERADOR
if (($_SESSION['s_ocomon']==1) && !isIn($_SESSION['s_area'],$rowconf['conf_ownarea_2'])) {
//print "<td id='OCOMON' width='7%' class='barra'><a onMouseOver=\"destaca('OCOMON')\" onMouseOut=\"libera('OCOMON')\" onclick=\"loadIframe('menu.php?sis=o','menu','".$ocoDirPath."abertura.php','centro',2,'OCOMON')\">".TRANS('MNS_OCORRENCIAS')."</a></td>";

//TESTE DE NOVO MENU - INICIO
//TESTE DE NOVO MENU - INICIO
print "<td>";
print "<div id='menuwrapper'>
<ul id='menubar'>
<li class='barra_li'><a class='trigger' href='#'><img src='".$iconPath."gohome.png' /> ".TRANS('MNS_HOME')."</a>
<ul>
<li style='width: 187px;'><a target='centro' href='home.php'><img src='".$iconPath."gohome.png'/> ".TRANS('MNL_INICIO')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$ocoDirPath."abertura_user.php?action=listall'><img src='".$iconPath."search.png'/> ".TRANS('MNL_MEUS')."</a></li>

</ul>
</li>";

print "
<li class='barra_li'>
<a class='trigger' href='#'>
<span><img src='".$iconPath."fone.png'style='margin: 2px 1px -2px';/></span> ".TRANS('MNS_OCORRENCIAS')."</a>
<ul>
<li style='width: 187px;'><a target='centro' href='".$ocoDirPath."abertura.php'><img src='".$iconPath."gohome.png'/> ".TRANS('MNL_INICIO')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$ocoDirPath."incluir.php'><img src='".$iconPath."fone.png'/> ".TRANS('MNL_ABRIR')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$ocoDirPath."consultar.php'><img src='".$iconPath."consulta.png'/> ".TRANS('MNL_CONSULTAR')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$ocoDirPath."alterar.php'><img src='".$iconPath."search.png'/> ".TRANS('MNL_BUSCA_RAP')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$ocoDirPath."consulta_solucoes.php'><img src='".$iconPath."solucoes2.png'/> ".TRANS('MNL_SOLUCOES')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$ocoDirPath."emprestimos.php'><img src='".$iconPath."emprestimos.png'/> ".TRANS('MNL_EMPRESTIMOS')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$ocoDirPath."avisos.php'><img src='".$iconPath."mural.png'/> ".TRANS('MNL_MURAL')."</a></li>
<li><a class='trigger_r' href='#'><img src='".$iconPath."tree_folder_open.png'/> ".TRANS('MNL_RELATORIOS')."</a>
<ul>
<li style='width: 187px;'><a target='centro' href='".$ocoDirPath."relatorio_slas_2.php'><img src='".$iconPath."fone.png'/> ".TRANS('MNL_SLA')."</a></li>
<span><li style='width: 187px;'><a target='centro' href='".$ocoDirPath."relatorios.php'><img src='".$iconPath."spread.png' style='margin: 2px 1px -2px';/></span> ".TRANS('MNL_DIVERSOS')."</a></li>
</ul>
</li>
</ul>
</li>";

//// FIM

if ($sis=="") $sis="sis=o";
$sisPath = $ocoDirPath;
$sistem = "abertura.php";
$marca = "OCOMON";

//USUARIO SIMPLES
} else

if (($_SESSION['s_ocomon']==1) && isIn($_SESSION['s_area'], $rowconf['conf_ownarea_2'])) {

//TESTE DE NOVO MENU - INICIO
print "
<div id='menuwrapper'>
<ul id='menubar'>
<li class='barra_li'><a target='centro' href='".$ocoDirPath."incluir.php'><img src='".$iconPath."fone.png'/> ".TRANS('MNL_ABRIR')."</a></li>
<li class='barra_li'><a target='centro' href='".$ocoDirPath."abertura_user.php?action=listall'><img src='".$iconPath."consulta.png'/> ".TRANS('MNL_MEUS')."</a></li>
<li class='barra_li'><a target='centro' href='".$invDirPath."altera_senha.php'><img src='".$iconPath."password.png'/> ".TRANS('MNL_SENHA')."</a></li>
</ul>

";

/*print "
<br class='clearit'>
</div></td>";
*/
// FIM
$sis="sis=s";
$sisPath = $ocoDirPath;
$sistem = "abertura_user.php?action=listall";
$marca = "OCOMON";
} else {
print "<td width='7%' STYLE='{border-right: thin solid #C7C8C6; color:#C7C8C6}'><img src='".$iconPath."fone.png'/> ".TRANS('MNS_OCORRENCIAS')."</td>";
//FIM
}
if ($_SESSION['s_invmon']==1){

print "
<li class='barra_li'><a class='trigger' href='#'><img src='".$iconPath."computador.png'/> ".TRANS('MNS_INVENTARIO')." </a>
<ul>
<li style='width: 187px;'><a target='centro' title='Tela inicial do sistema' href='".$invDirPath."abertura.php'><img src='".$iconPath."gohome.png'/> ".TRANS('MNL_INICIO')."</a></li>
<li style='width: 187px;'><a class='trigger_r' href='#'><img src='".$iconPath."tree_folder_open.png'/> ".TRANS('MNL_CAD')."</a>
<ul>
<li style='width: 187px;'><a target='centro' href='".$invDirPath."incluir_computador.php'><img src='".$iconPath."computador.png'/> ".TRANS('MNL_CAD_EQUIP')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$invDirPath."documentos.php?action=incluir&cellStyle=true'><img src='".$iconPath."contents.png'/> ".TRANS('MNL_CAD_DOC')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$invDirPath."estoque.php?action=incluir&cellStyle=true'><img src='".$iconPath."mouse.png'/> ".TRANS('MNL_CAD_ESTOQUE')."</a></li>
</ul>
</li>
<li style='width: 187px;'><a class='trigger_r' href='#'><img src='".$iconPath."tree_folder_open.png'/> ".TRANS('MNL_VIS')."</a>
<ul>
<li style='width: 187px;'><a target='centro' href='".$invDirPath."mostra_consulta_comp.php'><img src='".$iconPath."computador.png'/> ".TRANS('MNL_VIS_EQUIP')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$invDirPath."documentos.php'><img src='".$iconPath."contents.png'/> ".TRANS('MNL_VIS_DOC')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$invDirPath."estoque.php'><img src='".$iconPath."mouse.png'/> ".TRANS('MNL_VIS_ESTOQUE')."</a></li>
</ul>
</li>
<li style='width: 187px;'><a class='trigger_r' href='#'><img src='".$iconPath."tree_folder_open.png'/> ".TRANS('MNL_CON')."</a>
<ul>
<li style='width: 187px;'><a target='centro' href='".$invDirPath."consulta_inv.php'><img src='".$iconPath."search.png'/> ".TRANS('MNL_CON_RAP')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$invDirPath."consulta_comp.php'><img src='".$iconPath."consulta.png'/> ".TRANS('MNL_CON_ESP')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$invDirPath."estoque.php?action=search&cellStyle=true'><img src='".$iconPath."mouse.png'/> ".TRANS('MNL_VIS_ESTOQUE')."</a></li>
<li style='width: 187px;'><a class='trigger_r' href='#'><img src='".$iconPath."tree_folder_open.png'/> ".TRANS('MNL_CON_HIST')."</a>
<ul>
<li style='width: 187px;'><a target='centro' href='".$invDirPath."consulta_hist_inv.php?from_menu=1'><img src='".$iconPath."tag.png'/> ".TRANS('MNL_CON_HIST_TAG')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$invDirPath."consulta_hist_local.php'><img src='".$iconPath."tag.png'/> ".TRANS('MNL_CON_HIST_LOCAL')."</a></li>
</ul>
</li>
</ul>
</li>
<li style='width: 187px;'><a class='trigger_r' href='#'><img src='".$iconPath."tree_folder_open.png'/> ".TRANS('MNL_PREVENTIVA')."</a>
<ul style='width: 210px;'>
<li style='width: 210px;'><a target='centro' href='".$invDirPath."prev_com_ch.php' style='width: 205px;'><img src='".$iconPath."search.png'/> ".TRANS('MNL_PREVENTIVA_COM')."</a></li>
<li style='width: 210px;'><a target='centro' href='".$invDirPath."prev_sem_ch.php'><img src='".$iconPath."search.png'/> ".TRANS('MNL_PREVENTIVA_SEM')."</a></li>
</ul>
</li>
<li style='width: 187px;'><a target='centro' href='".$invDirPath."relatorios.php'><img src='".$iconPath."spread.png'/> ".TRANS('MNL_STAT_RELAT')."</a></li>
</ul>
</li>";
//// FIM

//print "<td id='INVMON' width='7%' class='barra'><a onMouseOver=\"destaca('INVMON')\" onMouseOut=\"libera('INVMON')\" onclick=\"loadIframe('menu.php?sis=i','menu','".$invDirPath."abertura.php','centro',2,'INVMON')\">".TRANS('MNS_INVENTARIO')."</a></td>"; //abertura.php - ".$invDirPath."".$invHome."
if ($sis=="") $sis="sis=i";
if ($sisPath=="") $sisPath=$invDirPath;
$sistem = "abertura.php";
if ($marca=="") $marca = "INVMON";
//$home = "home=true";
} else {
/*print "
<br class='clearit'>
</div></td>";
*/
}
if ($_SESSION['s_nivel']==1 || (isset($_SESSION['s_area_admin']) && $_SESSION['s_area_admin'] == '1')) {

//TESTE DE NOVO MENU - INICIO
print "
<li class='barra_li'><a class='trigger' href='#'><img src='".$iconPath."kcontrol.png'/> ".TRANS('MNS_ADMIN')."</a>
<ul>
<li style='width: 187px;'><a class='trigger_r' href='#'><img src='".$iconPath."tree_folder_open.png'/> ".TRANS('MNL_CONF')."</a>
<ul style='width: 205px;'>
<li><a target='centro' href='".$admDirPath."configGeral.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_CONF_GERAL')."</a></li>
<li><a target='centro' href='".$admDirPath."configuserscreen.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_CONF_ABERTURA')."</a></li>
<li><a target='centro' href='".$admDirPath."screenprofiles.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_SCREEN_PROFILE')."</a></li>
<li><a target='centro' href='".$admDirPath."configmail.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_CONF_SMTP')."</a></li>
<li><a target='centro' href='".$admDirPath."configmsgs.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_CONF_MSG')."</a></li>
<li><a target='centro' href='".$admDirPath."aparencia.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_CONF_APARENCIA')."</a></li>
</ul>
</li>
<li style='width: 187px;'><a class='trigger_r' href='#'><img src='".$iconPath."tree_folder_open.png'/> ".TRANS('MNS_OCORRENCIAS')."</a>
<ul style='width: 205px;'>
<li><a target='centro' href='".$admDirPath."sistemas.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_AREAS')."</a></li>
<li><a target='centro' href='".$admDirPath."sistemas_conf_abertura.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_AREAS')."-".TRANS('TTL_CONFIG')."</a></li>
<li><a target='centro' href='".$admDirPath."problemas.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_PROBLEMAS')."</a></li>
<li><a target='centro' href='".$admDirPath."status.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_STATUS')."</a></li>
<li><a target='centro' href='".$admDirPath."prioridades.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_PRIORIDADES')."</a></li>
<li><a target='centro' href='".$admDirPath."prioridades_atendimento.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_PRIORIDADES_ATEND')."</a></li>
<li><a target='centro' href='".$admDirPath."feriados.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_FERIADOS')."</a></li>
<li><a target='centro' href='".$admDirPath."tipo_solucoes.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_SOLUCOES')."</a></li>
<li><a target='centro' href='".$admDirPath."scripts.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_SCRIPTS')."</a></li>
<li><a target='centro' href='".$ocoDirPath."ocorrencias.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNS_OCORRENCIAS')."</a></li>
<li><a target='centro' href='".$admDirPath."mail_templates.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_MAIL_TEMPLATES')."</a></li>
<li><a target='centro' href='".$admDirPath."mail_distribution_lists.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_DIST_LISTS')."</a></li>
</ul>
</li>
<li style='width: 187px;'><a class='trigger_r' href='#'><img src='".$iconPath."tree_folder_open.png'/> ".TRANS('MNS_INVENTARIO')."</a>
<ul style='width: 205px;'>
<li><a target='centro' href='".$admDirPath."tipo_equipamentos.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_EQUIPAMENTOS')."</a></li>
<li><a target='centro' href='".$admDirPath."tipo_componentes.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_COMPONENTES')."</a></li>
<li><a target='centro' href='".$invDirPath."fabricantes.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_FABRICANTES')."</a></li>
<li><a target='centro' href='".$invDirPath."fornecedores.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_FORNECEDORES')."</a></li>
<li><a target='centro' href='".$admDirPath."situacoes.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_SITUACOES')."</a></li>
<li><a target='centro' href='".$invDirPath."tempo_garantia.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_GARANTIA')."</a></li>
<li><a target='centro' href='".$invDirPath."softwares.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_SW')."</a></li>
<li><a target='centro' href='".$admDirPath."preventiva.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_PREVENTIVA')."</a></li>
<li><a target='centro' href='".$admDirPath."maq_importadas.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_CONF_MAQIMPORT')."</a></li>
</ul>
</li>
<li style='width: 187px;'><a target='centro' href='".$admDirPath."usuarios.php'><img src='".$iconPath."personal.png'/> ".TRANS('MNL_USUARIOS')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$admDirPath."locais.php'><img src='".$iconPath."browser.png'/> ".TRANS('MNL_LOCAIS')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$admDirPath."unidades.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_UNIDADES')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$admDirPath."ccustos.php'><img src='".$iconPath."tree_leaf.png'/> ".TRANS('MNL_CC')."</a></li>
<li style='width: 187px;'><a target='centro' href='".$admDirPath."permissoes.php'><img src='".$iconPath."password.png'/> ".TRANS('MNL_PERMISSOES')."</a></li>
</ul>
</li>
</ul>
</ul>

";
//// FIM


//print "<td id='ADMIN' width='5%' class='barra'><a onMouseOver=\"destaca('ADMIN')\" onMouseOut=\"libera('ADMIN')\" onclick=\"loadIframe('menu.php?sis=a','menu','','','2','ADMIN')\">".TRANS('MNS_ADMIN')."</a></td>";
if ($sis=="") $sis="sis=a";
if ($sisPath=="") $sisPath="";
if ($sistem=="") $sistem = "menu.php";
if ($marca=="")$marca = "ADMIN";
$home = "home=true";
} else {
/*print "
<br class='clearit'>
</div></td>";
*/
print "</ul></ul>";
}

//FIM
//print "<td width='72%'></td>";
print "<ul id='menubar2'>
<li><a class='trigger' href='#'><img src='".$iconPath."personal.png' /> ".TRANS('usuario').": <b>".$uLogado."</b></a>
<ul>
<li><a target='centro' href='".$ocoDirPath."user_theme.php'><img src='".$iconPath."colors.png'/> ".TRANS('MNL_THEME')."</a></li>
<li><a target='centro' href='".$invDirPath."altera_senha.php'><img src='".$iconPath."password.png'/> ".TRANS('MNL_SENHA')."</a></li>
<li><a target='centro' href='".$ocoDirPath."user_lang.php'><img src='".$iconPath."brasil-flag-icon.png'/> ".TRANS('MNL_LANG')."</a></li>
<li><a href='".$commonPath."logout.php'><img src='".$iconPath."exit.png'/> Sair </a></li>
</ul>
</li>
</ul>

<br class='clearit'>
</div></td>";
$conec->desconecta('mysql');
}
print "</tr></table>";

print "</td></tr>";



if ($_SESSION['s_logado']){

//BLOCO PARA RECARREGAR A PÁGINA NO MÓDULO ADMIN QUANDO FOR SELECIONADO NOVO TEMA
if (isset($_GET['LOAD']) && $_GET['LOAD'] == 'ADMIN'){
$PARAM = "&LOAD=ADMIN";
$marca = "ADMIN";
}else
$PARAM = "";

print "<tr>";

print "<td style=\"width:100%;\" id='centro2'><iframe class='frm_centro' src='".$sisPath."".$sistem."' name='centro' align='center' width='100%' height='100%' frameborder='0' STYLE='{border-bottom: thin solid #999999;}'></iframe></td>";

print "</tr>";

} else {

//Formulario de Login
print "<tr><td >";
//print "<form name='logar' method='post' action='".$commonPath."login.php?=".session_id()."' onSubmit=\"return valida()\">";
print "<form name='logar' method='post' action='".$commonPath."login.php?".session_id()."' onSubmit=\"return valida()\">";

print "
<div class='div_login' style='margin-top: 90px;'>";


if (isset($_GET['inv']) ) {
if ($_GET['inv']=="1") {

print "<div style='position: absolute; width:203px; height:63px; background-image:url(includes/imgs/err_bg.png);background-repeat: no-repeat; padding:15px;margin-top:50px;margin-left:320px;'>
<font color='white'>".TRANS('ERR_LOGON')."! <br> AUTH_TYPE: ".AUTH_TYPE."</font>
</div>";

}
}

if (isset($_GET['usu']) ) {
$typedUser = $_GET['usu'];

} else {
$typedUser = "";
}

print "<div style='margin:0 auto; width:180px; padding:20px;'>
<div style='height:10px;font-size:16px;font-weight:bold;color:#ccc;margin-top:5px;'></div>
<div style='height:120px;'>";
print " <label id='label_user' class='input_login' for='idLogin' style='display:block;'>".TRANS('MNS_USUARIO')."</label><input class='input_l2' type='text' name='login' value='".$typedUser."' id='idLogin' tabindex='1' \">".
" <br><br>".
" <label id='label_pass' class='input_login' for='idSenha' style='display:block;'>".TRANS('MNS_SENHA')."</label><input class='input_l2' type='password' name='password' id='idSenha' tabindex='2' \">
</div>";

print " <div style='height:50px;'>
<center><br><input type='submit' class='blogin' value='".TRANS('cx_login')."' tabindex='3'></center>
</div>";


print "</div>";
print "</form>";

print "</td></tr>";

}

print "<tr><td>";
print "<div style='position:fixed;width:100%;bottom:0px;background-color:#FFFFFF;'>

</div>";
print "</td></tr>";

print "</table>";
print "</body></html>";
?>
<script type="text/javascript">
<!--
var GLArray = new Array();
function loadIframe(url1,iframeName1, url2,iframeName2,ACCESS,ID) {

var nivel_user = '<?php print $_SESSION['s_nivel'];?>';
var HOM = document.getElementById('HOME');
var OCO = document.getElementById('OCOMON');
var INV = document.getElementById('INVMON');
var ADM = document.getElementById('ADMIN');

if (nivel_user <= ACCESS) {

marca(ID);
if (HOM != null)
if (ID != "HOME") {
HOM.style.background ="";
HOM.style.color ="";
}
if (OCO != null)
if (ID != "OCOMON") {
OCO.style.background ="";
OCO.style.color ="";
}
if (INV != null)
if (ID != "INVMON") {
INV.style.background ="";
INV.style.color ="";
}
if (ADM != null)
if (ID != "ADMIN") {
ADM.style.background ="";
ADM.style.color ="";
}

if (iframeName2!=""){
if ((window.frames[iframeName1]) && (window.frames[iframeName2])) {
window.frames[iframeName1].location = url1;
//window.frames[iframeName2].location = url2;
return false;
}
} else
if (window.frames[iframeName1]) {
window.frames[iframeName1].location = url1;
return false;
}

else return true;
} else {
window.alert('Acesso indisponível!');
return true;
}
}

function popup(pagina) { //Exibe uma janela popUP
x = window.open(pagina,'Ocomon','width=800,height=600,scrollbars=yes,statusbar=no,resizable=no');
//x.moveTo(10,10);
return false
}

function showPopup(id){
var obj = document.getElementById(id);
if (obj.value==2) {
return popup('sobre.php');
}

if (obj.value==4) {
return popup('http://sourceforge.net/apps/mediawiki/ocomonphp/index.php?title=Manual');
}
return false;
}

function setHeight(id){

var obj = document.getElementById(id);
if (obj != null) {
obj.style.height = screen.availHeight - 220 + 'px';
marca('<?php print $marca;?>');
} else {
document.logar.login.focus();
}
return true;
}


function mini_popup(pagina) { //Exibe uma janela popUP
x = window.open(pagina,'_blank','dependent=yes,width=400,height=260,scrollbars=yes,statusbar=no,resizable=yes');
//x.moveTo(window.parent.screenX+50, window.parent.screenY+50);

return false
}

function destaca(id){
var obj = document.getElementById(id);
var valor = '<?php isset($rowStyle['tm_barra_fundo_destaque'])? print $rowStyle['tm_barra_fundo_destaque']: print ""?>';
if (valor!=''){
if (obj!=null) {
obj.style.background = valor;
}
}
}

function libera(id){
if ( verificaArray('', id) == false ) {
var obj = document.getElementById(id);
if (obj!=null) {
obj.style.background = ''; //#675E66
//obj.className = "released";
}
}
}

function marca(id){
var obj = document.getElementById(id);
verificaArray('guarda', id);

var valor = '<?php isset($rowStyle['tm_barra_fundo_destaque'])? print $rowStyle['tm_barra_fundo_destaque']: print ""?>';
var valor2 = '<?php isset ($rowStyle['tm_barra_fonte_destaque'])? print $rowStyle['tm_barra_fonte_destaque']: print ""?>';
if (valor != '' && valor2 != '') {
if (obj!=null) {
obj.style.background = valor; //'#666666'
obj.style.color = valor2;
//obj.className = "marked";
}
}
verificaArray('libera',id);
}

function verificaArray(acao, id) {
var i;
var tamArray = GLArray.length;
var existe = false;

for(i=0; i<tamArray; i++) {
if ( GLArray[i] == id ) {
existe = true;
break;
}
}

if ( (acao == 'guarda') && (existe==false) ) { //
GLArray[tamArray] = id;
} else if ( (acao == 'libera') ) {
//-----------------------------
//-----------------------------
var temp = new Array(tamArray-1); //-1
var pos = 0;
for(i=0; i<tamArray; i++) {
if ( GLArray[i] == id ) {
temp[pos] = GLArray[i];
pos++;
}
}

GLArray = new Array();
var pos = temp.length;
for(i=0; i<pos; i++) {
GLArray[i] = temp[i];
}
}

return existe;
}

function valida(){

var ok = validaForm('idLogin','ALFAFULL','Usuário',1)
if (ok) var ok = validaForm('idSenha','ALFAFULL','Senha',1);

return ok;
}

function mostra_menu() {
var obj = document.getElementById('menu_centro');
if (obj.height == 0 || obj.width == 0) {obj.height = '100%'; obj.width = '100%';}
else { obj.height = 0; obj.width = 0;}
var obj1 = document.getElementById('centro');
if (obj1.width == 0) {obj1.width = '15%';}
else {obj1.width = 0;}
}


-->
</script>
<!--
var obj = document.getElementById('tabela_ficha');
var objOpcoes = document.getElementById('opcoesSel');
var valor = objOpcoes.style.height;
valor = valor.replace('px', '');
obj.style.height = screen.availHeight - valor - 300;
var form = document.forms[0];
form.acao.value = 'EXIBE_FICHA';
form.target = 'ficha';
-->


PARTE DO CODIGO QUE FAZ A COMUNICACAO.
<?php

/* Copyright 2005 Flávio Ribeiro

This file is part of OCOMON.

OCOMON 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.

OCOMON 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 Foobar; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/


class conexao {
var $con;
var $db;

var $LDAP_HOST;
var $LDAP_DOMAIN;
var $LDAP_DN;
var $LDAP_PASSWORD;
var $DS;
var $BIND;
var $U_BIND;
var $Upass; //senha digitada pelo usuario
var $LDAP_INFO;
var $UID;
var $U_UID;
var $U_DN;
var $U_NAME;
var $U_PASSWD;
var $U_SALT;
var $SEARCH;
var $TOTAL;
var $ERROR;
//var $PREFIX;





function conecta($BANCO){
if (strtoupper($BANCO) =='mysqli') {

$this->con=($GLOBALS["___mysql_ston"] = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASSWD))or die(mysqli_error($GLOBALS["___mysql_ston"]));
$this->db=mysqli_select_db($this->con, constant('portalre_ocomon_rc6'));
if ($this->con == 0){
$retorno = "ERRO DE CONEXÃO - SERVIDOR!<br>";
}
else if ($this->db == 0){
$retorno = "ERRO DE CONEXÃO - BANCO DE DADOS!<br>";
} else {
$retorno = "";
}

return $retorno;

}

}

function desconecta($BANCO){
((is_null($___mysqli_res = mysqli_close($this->con))) ? false : $___mysqli_res);
}
//-----------------------------------------------------------------------------------//

function set_ldapHost($HOST){
$this->LDAP_HOST = $HOST;
}

function set_ldapDomain($DOMAIN){
$this->LDAP_DOMAIN = $DOMAIN;
}

function set_ldapDN($DN){
$this->LDAP_DN = $DN;
}

function set_ldapPasswd($PASSWD){
$this->LDAP_PASSWORD= $PASSWD;
}

function set_ldapUID ($USER){
$this->UID = $USER;
}
function set_Upass ($senha){
$this->Upass = $senha;
}


function set_prefix($prefix = "{crypt}"){
$this->PREFIX = $prefix;
}


function get_ldapHost(){
print $this->LDAP_HOST;
}

function get_ldapDomain(){
print $this->LDAP_DOMAIN;
}
function get_ldapDN(){
print $this->LDAP_DN;
}
function get_ldapPasswd(){
print $this->LDAP_PASSWORD;
}




function conLDAP ($host,$domain,$dn,$passwd){

$this->set_ldapHost($host);
$this->set_ldapDomain($domain);
$this->set_ldapDN($dn);
$this->set_ldapPasswd($passwd);
$this->DS = ldap_connect($this->LDAP_HOST);
if ($this->DS) {
$this->BIND = @ldap_bind($this->DS, $this->LDAP_DN, $this->LDAP_PASSWORD);
return true;
} else {
$this->ERROR = "Não foi possível conectar ao servidor LDAP!";
print $this->ERROR;
return false;
}
}


function userLdap($uid,$pass){//Tem que estar conectado ao servidor LDAP

$this->set_ldapUID($uid);
$this->set_Upass($pass);
$this->SEARCH = ldap_search($this->DS, $this->LDAP_DOMAIN, "uid=".$this->UID."");
$this->TOTAL = ldap_count_entries ($this->DS,$this->SEARCH);
$this->LDAP_INFO = ldap_get_entries($this->DS, $this->SEARCH);

$this->U_NAME = $this->LDAP_INFO[0]["cn"][0];
$this->U_UID = $this->LDAP_INFO[0]["uid"][0];
$this->U_DN = $this->LDAP_INFO[0]["dn"];
$this->U_PASSWD = $this->LDAP_INFO[0]["userpassword"][0];

$this->U_BIND =@ldap_bind($this->DS, $this->U_DN, $this->Upass);

if ($this->U_BIND && $this->U_PASSWD && !empty($pass)) {
return true;
} else
return false;
}


function desconLDAP (){
ldap_close ($this->DS);
}

}



?>

PARTE DA CONFIGURACAO DA COMINICACAO DO OCOMON

<?php

// arquivo: config.inc.php

// configurar de acordo com as suas necessidades

// Configurações vitais

//Usuario do banco
define ( "SQL_USER", "portalre"); //NOME DO USUÁRIO PARA ACESSAR A BASE DO OCOMON - ESSE USUÁRIO É CRIADO AUTOMATICAMENTE NA INSTALACAO DO SISTEMA!!

//Senha do banco
define ( "SQL_PASSWD", "@@Recco2016");//ESSA SENHA É A SENHA PADRAO CRIADA NA INSTALACAO DO SISTEMA. É RECOMENDÁVEL A ALTERACAO DA MESMA NO mysql.
//Servidor do banco
define ( "SQL_SERVER", "192.163.241.205"); //SE O BANCO DE DADOS ESTIVER EM UM SERVIDOR DIFERENTE DO SERVIDOR WEB DEVE-SE ALTERAR O VALOR "localhost"
//Nome do banco
define ( "SQL_DB", "portalre_ocomon_rc6");//NOME DO BANCO DE DADOS. O PADRÃO DESSA VERSÃO É: ocomon_rc6


define ( "DB_CCUSTO","ocomon_rc6"); //Base de dados onde são buscados os Centros de Custos, o padrão dessa versão é: ocomon_rc6.
define ( "TB_CCUSTO","CCUSTO"); //Tabela de CEntro de custos dentro da base de dados - padrão: CCUSTO
define ( "CCUSTO_ID","codigo");//Chave primária da tabela de centros de custo
define ( "CCUSTO_DESC","descricao"); //Campo referente à descrição do Centro de Custo
define ( "CCUSTO_COD","codccusto"); //Campo referente ao código de Centro de Custo


define ("INST_TERCEIRA", "-1"); //Define que UNIDADES não devem aparecer na estatística geral da tela de abertura - o código deve ser extraido da tabela: INSTITUICOES.
//Por padrão todas as unidades aparecem na estatística inicial.

define ( "LOG_PATH", "../../logs/logs.txt"); //Esse diretório deve ter permissão de escrita pra gravar os logs.
define ( "LOGO_PATH", "../../includes/logos");
define ( "ICONS_PATH", "../../includes/icons/");

define ( "HELP_ICON", "".ICONS_PATH."solucoes2.png");
define ( "HELP_PATH", "../../includes/help/");

define ( "LANGUAGE", "pt_BR.php");
//define ( "LANGUAGE", "en.php");


//Define o tipo de autenticação do sistema , por padrão a altenticação é feita na tabela de usuários do próprio OCOMON, porém isso pode ser feito através de um serviço LDAP.
//INICIALMENTE É NECESSÁRIO DEIXAR A AUTENTICAÇÃO LOCAL PARA QUE SEJA POSSÍVEL ACESSAR O SISTEMA PELA PRIMEIRA VEZ E CRIAR OS USUÁRIOS.
define ( "AUTH_TYPE" , "SYSTEM"); //DEFAULT
#define ( "AUTH_TYPE", "LDAP"); // ALTERNATIVE

/* Variáveis para conexão LDAP DEVEM SER CONFIGURADAS EM CASO DE AUTH_TYPE==LDAP DE ACORDO COM AS CONFIGURAÇÕES DO SEU SERVIDOR LDAP*/
define ( "LDAP_HOST", "localhost"); //IP do servidor LDAP
define ( "LDAP_DOMAIN", "ou=People,dc=yourdomain,dc=edu,dc=br");
define ( "LDAP_DOMAIN_SEC", "ou=People,dc=yourdomain1,dc=yourdomain2,dc=edu,dc=br"); //Segundo domínio LDAP
define ( "LDAP_DN", "cn=admin,dc=yourdomain,dc=edu,dc=br");
define ( "LDAP_PASSWORD", "");


//CARGA HORÁRIA DE CADA AREA DE ATENDIMENTO - OS PARÂMETROS SÃO: HORA DE INICIO, HORA DE FIM...
//... FINAL DO INTERVALO, E CARGA DE TRABALHO NO SÁBADO!!
$H_default = array (8,20,14,8); //AQUI A JORNADA É: DAS 8:00 ÀS 22:00 , HORA FINAL DE INTERVALO: 13:00 E SÁBADO SÃO TRABALHADAS 4 HORAS

$H_horarios = array (1=>$H_default);//PARA CADA ÁREA DE ATENDIMENTO QUE TIVER HORÁRIO DE ATENDIMENTO DIVERENTE DO DEFAULT...
//...DEVE SER CRIADA UMA ENTRADA NO ARRAY H_horarios
/*EX:

$H_novaArea = array (10,18,13,0); AQUI O HORÁRIO DE INÍCIO É 10:00 E O FINAL DE EXPEDIENTE É 18:00
SEM TRABALHO NO SÁBADO (vida boa..) :)

$H_horarios = array (1=>$H_default, 2=>$H_novaArea);
*/



?>


ALGUÉM PODE ME AJUDA ?



  






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts