From 90ea74c7bc600a45707acbc18b1ce88754f10023 Mon Sep 17 00:00:00 2001 From: bruno Date: Fri, 2 Aug 2024 02:10:46 -0400 Subject: [PATCH] Inserir org_id algumas querys --- include/util/funcoesApl.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/util/funcoesApl.php b/include/util/funcoesApl.php index 22f71d1b..d956ec94 100755 --- a/include/util/funcoesApl.php +++ b/include/util/funcoesApl.php @@ -2094,7 +2094,7 @@ function InsereRotasRamais($dbcon, $rotas, $ramal) { $query = "update pbx_rotas_saida_ramais set tipo_acesso = '$tipoAcesso' where id_rota = '$id' and ramal = '$ramal' and org_id=$org_id; insert into pbx_rotas_saida_ramais(id_rota, ramal, tipo_acesso,org_id) select '$id', '$ramal', '$tipoAcesso', $org_id - where not exists(select '' from pbx_rotas_saida_ramais where id_rota = '$id' and ramal = '$ramal' and org_id=$org_id);"; + where not exists(select '' from pbx_rotas_saida_ramais where id_rota = '$id' and ramal = '$ramal' and org_id = $org_id);"; $novo = array('id_rota' => $id, 'ramal' => $ramal, 'tipo_acesso' => $tipoAcesso); GrvAudita($dbcon, $idProg, 'pbx_rotas_saida_ramais', 'INS', array(), $novo, array('id_rota', 'ramal', 'tipo_acesso'), array('id_rota'), true); @@ -2148,8 +2148,7 @@ function GetObsProdAgente($db = null, $dac = 0) { * Chefe Secretéria */ -function InsereRamaisChf($conn, $ramal) { - $org_id = $_SESSION['SSEmpresaPadrao']; +function InsereRamaisChf($conn, $ramal, $org_id) { $excecoes = $_POST['ramalSecExcecoesInc']; $query = "delete from pbx_chefe_secretaria where numero = '$ramal' and org_id = $org_id"; @@ -2157,9 +2156,9 @@ function InsereRamaisChf($conn, $ramal) { foreach ($excecoes as $exc) { global $idProg; - $query = "insert into pbx_chefe_secretaria(numero, excecao, org_id)values('$ramal', '$exc', $org_id);"; + $query = "insert into pbx_chefe_secretaria(numero, excecao, org_id) values('$ramal', '$exc', $org_id);"; pg_query($conn, $query); - $novo = array('numero' => $ramal, 'excecao' => $exc); + $novo = array('numero' => $ramal, 'excecao' => $exc, 'org_id' => $org_id); GrvAudita($conn, $idProg, 'pbx_chefe_secretaria', 'INS', array(), $novo, array('numero', 'excecao'), array('numero'), true); } }