Browse Source

correções e atualizações

1.8.1-monitor
Lucas Awade 1 year ago committed by Gitea
parent
commit
fec03d15d1
  1. 214
      admin/Fgeneral.php_OLD
  2. 504
      admin/LICENSE
  3. 174
      admin/README
  4. 3
      admin/WS_FTP.LOG
  5. 3
      admin/cadRamais.php
  6. 1
      admin/extensions.new
  7. 11
      admin/index.htm
  8. 11
      admin/index.html
  9. 32
      admin/index.php2
  10. 505
      admin/lgpl.txt
  11. 2
      admin/monitorChamadas.php
  12. 2
      admin/musicas.php
  13. 66
      admin/phptelnet.php.save
  14. 0
      admin/play.m3u
  15. 23
      admin/readme.txt
  16. 983
      admin/rgeneral.php2
  17. 11
      admin/untitled.htm
  18. 6
      agente/agenteChamadasAbandon.php
  19. 57
      agente/agentert.php
  20. 112
      asterisk/var_lib_asterisk/scripts/integracao/abdAgi.php
  21. BIN
      audio_old.php
  22. 12
      cadastros/ServicosChamadas/servicosChamadas.php
  23. 12
      cadastros/classificaAtendimento/classificaAtendimento.php
  24. 0
      cadastros/licenca~b8e6413 (Adicionar 'cadastros_licenca')
  25. 4
      cadastros/motivosPausa/motivosPausaDelete.php
  26. 12
      cadastros/pesquisa/pesquisaDacs.php
  27. 4
      cadastros/pesquisa/pesquisaFuncoes.php
  28. 114
      cadastros/pesquisa/pesquisaRelAgente.php
  29. 41
      cadastros/pesquisa/pesquisaRelAudio.php
  30. 4
      include/configBd.php
  31. 2
      include/util/display_errors.php
  32. 25
      include/util/funcoesApl.php
  33. 6
      include/util/funcoesInternas.php
  34. 3
      projeto/base/sql/versao-1.8.1.sql
  35. 5
      recuperarsenha.php
  36. 600
      relatorios/custom/relChamadaGeral.php
  37. 32
      relatorios/pbx/chamadasSaintes/saintesCentroCusto.php
  38. 7
      scriptApl/functions15.js
  39. 161
      scriptApl/supervisorchat.js
  40. 2
      scriptApl/utils.js
  41. 4
      seguranca/grupos/grupoInsert.php
  42. 2
      seguranca/trocaSenha.php
  43. 4
      templates/agendaRamais/depto/deptoRamais.htm
  44. 11
      templates/agendaRamais/depto/deptoRamaisInsert.html
  45. 26
      templates/cadastros/ServicosChamadas/servicosChamadas.tpl
  46. 21
      templates/cadastros/classificaAtendimento/classificaItem.tpl
  47. 2
      templates/configSuper.tpl
  48. 4
      templates/master.tpl

214
admin/Fgeneral.php_OLD

@ -1,214 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="ISO-8859-1" />
<script type="text/javascript" src="js/jquery-1.4.js"></script>
<script type="text/javascript" src="js/jquery.blockUI.js?v2.29"></script>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jquery.validationEngine.js" type="text/javascript"></script>
<script src="js/jquery.validationEngine-en.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
$("#form1").validationEngine({
sucess : function(){ document.form1.submit();},
failure : function() {}
})
});
</script>
<link href="css/forms.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-color: #EAEAEA;
}
-->
</style></head>
<body>
<?
include('funcoes.php');
include('padroes.php');
$acao= $_GET["acao"];
if($acao=='salva'){
$parkext =trim($_POST["parkext"]);
$parkpos = trim($_POST["parkpos"]);
$parkingtime = trim($_POST["parkingtime"]);
$findslot =trim($_POST["findslot"]);
$courtesytone = trim($_POST["courtesytone"]);
$parkedplay = trim($_POST["parkedplay"]);
$adsipark = trim($_POST["adsipark"]);
$findslot = trim($_POST["findslot"]);
$parkedmusicclass= trim($_POST["parkedmusicclass"]);
$transferdigittimeout = trim($_POST["transferdigittimeout"]);
$xfersound = trim($_POST["xfersound"]);
$xferfailsound = trim($_POST["xferfailsound"]);
$pickupexten = trim($_POST["pickupexten"]);
$featuredigittimeout = trim($_POST["featuredigittimeout"]);
$atxfernoanswertimeout = trim($_POST["atxfernoanswertimeout"]);
$context = trim($_POST["context"]);
//REALIZA BACKUP BO BANCO
backup($dbcon,'pbx_features_general','U','','update','FEATURE_GENERAL');
$query = "UPDATE pbx_features_general
SET
parkext='$parkext',parkpos='$parkpos', parkingtime='$parkingtime',findslot='$findslot',
courtesytone='$courtesytone', parkedplay = '$parkedplay',adsipark = '$adsipark',parkedmusicclass='$parkedmusicclass' ,xfersound = '$xfersound',xferfailsound= '$xferfailsound', pickupexten='$pickupexten',featuredigittimeout='$featuredigittimeout',
atxfernoanswertimeout='$atxfernoanswertimeout',context='$context',transferdigittimeout=$transferdigittimeout";
// $result = pg_query($dbcon, $query);
pg_query($dbcon,$query);//gera arquivos e executa o reload dos dados no asterisk
gera_arquivos($dbcon,'FEATURE_GENERAL');
?>
<script>//fecha a janela presa no meio do sistema
fecha_popup();</script>
<?
}
$query = "SELECT * FROM pbx_features_general";
$result = pg_query($dbcon, $query);
while($dados = pg_fetch_array($result)){
?>
<form name="form1" method="post" action="Fgeneral.php?acao=salva" id="form1">
<table width="475" border="1" align="center" cellpadding="0" cellspacing="0" class="tabela">
<tr class="cabecalho">
<td background="img/button03.gif"><div align="center">CONFIGURA&Ccedil;&Atilde;O GLOBAL DE ESTACIONAMENTO E TRANSFERENCIA</div></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA" class="labels">
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><fieldset>
<legend class="labels">Suporte a ADSI:</legend>
<input name="adsipark" type="radio" value="yes" <?php if ($dados["adsipark"]=='yes'){ echo "checked";}?> />
SIM
<input name="adsipark" type="radio" value="no" <?php if ($dados["adsipark"]=='no'){ echo "checked";}?> />
N&Atilde;O
</fieldset></td>
<td><fieldset>
<legend class="labels"><span class="style9">Estacionamento:</span></legend>
<input name="parkext" type="text" class="validate[optional,custom[onlyNumber],length[0,100]] caixas" id="parkext" value="<?php echo $dados['parkext']; ?>" size="20" maxlength="10" />
</fieldset></td>
<td><fieldset>
<legend class="labels"><span class="style9">Faixa de Estacionamento:</span></legend>
<input name="parkpos" type="text" class="validate[optional,length[0,100]] caixas" id="parkpos" value="<?php echo $dados['parkpos']; ?>" size="20" maxlength="10" />
</fieldset></td>
</tr>
</table></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA" class="labels">
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><fieldset>
<legend class="labels"><span class="style9">Timeout Estacionamento:</span></legend>
<input name="parkingtime" type="text" class="validate[optional,custom[onlyNumber],length[0,100]] caixas" id="parkingtime" value="<?php echo $dados['parkingtime']; ?>" size="20" maxlength="10" />
</fieldset></td>
<td><fieldset>
<legend class="labels"><span class="style9">Anuncia Estacionamento:</span></legend>
<input name="courtesytone" type="text" class="caixas" id="courtesytone" value="<?php echo $dados['courtesytone']; ?>" size="20" maxlength="10" />
</fieldset></td>
<td><fieldset>
<legend class="labels"><span class="style9">Reproduzir Anuncio:</span></legend>
<select name="parkedplay" class="caixas">
<option value="parked" <?php if ($dados['parkedplay']=='parked') { echo "selected";}?>>Parked</option>
<option value="caller" <?php if ($dados['parkedplay']=='caller') { echo "selected";}?>>Caller</option>
<option value="both" <?php if ($dados['parkedplay']=='both') { echo "selected";}?>>Both</option>
</select>
</fieldset></td>
</tr>
</table></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA" class="labels">
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><fieldset>
<legend class="labels">Avan&ccedil;ar Faixa:</legend>
<input name="findslot" type="radio" value="next" <?php if ($dados["findslot"]=='next'){ echo "checked";}?> />
Avan&ccedil;ar
<input name="findslot" type="radio" value="first" <?php if ($dados["findslot"]=='first'){ echo "checked";}?> />
Primeiro
Livre
</fieldset></td>
<td><fieldset>
<legend class="labels"><span class="style9">Musica em espera:</span></legend>
<select name="parkedmusicclass" class="caixas" id="parkedmusicclass">
<option value="">---------</option>
<?php
$query2 = "SELECT * FROM pbx_musichold_grupos order by id asc";
$result2 = pg_query($dbcon, $query2);
while($dados2 = pg_fetch_array($result2)){
?>
<option value="<?php echo $dados2['nome'];?>" <?php if (trim($dados['parkedmusicclass'])==trim($dados2['nome'])){ echo "selected";} ?>><?php echo $dados2['nome'];?></option>
<?php }?>
</select>
</fieldset></td>
<td><fieldset>
<legend class="labels"><span class="style9"> Timeout Transfer&ecirc;ncia:</span></legend>
<input name="atxfernoanswertimeout" type="text" class="validate[optional,custom[onlyNumber],length[0,100]] caixas" id="atxfernoanswertimeout2" value="<?php echo $dados['atxfernoanswertimeout']; ?>" size="20" maxlength="10" />
</fieldset></td>
</tr>
</table></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA" class="labels">
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><fieldset>
<legend class="labels"><span class="style9">Anuncia Transferencia:</span></legend>
<input name="xfersound" type="text" class="caixas" id="xfersound" value="<?php echo $dados['xfersound']; ?>" size="20" maxlength="10" />
</fieldset></td>
<td><fieldset>
<legend class="labels"><span class="style9">Anuncia Falha da Transferencia:</span></legend>
<input name="xferfailsound" type="text" class="caixas" id="xferfailsound" value="<?php echo $dados['xferfailsound']; ?>" size="20" maxlength="10" />
</fieldset></td>
<td><fieldset>
<legend class="labels">Contexto:</legend>
<select name="context" class="caixas">
<option value="parkedcalls">estacionado</option>
<?php
$query2 = "SELECT * FROM pbx_contextos order by id asc";
$result2 = pg_query($dbcon, $query2);
while($dados2 = pg_fetch_array($result2)){
?>
<option value="<?php echo $dados2['nome'];?>" <?php if (trim($dados['context'])==$dados2['nome']){ echo "selected";} ?>><?php echo $dados2['nome'];?></option>
<?php }?>
</select>
</fieldset></td>
</tr>
</table></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA" class="labels">
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%"><fieldset>
<legend class="labels"><span class="style9">Tempo para ativar a transferencia:</span></legend>
<input name="featuredigittimeout" type="text" class="validate[optional,custom[onlyNumber],length[0,100]] caixas" id="featuredigittimeout" value="<?php echo $dados['featuredigittimeout']; ?>" size="20" maxlength="10" />
</fieldset></td>
<td width="50%"><fieldset>
<legend class="labels"><span class="style9">Tempo de discagem para transferencia:</span></legend>
<input name="transferdigittimeout" type="text" class="validate[optional,custom[onlyNumber],length[0,100]] caixas" id="transferdigittimeout" value="<?php echo $dados['transferdigittimeout']; ?>" size="20" maxlength="10" />
</fieldset></td>
</tr>
</table></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td>
<div align="center"> <span class="style1">
<input name="Submit2" type="button" class="labels" onclick="fecha_popup();" value="Fechar">
</span>
<input name="Submit" type="submit" class="labels" value="Salvar">
</div></td>
</tr>
</table>
</form>
<?php }?>

504
admin/LICENSE

@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

174
admin/README

@ -1,174 +0,0 @@
/*******************************************************************
* The http://phpmailer.codeworxtech.com/ website now carries a few *
* advertisements through the Google Adsense network. Please visit *
* the advertiser sites and help us offset some of our costs. *
* Thanks .... *
********************************************************************/
PHPMailer
Full Featured Email Transfer Class for PHP
==========================================
Version 2.0.4 (April 02, 2009)
This is the last version to support PHP4. We've made the move to PHP5 and
all of our efforts now are into PHPMailer for PHP5/6.
Version 2.0.3 (November 08, 2008)
PHP4 continues to be a major platform for developers. We are responding
to the emails received to continue development for PHP4 with this
release.
We have removed the /phpdoc from the downloads. All documentation is now on
the http://phpmailer.codeworxtech.com website.
For all other changes and notes, please see the changelog.
Donations are accepted at PayPal with our id "paypal@worxteam.com".
Version 2.2 (July 15 2008)
- see the changelog.
Version 2.0.2 (June 04 2008)
With this release, we are announcing that the development of PHPMailer for PHP5
will be our focus from this date on. We have implemented all the enhancements
and fixes from the sourceforge.net Tracker.
** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS.
IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE
APPRECIATED.
We have now added S/MIME functionality (ability to digitally sign emails).
BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.
The "Signed Emails" functionality adds the Sign method to pass the private key
filename and the password to read it, and then email will be sent with
content-type multipart/signed and with the digital signature attached.
We have also included more example files to show the use of "sendmail", "mail()",
"smtp", and "gmail".
We are also looking for more programmers to join the volunteer development team.
If you have an interest in this, please let us know.
Enjoy!
** NOTE:
As of November 2007, PHPMailer has a new project team headed by industry
veteran Andy Prevost (codeworxtech). The first release in more than two
years will focus on fixes, adding ease-of-use enhancements, provide
basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility
features. A new release is planned before year-end 2007 that will provide
full compatiblity with PHP4 and PHP5, as well as more bug fixes.
We are looking for project developers to assist in restoring PHPMailer to
its leadership position. Our goals are to simplify use of PHPMailer, provide
good documentation and examples, and retain backward compatibility to level
1.7.3 standards.
If you are interested in helping out, visit http://sourceforge.net/projects/phpmailer
and indicate your interest.
**
http://phpmailer.sourceforge.net/
This software is licenced under the LGPL. Please read LICENSE for information on the
software availability and distribution.
Class Features:
- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs
- Redundant SMTP servers
- Multipart/alternative emails for mail clients that do not read HTML email
- Support for 8bit, base64, binary, and quoted-printable encoding
- Uses the same methods as the very popular AspEmail active server (COM) component
- SMTP authentication
- Native language support
- Word wrap, and more!
Why you might need it:
Many PHP developers utilize email in their code. The only PHP function
that supports this is the mail() function. However, it does not expose
any of the popular features that many email clients use nowadays like
HTML-based emails and attachments. There are two proprietary
development tools out there that have all the functionality built into
easy to use classes: AspEmail(tm) and AspMail. Both of these
programs are COM components only available on Windows. They are also a
little pricey for smaller projects.
Since I do Linux development I’ve missed these tools for my PHP coding.
So I built a version myself that implements the same methods (object
calls) that the Windows-based components do. It is open source and the
LGPL license allows you to place the class in your proprietary PHP
projects.
Installation:
Copy class.phpmailer.php into your php.ini include_path. If you are
using the SMTP mailer then place class.smtp.php in your path as well.
In the language directory you will find several files like
phpmailer.lang-en.php. If you look right before the .php extension
that there are two letters. These represent the language type of the
translation file. For instance "en" is the English file and "br" is
the Portuguese file. Chose the file that best fits with your language
and place it in the PHP include path. If your language is English
then you have nothing more to do. If it is a different language then
you must point PHPMailer to the correct translation. To do this, call
the PHPMailer SetLanguage method like so:
// To load the Portuguese version
$mail->SetLanguage("br", "/optional/path/to/language/directory/");
That's it. You should now be ready to use PHPMailer!
A Simple Example:
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtp1.example.com;smtp2.example.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "jswan"; // SMTP username
$mail->Password = "secret"; // SMTP password
$mail->From = "from@example.com";
$mail->FromName = "Mailer";
$mail->AddAddress("josh@example.net", "Josh Adams");
$mail->AddAddress("ellen@example.com"); // name is optional
$mail->AddReplyTo("info@example.com", "Information");
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML message body <b>in bold!</b>";
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
CHANGELOG
See ChangeLog.txt
Download: http://sourceforge.net/project/showfiles.php?group_id=26031
Andy Prevost

3
admin/WS_FTP.LOG

@ -1,3 +0,0 @@
110.04.22 19:12 B C:\xampp\htdocs\desenvolvimento\admin\admin.php --> 192.168.80.96 /uploads admin.php
110.04.22 19:12 B C:\xampp\htdocs\desenvolvimento\admin\admin.php --> 192.168.80.96 /uploads admin.php
110.04.22 19:12 B C:\xampp\htdocs\desenvolvimento\admin\admin.php --> 192.168.80.96 /uploads admin.php

3
admin/cadRamais.php

@ -356,12 +356,11 @@ if ($_GET['ajax'] == 1) {
* Descomentar para cloud compartilhado.
*
*/
if ($result && RESTRINGE_AUDIO_CRIA_RAMAL) {
if ($result) {
$query = "insert into pbx_grupo_audio_ramal select '$nome2', gp_id from pbx_grupo a where gp_status = 1 and not exists(select '' from pbx_grupo_audio_ramal where gp_id = a.gp_id and nome = '$nome2');";
$result = pg_query($dbcon, $query);
}
if (!$result) {
$z++;
$msg .= 'Erro ao incluir ramal ' . $nome2 . '!' . '\n';

1
admin/extensions.new

@ -1 +0,0 @@
[ura-]

11
admin/index.htm

@ -1,11 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
</body>
</html>

11
admin/index.html

@ -1,11 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Web Project</title>
</head>
<body>
<h1>New Web Project Page</h1>
</body>
</html>

32
admin/index.php2

@ -1,32 +0,0 @@
<html>
<head>
<title>Administra&ccedil;&atilde;o Asterisk</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--Fireworks MX 2004 Dreamweaver MX 2004 target. Created Thu Nov 26 17:34:28 GMT-0300 (Hora oficial do Brasil) 2009-->
</head>
<body bgcolor="#dddddd">
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="Untitled-1.png" fwbase="index.gif" fwstyle="Dreamweaver" fwdocid = "2027375799" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="95" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="117" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="117" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="451" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td colspan="4" rowspan="2"><?php include ('menu.php');?></td>
<td><img src="images/spacer.gif" width="1" height="77" border="0" alt=""></td>
</tr>
<tr>
<td><img src="images/spacer.gif" width="1" height="58" border="0" alt=""></td>
</tr>
<tr>
<td colspan="4" rowspan="2"><BR><?php include ('monitor_geral.php');?> </td>
<td><img src="images/spacer.gif" width="1" height="292" border="0" alt=""></td>
</tr>
</table>
</body>
</html>

505
admin/lgpl.txt

@ -1,505 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

2
admin/monitorChamadas.php

@ -1,5 +1,7 @@
<?php
// error_reporting(E_ERROR);
// ini_set('display_errors', 0);
/*
* Limpar o buffer
*/

2
admin/musicas.php

@ -59,7 +59,7 @@ if ($acao == "deleta") {
?>
<tr>
<td width="50" align="center"><?php echo $dados['id']; ?></td>
<td ><a href="#" style="color: #000;" onclick="abre_janela('490', '180', 'index.php?idProg=11022&pbxRequest=1&acao=edita&id=<?php echo $dados['id']; ?><?php echo $params; ?>');"><?php echo $dados['nome']; ?></a></td>
<td ><a href="#" style="color: #000;" onclick="abre_janela('490', '180', 'index.php?idProg=11022&pbxRequest=1&acao=edita&id=<?php echo $dados['id']; ?><?php echo $params; ?>');"><?php echo strtoupper($dados['nome']); ?></a></td>
<td width="320"><?php echo $dados['directory']; ?></td>
<td width="60">
<table width="100%" border="0" cellspacing="0" cellpadding="0">

66
admin/phptelnet.php.save

@ -1,66 +0,0 @@
#!/usr/bin/php5 -q
<?
function connect_db() {
$conexao = pg_connect("dbname=desenvolvimento port=5432 host=192.168.80.95 user=contacte password=ctepgSQL");
if (!$conexao) {
exit;
}
}
$timeout = 50;
$socket = fsockopen("127.0.0.1","5038", $errno, $errstr, $timeout);
fwrite($socket, "action: login".chr(13).chr(10));
fwrite($socket, "username: manager".chr(13).chr(10));
fwrite($socket, "secret: sugamanager".chr(13).chr(10).chr(13).chr(10));
// $actionid=rand(000000000,9999999999);
// fwrite($socket, "actionid: ".$actionid."\r\n\r\n");
$gr=true;
$x=0;
$evento='';
while (true){
$bufer = fgets($socket);
if (trim($bufer)!=''){
//print_r($bufer."<br>");
$tmp=split(": ",$bufer);
$campo=($tmp[0]);
$valor=trim($tmp[1]);
if (($valor!='Cdr')) {
if ($campo=='Event'){
connect_db();
$evento=trim($valor);
$query = "INSERT INTO pbx_monitor_evento (EVENTO) VALUES ('".strtolower($valor)."')";
pg_query($query);
$query = "SELECT ID FROM pbx_monitor_evento order by id desc limit 1";
$result = pg_query($query);
while($dados = pg_fetch_array($result)){
$id = $dados['id'];
}
pg_close();
} else if ($id>0){
connect_db();
if ((strtolower($campo)!='cause-txt') && (strtolower($campo)!='cid-callingpres') ){
$query = "update pbx_monitor_evento set ".strtolower($campo)."='$valor' where id=$id";
} else if (strtolower($campo)=='cid-callingpres'){
$query = "update pbx_monitor_evento set \"cid-callingpres\"='$valor' where id=$id";
}else {
$query = "update pbx_monitor_evento set \"cause-txt\"='$valor' where id=$id";
}
pg_query($query);
pg_close();
}
if ( ($campo=='Uniqueid') or (($campo=='Cause-txt')&&($evento=='Hangup')) or (($campo=='PeerStatus')&&($evento=='PeerStatus')) or (($campo=='HoldTime')&&($evento=='QueueCallerAbandon')) or (($campo=='DestUniqueID')&&($evento=='Dial')) or (($campo=='Newcallerid')&&($evento=='CID-CallingPres')) or (($campo=='CallerID2')&&($evento=='Link')) or (($campo=='CallerID2')&&($evento=='Unlink'))){
//echo $campo .'->'. $valor."<br>";
}
}}
//print_r($bufer."<br>");
flush();
}
fclose($socket);
?>

0
admin/play.m3u

23
admin/readme.txt

@ -1,23 +0,0 @@
Licence: Creative Commons
http://creativecommons.org/
ENGLISH:
- backlinks in the footer and author singature cannot be removed
- templates may be distributed in only a non-modified form
CZECH:
- podmínkou dalšího užití je ponechání zpětných odkazů a označení autora v patiččce webu
- šablonu je možné dálě šířit, ale jen v původní podobě
- kromě těchto podmínek s ní můžete vyvádět psí kusy :-)
Author:
Breezy New Media
http://www.breezy.cz

983
admin/rgeneral.php2

@ -1,983 +0,0 @@
<?php
include('funcoes.php');
include('padroes.php');
$arq=$caminho_producao."sip.conf";
$abre=fopen($arq, "r");
$acao= $_GET["acao"];
$lines = file($arq);
if(isset($_POST["disallow"])){
$disallow = $_POST["disallow"];
$disallow2="";
if(isset($disallow))
{
foreach($disallow as $dis)
{
$g++;
$disallow2.=$dis;
if ((count($disallow)>1)and(count($disallow)>$g)){
$disallow2.=',';
}
}
}
$allow = $_POST["allow"];
$allow2="";
$g=0;
if(isset($allow))
{
foreach($allow as $al)
{
$g++;
$allow2.=$al;
if ((count($allow)>1)and(count($allow)>$g)){
$allow2.=',';
}
}
}
$context= trim($_POST["context"]);
$callerid= trim($_POST["callerid"]);
$allowguest= trim($_POST["allowguest"]);
$allowoverlap= trim($_POST["allowoverlap"]);
$allowtransfer= trim($_POST["allowtransfer"]);
$realm= trim($_POST["realm"]);
$bindport= trim($_POST["bindport"]);
$bindaddr= trim($_POST["bindaddr"]);
$srvlookup= trim($_POST["srvlookup"]);
$pedantic = trim($_POST["pedantic"]);
$tos_sip= trim($_POST["tos_sip"]);
$tos_audio= trim($_POST["tos_audio"]);
$tos_video= trim($_POST["tos_video"]);
$maxexpiry= trim($_POST["maxexpiry"]);
$minexpiry= trim($_POST["minexpiry"]);
$defaultexpiry = trim($_POST["defaultexpiry"]);
$t1min= trim($_POST["t1min"]);
$notifymimetype= trim($_POST["notifymimetype"]);
$checkmwi= trim($_POST["checkmwi"]);
$buggymwi= trim($_POST["buggymwi"]);
$vmexten= trim($_POST["vmexten"]);
$mohinterpret = trim($_POST["mohinterpret"]);
$mohsuggest= trim($_POST["mohsuggest"]);
$language= trim($_POST["language"]);
$relaxdtmf= trim($_POST["relaxdtmf"]);
$trustrpid= trim($_POST["trustrpid"]);
$sendrpid= trim($_POST["sendrpid"]);
$progressinband= trim($_POST["progressinband"]);
$useragent= trim($_POST["useragent"]);
$promiscredir= trim($_POST["promiscredir"]);
$userqphone= trim($_POST["userqphone"]);
$dtmfmode= trim($_POST["dtmfmode"]);
$compactheaders= trim($_POST["compactheaders"]);
$videosupport= trim($_POST["videosupport"]);
$maxcallbitrate= trim($_POST["maxcallbitrate"]);
$alwaysauthreject= trim($_POST["alwaysauthreject"]);
$g726nonstandard= trim($_POST["g726nonstandard"]);
$matchexterniplocally= trim($_POST["matchexterniplocally"]);
$regcontext= trim($_POST["regcontext"]);
$rtptimeout= trim($_POST["rtptimeout"]);
$rtpholdtimeout= trim($_POST["rtpholdtimeout"]);
$rtpkeepalive= trim($_POST["rtpkeepalive"]);
$sipdebug= trim($_POST["sipdebug"]);
$recordhistory= trim($_POST["recordhistory"]);
$dumphistory= trim($_POST["dumphistory"]);
$allowsubscribe = trim($_POST["allowsubscribe"]);
$subscribecontext= trim($_POST["subscribecontext"]);
$notifyringing= trim($_POST["notifyringing"]);
$notifyhold= trim($_POST["notifyhold"]);
$limitonpeers= trim($_POST["limitonpeers"]);
$t38pt_udptl= trim($_POST["t38pt_udptl"]);
$externip= trim($_POST["externip"]);
$externhost= trim($_POST["externhost"]);
$externrefresh= trim($_POST["externrefresh"]);
$localnet= trim($_POST["localnet"]);
$nat= trim($_POST["nat"]);
$canreinvite= trim($_POST["canreinvite"]);
$directrtpsetup= trim($_POST["directrtpsetup"]);
$rtcachefriends= trim($_POST["rtcachefriends"]);
$rtsavesysname= trim($_POST["rtsavesysname"]);
$rtupdate= trim($_POST["rtupdate"]);
$rtautoclear = trim($_POST["rtautoclear"]);
$ignoreregexpire= trim($_POST["ignoreregexpire"]);
$domain= trim($_POST["domain"]);
$autodomain= trim($_POST["autodomain"]);
$allowexternaldomains = trim($_POST["allowexternaldomains"]);
$fromdomain= trim($_POST["fromdomain"]);
$jbenable= trim($_POST["jbenable"]);
$jbforce= trim($_POST["jbforce"]);
$jbmaxsize= trim($_POST["jbmaxsize"]);
$jbresyncthreshold= trim($_POST["jbresyncthreshold"]);
$jbimpl= trim($_POST["jbimpl"]);
$jblog= trim($_POST["jblog"]);
$auth= trim($_POST["auth"]);
$query = "UPDATE pbx_sip_general
SET disallow='$disallow2', allow='$allow2', context='$context', callerid='$callerid', allowguest='$allowguest',
allowoverlap='$allowoverlap', allowtransfer='$allowtransfer', realm='$realm', bindport='$bindport', bindaddr='$bindaddr',
srvlookup='$srvlookup', pedantic='$pedantic', tos_sip='$tos_sip', tos_audio='$tos_audio', tos_video='$tos_video',
maxexpiry='$maxexpiry', minexpiry='$minexpiry', defaultexpiry='$defaultexpiry', t1min='$t1min', notifymimetype='$notifymimetype',
checkmwi='$checkmwi', buggymwi='$buggymwi', vmexten='$vmexten', mohinterpret='$mohinterpret', mohsuggest='$mohsuggest',
language='$language', relaxdtmf='$relaxdtmf', trustrpid='$trustrpid', sendrpid='$sendrpid', progressinband='$progressinband',
useragent='$useragent', promiscredir='$promiscredir', userqphone='$userqphone', dtmfmode='$dtmfmode', compactheaders='$compactheaders',
videosupport='$videosupport', maxcallbitrate='$maxcallbitrate', alwaysauthreject='$alwaysauthreject', g726nonstandard='$g726nonstandard',
matchexterniplocally='$matchexterniplocally', regcontext='$regcontext', rtptimeout='$rtptimeout', rtpholdtimeout='$rtpholdtimeout',
rtpkeepalive='$rtpkeepalive', sipdebug='$sipdebug', recordhistory='$recordhistory', dumphistory='$dumphistory', allowsubscribe='$allowsubscribe',
subscribecontext='$subscribecontext', notifyringing='$notifyringing', notifyhold='$notifyhold', limitonpeers='$limitonpeers',
t38pt_udptl='$t38pt_udptl', externip='$externip', externhost='$externhost', externrefresh='$externrefresh', localnet='$localnet',
nat='$nat', canreinvite='$canreinvite', directrtpsetup='$directrtpsetup', rtcachefriends='$rtcachefriends', rtsavesysname='$rtsavesysname',
rtupdate='$rtupdate', rtautoclear='$rtautoclear', ignoreregexpire='$ignoreregexpire', domain='$domain', autodomain='$autodomain',
allowexternaldomains='$allowexternaldomains', fromdomain='$fromdomain', jbenable='$jbenable', jbforce='$jbforce',
jbmaxsize='$jbmaxsize', jbresyncthreshold='$jbresyncthreshold', jbimpl='$jbimpl', jblog='$jblog', auth='$auth'";
// $result = pg_query($dbcon, $query);
pg_query($dbcon,$query);
//faz o backup do arquivo
$ano= date("Y");
$mes=date("m");
$dia=date("d");
$hora=date("G");
$min=date("i");
$arq2 = $caminho_back.$ano.$mes.$dia.$hora.$min."_sip.conf";
$lines = file($arq);
$escreve = fopen($arq2, 'w');
for ($i = 0; $i < sizeof($lines); $i++){
fwrite($escreve,$lines[$i]);
}
fclose($escreve);
//fim do backup
//grava o arquivo novo
$escreve = fopen($arq, 'w');
fwrite($escreve,"[general]".chr(13).chr(10));
$query = "SELECT * FROM pbx_sip_general";
$result = pg_query($dbcon, $query);
while($dados = pg_fetch_array($result)){
$x++;
for ($i=1; pg_num_fields($result)>$i;$i++){
if (trim($dados[pg_field_name($result,$i)])!=''){
fwrite($escreve,pg_field_name($result,$i).'='.$dados[pg_field_name($result,$i)].chr(13).chr(10));
}}
}
fwrite($escreve,"#include sip_adicional.conf");
fclose($escreve);
CommandAsterisk($dbcon,'SIP');
header('ramais.php');
}
$query = "SELECT * FROM pbx_sip_general";
$result = pg_query($dbcon, $query);
while($dados = pg_fetch_array($result)){?>
<style type="text/css">
<!--
.style11 {
font-size: 12px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #FFFFFF;
}
.style13 {color: #FFFFFF; font-size: 12px; font-style: italic; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; }
-->
</style>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="Untitled-1.png" fwbase="index.gif" fwstyle="Dreamweaver" fwdocid = "2027375799" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="95" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="117" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="117" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="451" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td colspan="4" rowspan="2"><?php include ('menu.php');?></td>
<td><img src="images/spacer.gif" width="1" height="77" border="0" alt=""></td>
</tr>
<tr>
<td><img src="images/spacer.gif" width="1" height="58" border="0" alt=""></td>
</tr>
<tr>
<td colspan="4" align="center" valign="top" bordercolor="#FFFFFF"><form name="form1" method="post" action="">
<br>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#990000" class="grid">
<tr>
<td colspan="4" align="center" class="cabecalho">CONFIGURA&Ccedil;&Atilde;O GLOBAL DO SIP</td>
</tr>
<tr>
<td width="12%" bordercolor="#DDDDDD" class="labels"><div align="right">Desabilitado:</div></td>
<td width="37%" bordercolor="#DDDDDD">
<?php
if (strpos($dados["disallow"],"gsm")!==false) {
$disallow1 = 'checked';
}
if (strpos($dados["disallow"],"g726aal2")!==false) {
$disallow2 = 'checked';
}
if (strpos($dados["disallow"],"g726")!==false) {
$disallow3 = 'checked';
}
if (strpos($dados["disallow"],"g729")!==false) {
$disallow4 = 'checked';
}
if (strpos($dados["disallow"],"ilbc")!==false) {
$disallow5 = 'checked';
}
if (strpos($dados["disallow"],"ulaw")!==false) {
$disallow6 = 'checked';
}
if (strpos($dados["disallow"],"alaw")!==false) {
$disallow7 = 'checked';
}
if (strpos($dados["disallow"],"all")!==false) {
$disallow8 = 'checked';
} ?>
<span class="labels">
<input name="disallow[]" type="checkbox" id="disallow[]2" value="g726aal2" <?php if (strpos($dados["disallow"],"gsm")!==false) { echo "checked";} ?> >
gsm
<input name="disallow[]" type="checkbox" id="disallow[]2" value="g726" <?php if (strpos($dados["disallow"],"g726")!==false) { echo "checked";} ?>>
g726
<input name="disallow[]" type="checkbox" id="disallow[]2" value="g729" <?php if (strpos($dados["disallow"],"g729")!==false) { echo "checked";} ?>>
g729
<input name="disallow[]" type="checkbox" id="disallow[]2" value="ilbc" <?php if (strpos($dados["disallow"],"ilbc")!==false) { echo "checked";} ?>>
ilbc
<input name="disallow[]" type="checkbox" id="disallow[]2" value="ulaw" <?php if (strpos($dados["disallow"],"ulaw")!==false) { echo "checked";} ?>>
ulaw
<input name="disallow[]" type="checkbox" id="disallow[]2" value="alaw" <?php if (strpos($dados["disallow"],"alaw")!==false) { echo "checked";} ?>>
alaw
<input name="disallow[]" type="checkbox" id="disallow[]2" value="all" <?php if (strpos($dados["disallow"],"all")!==false) { echo "checked";} ?>>
all </span></td>
<td width="16%" bordercolor="#DDDDDD" class="labels"><div align="right">Habilitado:</div></td>
<td width="35%" bordercolor="#DDDDDD" class="labels">
<input name="allow[]" type="checkbox" id="disallow[]2" value="g726aal2" <?php if (strpos($dados["allow"],"gsm")!==false) { echo "checked";} ?> >
gsm
<input name="allow[]" type="checkbox" id="disallow[]2" value="g726" <?php if (strpos($dados["allow"],"g726")!==false) { echo "checked";} ?>>
g726
<input name="allow[]" type="checkbox" id="disallow[]2" value="g729" <?php if (strpos($dados["allow"],"g729")!==false) { echo "checked";} ?>>
g729
<input name="allow[]" type="checkbox" id="disallow[]2" value="ilbc" <?php if (strpos($dados["allow"],"ilbc")!==false) { echo "checked";} ?>>
ilbc
<input name="allow[]" type="checkbox" id="disallow[]2" value="ulaw" <?php if (strpos($dados["allow"],"ulaw")!==false) { echo "checked";} ?>>
ulaw
<input name="allow[]" type="checkbox" id="disallow[]2" value="alaw" <?php if (strpos($dados["allow"],"alaw")!==false) { echo "checked";} ?>>
alaw
<input name="allow[]" type="checkbox" id="disallow[]2" value="all" <?php if (strpos($dados["allow"],"all")!==false) { echo "checked";} ?>>
all </td>
</tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">Identificador:</div></td>
<td bordercolor="#DDDDDD"><input name="callerid" type="text" class="textbox" id="callerid" value="<?php echo $dados["callerid"]; ?>" size="10" maxlength="20"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">ACEITA CONVIDADOS:</div></td>
<td bordercolor="#DDDDDD">
<?php
switch (trim($dados["allowguest"])){
case 'yes': $allowguest1 = 'checked';
break;
case 'no': $allowguest2 = 'checked';
break;
}
?>
<span class="labels">
<input name="allowguest" type="radio" value="yes" <?php echo $allowguest1 ;?>>
SIM
<input name="allowguest" type="radio" value="no" <?php echo $allowguest2 ;?>>
N&Atilde;O</span></td>
</tr><tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">Context:</div></td>
<td bordercolor="#DDDDDD"><input name="context" type="text" class="textbox" id="context" value="<?php echo $dados["context"]?>" size="10" maxlength="20"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">realm:</div></td>
<td bordercolor="#DDDDDD"><input name="realm" type="text" class="textbox" id="realm" value="<?php echo $dados["realm"]?>" size="10" maxlength="20"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">allowoverlap:</div></td>
<td bordercolor="#DDDDDD">
<?php
switch (trim($dados["allowoverlap"])){
case 'yes': $allowoverlap1 = 'checked';
break;
case 'no': $allowoverlap2 = 'checked';
break;
}
?>
<span class="labels">
<input name="allowoverlap" type="radio" value="yes" <?php echo $allowoverlap1; ?>>
SIM
<input name="allowoverlap" type="radio" value="no" <?php echo $allowoverlap2; ?>>
N&Atilde;O </span></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">allowtransfer:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["allowtransfer"])){
case 'yes': $allowtransfer1 = 'checked';
break;
case 'no': $allowtransfer2 = 'checked';
break;
}
?>
<input name="allowtransfer" type="radio" value="yes" <?php echo $allowtransfer1; ?>>
SIM
<input name="allowtransfer" type="radio" value="no"<?php echo $allowtransfer2; ?>>
N&Atilde;O </td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">BIND ADDR:</div></td>
<td bordercolor="#DDDDDD"><input name="bindaddr" type="text" class="textbox" id="bindaddr" value="<?php echo $dados["bindaddr"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">BIND PORT:</div></td>
<td bordercolor="#DDDDDD"><input name="bindport" type="text" class="textbox" id="bindport" value="<?php echo $dados["bindport"];?>"></td>
</tr>
<tr class="labels">
<td bordercolor="#DDDDDD" class="labels"><div align="right">srvlookup:</div></td>
<td bordercolor="#DDDDDD">
<?
switch (trim($dados["srvlookup"])){
case 'yes': $srvlookup1 = 'checked';
break;
case 'no': $srvlookup2 = 'checked';
break;
}
?>
<input name="srvlookup" type="radio" value="yes" <?php echo $srvlookup1;?>>
SIM
<input name="srvlookup" type="radio" value="no"<?php echo $srvlookup2;?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">pedantic:</div></td>
<td bordercolor="#DDDDDD">
<?
switch (trim($dados["pedantic"])){
case 'yes': $pedantic1 = 'checked';
break;
case 'no': $pedantic2 = 'checked';
break;
}
?>
<input name="pedantic" type="radio" value="yes" <?php echo $pedantic1;?>>
SIM
<input name="pedantic" type="radio" value="no" <?php echo $pedantic2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">tos_sip:</div></td>
<td bordercolor="#DDDDDD"><input name="tos_sip" type="text" class="textbox" id="tos_sip" value="<?php echo $dados["tos_sip"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">tos_audio:</div></td>
<td bordercolor="#DDDDDD"><input name="tos_audio" type="text" class="textbox" id="tos_audio" value="<?php echo $dados["tos_audio"];?>"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">tos_video:</div></td>
<td bordercolor="#DDDDDD"><input name="tos_video" type="text" class="textbox" id="tos_video" value="<?php echo $dados["tos_video"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">maxexpiry:</div></td>
<td bordercolor="#DDDDDD"><input name="maxexpiry" type="text" class="textbox" id="maxexpiry" value="<?php echo $dados["maxexpiry"];?>"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">minexpiry:</div></td>
<td bordercolor="#DDDDDD"><input name="minexpiry" type="text" class="textbox" id="minexpiry" value="<?php echo $dados["minexpiry"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">defaultexpiry:</div></td>
<td bordercolor="#DDDDDD"><input name="defaultexpiry" type="text" class="textbox" id="defaultexpiry" value="<?php echo $dados["defaultexpiry"];?>"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">t1min:</div></td>
<td bordercolor="#DDDDDD"><input name="t1min" type="text" class="textbox" id="t1min" value="<?php echo $dados["t1min"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right"><span class="style5">notifymimetype : </span></div></td>
<td bordercolor="#DDDDDD"><input name="notifymimetype" type="text" class="textbox" id="notifymimetype" value="<?php echo $dados["notifymimetype"];?>"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">checkmwi:</div></td>
<td bordercolor="#DDDDDD"><input name="checkmwi" type="text" class="textbox" id="checkmwi" value="<?php echo $dados["checkmwi"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">buggymwi:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["buggymwi"])){
case 'yes': $buggymwi1 = 'checked';
break;
case 'no': $buggymwi2 = 'checked';
break;
}
?>
<input name="buggymwi" type="radio" value="yes" '.$buggymwi1.'>
SIM
<input name="buggymwi" type="radio" value="no" '.$buggymwi2.'>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">vmexten:</div></td>
<td bordercolor="#DDDDDD"><input name="vmexten" type="text" class="textbox" id="vmexten" value="<?php echo $dados["vmexten"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">mohinterpret:</div></td>
<td bordercolor="#DDDDDD"><input name="mohinterpret" type="text" class="textbox" id="mohinterpret" value="<?php echo $dados["mohinterpret"];?>"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">mohsuggest:</div></td>
<td bordercolor="#DDDDDD"><input name="mohsuggest" type="text" class="textbox" id="mohsuggest" value="<?php echo $dados["mohsuggest"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">language:</div></td>
<td bordercolor="#DDDDDD"><input name="language" type="text" class="textbox" id="language" value="<?php echo $dados["language"];?>"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">relaxdtmf:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["relaxdtmf"])){
case 'yes': $relaxdtmf1 = 'checked';
break;
case 'no': $relaxdtmf2 = 'checked';
break;
}
?>
<input name="relaxdtmf" type="radio" value="yes" <?php echo $relaxdtmf1; ?>>
SIM
<input name="relaxdtmf" type="radio" value="no" <?php echo $relaxdtmf2; ?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">trustrpid:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["trustrpid"])){
case 'yes': $trustrpid1 = 'checked';
break;
case 'no': $trustrpid2 = 'checked';
break;
}
?>
<input name="trustrpid" type="radio" value="yes" <?php echo $trustrpid1; ?>>
SIM
<input name="trustrpid" type="radio" value="no" <?php echo $trustrpid2;?>>
N&Atilde;O</TD>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">sendrpid:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["sendrpid"])){
case 'yes': $sendrpid1 = 'checked';
break;
case 'no': $sendrpid2 = 'checked';
break;
}?>
<input name="sendrpid" type="radio" value="yes" <?php echo $sendrpid1; ?>>
SIM
<input name="sendrpid" type="radio" value="no" <?php echo $sendrpid2 ;?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">progressinband:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["progressinband"])){
case 'yes': $progressinband1 = 'checked';
break;
case 'no': $progressinband2 = 'checked';
break;
case 'never': $progressinband3 = 'checked';
break;
}
?>
<input name="progressinband" type="radio" value="yes" <?php echo $progressinband1;?>>
SIM
<input name="progressinband" type="radio" value="no" <?php echo $progressinband2; ?>>
N&Atilde;O
<input name="progressinband" type="radio" value="never" <?php echo $progressinband3; ?>>
NUNCA</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">useragent:</div></td>
<td bordercolor="#DDDDDD"><input name="useragent" type="text" class="textbox" id="useragent" value="<?php echo $dados["useragent"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">promiscredir:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["promiscredir"])){
case 'yes': $promiscredir1 = 'checked';
break;
case 'no': $promiscredir2 = 'checked';
break;
}
?>
<input name="promiscredir" type="radio" value="yes" <?php echo $promiscredir1;?>>
SIM
<input name="promiscredir" type="radio" value="no" <?php echo $promiscredir2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">dtmfmode:</div></td>
<td bordercolor="#DDDDDD"><input name="dtmfmode" type="text" class="textbox" id="dtmfmode" value="<?php echo $dados["dtmfmode"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">videosupport:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["videosupport"])){
case 'yes': $videosupport1 = 'checked';
break;
case 'no': $videosupport2 = 'checked';
break;
}?>
<input name="videosupport" type="radio" value="yes" <?php echo $videosupport1;?>>
SIM
<input name="videosupport" type="radio" value="no" <?php echo $videosupport2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">maxcallbitrate:</div></td>
<td bordercolor="#DDDDDD"><input name="maxcallbitrate" type="text" class="textbox" id="maxcallbitrate" value="<?php echo $dados["maxcallbitrate"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">alwaysauthreject:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["alwaysauthreject"])){
case 'yes': $alwaysauthreject1 = 'checked';
break;
case 'no': $alwaysauthreject2 = 'checked';
break;
}?>
<input name="alwaysauthreject" type="radio" value="yes" <?php echo $alwaysauthreject1;?>>
SIM
<input name="alwaysauthreject" type="radio" value="no" <?php echo $alwaysauthreject2;?> >
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">g726nonstandard:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["g726nonstandard"])){
case 'yes': $g726nonstandard1 = 'checked';
break;
case 'no': $g726nonstandard2 = 'checked';
break;
}
?>
<input name="g726nonstandard" type="radio" value="yes" '.$g726nonstandard1.'>
SIM
<input name="g726nonstandard" type="radio" value="no" '.$g726nonstandard2.'>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">matchexterniplocally:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["matchexterniplocally"])){
case 'yes': $matchexterniplocally1 = 'checked';
break;
case 'no': $matchexterniplocally2 = 'checked';
break;
}
?>
<input name="matchexterniplocally" type="radio" value="yes" <?php echo $matchexterniplocally1 ;?> >
SIM
<input name="matchexterniplocally" type="radio" value="no" <?php echo $matchexterniplocally2; ?> >
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">regcontext:</div></td>
<td bordercolor="#DDDDDD"><input name="regcontext" type="text" class="textbox" id="regcontext" value="<?php echo $dados["regcontext"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">rtptimeout:</div></td>
<td bordercolor="#DDDDDD"><input name="rtptimeout" type="text" class="textbox" id="rtptimeout" value="<?php echo $dados["rtptimeout"];?>"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">rtpholdtimeout:</div></td>
<td bordercolor="#DDDDDD"><input name="rtpholdtimeout" type="text" class="textbox" id="rtpholdtimeout" value="<?php echo $dados["rtpholdtimeout"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">rtpkeepalive:</div></td>
<td bordercolor="#DDDDDD"><input name="rtpkeepalive" type="text" class="textbox" id="rtpkeepalive" value="<?php echo $dados["rtpkeepalive"];?>"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">DEBUG:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["sipdebug"])){
case 'yes': $sipdebug1 = 'checked';
break;
case 'no': $sipdebug2 = 'checked';
break;
}
?>
<input name="sipdebug" type="radio" value="yes" <?php echo $sipdebug1; ?>>
SIM
<input name="sipdebug" type="radio" value="no" <?php echo $sipdebug2;?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">recordhistory:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["recordhistory"])){
case 'yes': $recordhistory1 = 'checked';
break;
case 'no': $recordhistory2 = 'checked';
break;
}
?>
<input name="recordhistory" type="radio" value="yes" <?php echo $recordhistory1;?>>
SIM
<input name="recordhistory" type="radio" value="no" <?php echo $recordhistory2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">dumphistory:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["dumphistory"])){
case 'yes': $dumphistory1 = 'checked';
break;
case 'no': $dumphistory2 = 'checked';
break;
}?>
<input name="dumphistory" type="radio" value="yes" <?php echo $dumphistory1;?>>
SIM
<input name="dumphistory" type="radio" value="no" <?php echo $dumphistory2;?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">allowsubscribe:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["allowsubscribe"])){
case 'yes': $allowsubscribe1 = 'checked';
break;
case 'no': $allowsubscribe2 = 'checked';
break;
} ?>
<input name="allowsubscribe" type="radio" value="yes" <?php echo $allowsubscribe1;?>>
SIM
<input name="allowsubscribe" type="radio" value="no" <?php echo $allowsubscribe2;?>>
SIM</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">subscribecontext:</div></td>
<td bordercolor="#DDDDDD"><input name="subscribecontext" type="text" class="textbox" id="subscribecontext" value="<?php echo $dados["subscribecontext"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">notifyringing:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["notifyringing"])){
case 'yes': $notifyringing1 = 'checked';
break;
case 'no': $notifyringing2 = 'checked';
break;
}?>
<input name="notifyringing" type="radio" value="yes" <?php echo $notifyringing1;?>>
SIM
<input name="notifyringing" type="radio" value="no" <?php echo $notifyringing2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">notifyhold;</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["notifyhold"])){
case 'yes': $notifyhold1 = 'checked';
break;
case 'no': $notifyhold2 = 'checked';
break;
}
?>
<input name="notifyhold" type="radio" value="yes" <?php echo $notifyhold1;?>>
SIM
<input name="notifyhold" type="radio" value="no" <?php echo $notifyhold2;?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">limitonpeers:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["limitonpeers"])){
case 'yes': $limitonpeers1 = 'checked';
break;
case 'no': $limitonpeers2 = 'checked';
break;
}?>
<input name="limitonpeers" type="radio" value="yes" <?php echo $limitonpeers1;?>>
SIM
<input name="limitonpeers" type="radio" value="no" <?php echo $limitonpeers2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">t38pt_udptl:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["t38pt_udptl"])){
case 'yes': $t38pt_udptl1 = 'checked';
break;
case 'no': $t38pt_udptl2 = 'checked';
break;
}
?>
<input name="t38pt_udptl" type="radio" value="yes" <?php echo $t38pt_udptl1; ?>>
SIM
<input name="t38pt_udptl" type="radio" value="no" <?php echo $t38pt_udptl2; ?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">externip:</div></td>
<td bordercolor="#DDDDDD"><input name="externip" type="text" class="textbox" id="externip" value=<?php echo $dados["externip"];?>></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">externhost:</div></td>
<td bordercolor="#DDDDDD"><input name="externhost" type="text" class="textbox" id="externhost" value="<?php echo $dados["externhost"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">externrefresh:</div></td>
<td bordercolor="#DDDDDD"><input name="externrefresh" type="text" class="textbox" id="externrefresh" value="<?php echo $dados["externrefresh"];?>"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">localnet:</div></td>
<td bordercolor="#DDDDDD"><input name="localnet" type="text" class="textbox" id="localnet" value="<?php echo $dados["localnet"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">nat:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["nat"])){
case 'yes': $nat1 = 'checked';
break;
case 'no': $nat2 = 'checked';
break;
case 'never': $nat3 = 'checked';
break;
case 'route': $nat4 = 'checked';
break;
}?>
<input name="nat" type="radio" value="yes" <?php echo $nat1; ?>>
SIM
<input name="nat" type="radio" value="no" <?php echo $nat2;?>>
N&Atilde;O
<input name="nat" type="radio" value="never" <?php echo $nat3;?>>
NUNCA
<input name="nat" type="radio" value="route" <?php echo $nat4;?>>
ROTA</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">canreinvite:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["canreinvite"])){
case 'yes': $canreinvite1 = 'checked';
break;
case 'no': $canreinvite2 = 'checked';
break;
case 'nonat': $canreinvite3 = 'checked';
break;
case 'update': $canreinvite4 = 'checked';
break;
} ?>
<input name="canreinvite" type="radio" value="yes" <?php echo $canreinvite1;?>>
SIM
<input name="canreinvite" type="radio" value="no" <?php echo $canreinvite2;?>>
N&Atilde;O
<input name="canreinvite" type="radio" value="nonat" <?php echo $canreinvite3;?>>
SEM NAT
<input name="canreinvite" type="radio" value="update" <?php echo $canreinvite4;?> >
UPDATE</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">directrtpsetup:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["directrtpsetup"])){
case 'yes': $directrtpsetup1 = 'checked';
break;
case 'no': $directrtpsetup2 = 'checked';
break;
} ?>
<input name="directrtpsetup" type="radio" value="yes" <?php echo $directrtpsetup1;?>>
SIM
<input name="directrtpsetup" type="radio" value="no" <?php echo $directrtpsetup2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">rtcachefriends:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["rtcachefriends"])){
case 'yes': $rtcachefriends1 = 'checked';
break;
case 'no': $rtcachefriends2 = 'checked';
break;
} ?>
<input name="rtcachefriends" type="radio" value="yes" <?php echo $rtcachefriends1;?>>
SIM
<input name="rtcachefriends" type="radio" value="no" <?php echo $rtcachefriends2;?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">rtsavesysname:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["rtsavesysname"])){
case 'yes': $rtsavesysname1 = 'checked';
break;
case 'no': $rtsavesysname2 = 'checked';
break;
}
?>
<input name="rtsavesysname" type="radio" value="yes" <?php echo $rtsavesysname1;?>>
SIM
<input name="rtsavesysname" type="radio" value="no" <?php echo $rtsavesysname2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">rtupdate:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["rtupdate"])){
case 'yes': $rtupdate1 = 'checked';
break;
case 'no': $rtupdate2 = 'checked';
break;
} ?>
<input name="rtupdate" type="radio" value="yes" <?php echo $rtupdate1;?>>
SIM
<input name="rtupdate" type="radio" value="no" <?php echo $rtupdate2;?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">rtautoclear:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["rtautoclear"])){
case 'yes': $rtautoclear1 = 'checked';
break;
case 'no': $rtautoclear2 = 'checked';
break;
} ?>
<input name="rtautoclear" type="radio" value="yes" <?php echo $rtautoclear1;?>>
SIM
<input name="rtautoclear" type="radio" value="no" <?php echo $rtautoclear2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">ignoreregexpire:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["ignoreregexpire"])){
case 'yes': $ignoreregexpire1 = 'checked';
break;
case 'no': $ignoreregexpire2 = 'checked';
break;
}
?>
<input name="ignoreregexpire" type="radio" value="yes" <?php echo $ignoreregexpire1;?>>
SIM
<input name="ignoreregexpire" type="radio" value="no" <?php echo $ignoreregexpire2;?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">Dominio:</div></td>
<td bordercolor="#DDDDDD"><input name="domain" type="text" class="textbox" id="domain" value="<?php echo $dados["domain"];?>"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">autodomain:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["autodomain"])){
case 'yes': $autodomain1 = 'checked';
break;
case 'no': $autodomain2 = 'checked';
break;
}
?>
<input name="autodomain" type="radio" value="yes" <?php echo $autodomain1;?>>
SIM
<input name="autodomain" type="radio" value="no" <?php echo $autodomain2;?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">allowexternaldomains:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["allowexternaldomains"])){
case 'yes': $allowexternaldomains1 = 'checked';
break;
case 'no': $allowexternaldomains2 = 'checked';
break;
} ?>
<input name="allowexternaldomains" type="radio" value="yes" <?php echo $allowexternaldomains1;?>>
SIM
<input name="allowexternaldomains" type="radio" value="no" <?php echo $allowexternaldomains2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">fromdomain:</div></td>
<td bordercolor="#DDDDDD"><input name="fromdomain" type="text" class="textbox" id="fromdomain" value="<?php echo $dados["fromdomain"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">jbenable:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["jbenable"])){
case 'yes': $jbenable1 = 'checked';
break;
case 'no': $jbenable2 = 'checked';
break;
} ?>
<input name="jbenable" type="radio" value="yes" <?php echo $jbenable1;?>>
SIM
<input name="jbenable" type="radio" value="no" <?php echo $jbenable2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">jbforce:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["jbforce"])){
case 'yes': $jbforce1 = 'checked';
break;
case 'no': $jbforce2 = 'checked';
break;
}
?>
<input name="jbforce" type="radio" value="yes" <?php echo $jbforce1;?>>
SIM
<input name="jbforce" type="radio" value="no" <?php echo $jbforce2;?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">jbmaxsize:</div></td>
<td bordercolor="#DDDDDD"><input name="jbmaxsize" type="text" class="textbox" id="jbmaxsize" value="<?php echo $dados["jbmaxsize"];?>"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">jbresyncthreshold:</div></td>
<td bordercolor="#DDDDDD"><input name="jbresyncthreshold" type="text" class="textbox" id="jbresyncthreshold" value="<?php echo $dados["jbresyncthreshold"];?>"></td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">jbimpl:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?php
switch (trim($dados["jbimpl"])){
case 'fixed': $jbimpl1 = 'checked';
break;
case 'adaptive': $jbimpl2 = 'checked';
break;
} ?>
<input name="jbimpl" type="radio" value="fixed" <?php echo $jbimpl1;?>>
SIM
<input name="jbimpl" type="radio" value="adaptive" <?php echo $jbimpl2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">jblog:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["jblog"])){
case 'yes': $jblog1 = 'checked';
break;
case 'no': $jblog2 = 'checked';
break;
}
?>
<input name="jblog" type="radio" value="yes" <?php echo $jblog1;?>>
SIM
<input name="jblog" type="radio" value="no" <?php echo $jblog2;?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">auth:</div></td>
<td bordercolor="#DDDDDD"><input name="auth" type="text" class="textbox" id="auth" value="<?php echo $dados["auth"];?>"></td>
</tr>
<tr>
<td bordercolor="#DDDDDD" class="labels"><div align="right">usereqphone:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["userqphone"])){
case 'yes': $userqphone1 = 'checked';
break;
case 'no': $userqphone2 = 'checked';
break;
} ?>
<input name="userqphone" type="radio" value="yes" <?php echo $userqphone1;?>>
SIM
<input name="userqphone" type="radio" value="no" <?php echo $userqphone2;?>>
N&Atilde;O</td>
<td bordercolor="#DDDDDD" class="labels"><div align="right">compactheaders:</div></td>
<td bordercolor="#DDDDDD" class="labels">
<?
switch (trim($dados["compactheaders"])){
case 'yes': $compactheaders1 = 'checked';
break;
case 'no': $compactheaders2 = 'checked';
break;
} ?>
<input name="compactheaders" type="radio" value="yes" <?php echo $compactheaders1;?>>
SIM
<input name="compactheaders" type="radio" value="no" <?php echo $compactheaders2;?>>
N&Atilde;O</td>
</tr>
<tr>
<td colspan="4" bordercolor="#DDDDDD"><div align="center">
<input name="Submit" type="button" class="textbox" onclick="MM_goToURL('ramais.php');" value="Voltar">
<input name="Submit" type="submit" class="textbox" value="Salvar">
</div></td>
</tr>
</table>
</form> <br>
</td>
<td><img src="images/spacer.gif" width="1" height="292" border="0" alt=""></td>
</tr>
</table>
<?php } ?>
</body>
</html>

11
admin/untitled.htm

@ -1,11 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
</body>
</html>

6
agente/agenteChamadasAbandon.php

@ -62,23 +62,21 @@ $query = "select b.fila, c.data_bilhete as data, a.abdsr_numero as origem, count
group by b.fila, c.data_bilhete, a.abdsr_numero, serv_id
order by 2;";
//if(IsAdmin()){ echo $query; }
$result = pg_query($dbcon, $query);
$numrow = 0;
$linhas = "";
$duracaoTotal = '';
$duracaoTotal = 0;
while ($row = pg_fetch_array($result)) {
$origem = ocultarTelefone($row["origem"]);
$discar = RemoveDddPadrao($row["origem"]);
$discar = Encrypt($discar);
$servico = $row['servico'] ? $row['servico'] : '-';
$acao = "<img src=\"imgSite/ramalOn16.png\" border=\"0\" width=\"20\" height=\"20\" alt=\"Retornar Chamada Perdida\" title=\"Retornar Chamada Perdida\">";
//$linkRamal = "<a href=\"javaScript:DiscarDiretoRet('$origem','$ramal');\">$acao</a>";
$linkRamal = sprintf("<a href=\"javaScript:RetornaAbd('%s');\">%s</a>", $discar, $acao);
if ($tipo == "agente")
$linkRamal = ($classiCham <> 0 ) ? $linkRamal : "<img src=\"imgSite/ramalOff16.png\" border=\"0\" width=\"20\" height=\"20\" alt=\"Chamada não classificada\" title=\"Chamada não classificada\">";
$linhas .= sprintf($linha, FormataDBDataHora($row["data"]), FormataDBDataHora($row["ult_abandono"]), ocultarTelefone($row["origem"]), $row["qtde"], SecondToStrTime($row["tempo"]), $servico, $linkRamal);
$duracaoTotal += $row["tempo"];
$duracaoTotal += (int) $row["tempo"];
$numrow++;
}

57
agente/agentert.php

@ -379,6 +379,12 @@ if (!IsAjax()) {
$dadosMonitor["pausa_motivo_ausente"] = 0;
$dadosMonitor["dac_padrao"] = $_SESSION["SS_ultimo_dac_agente"] ? $_SESSION["SS_ultimo_dac_agente"] : $_SESSION[SS_DAC_PADRAO_ID];
if($_SESSION['SS_IS_LOGGED'] == true && $_SESSION[SS_STATUS_AGENTE] == "OFF"){
unset($_SESSION['SS_IS_LOGGED']);
echo 'ERROR@@Você foi desconectado do sistema, verifique sua internet ou navegador! Entre em contato com seu supervisor.';
RegistraLogAgente("LogoffError", "Usuário foi desconectado inesperadamente, por queda da internet ou problema do navegador. [ Matricula : ". GetMatricula() . " ]" , 'ErrorLogoff');
exit;
}
/*
* O agente deslogou ou foi desconectado.
*/
@ -388,9 +394,11 @@ if (!IsAjax()) {
$dadosMonitor["matricula"] = GetMatricula();
$dadosMonitor["abandonadasRet"] = '0';
$dadosMonitor["status_agente"] = "OFF";
$_SESSION['SS_IS_LOGGED'] == false;
$dadosMonitor = array_merge($dadosMonitor, $dadosDiscador);
echo FormataDadosRt($dadosMonitor);
} else {
$_SESSION['SS_IS_LOGGED'] = true;
$oldStatus = $_SESSION[SS_STATUS_AGENTE];
DadosAtualiza($dbcon);
$chamadaValida = trim($dadosMonitor["uniqueid2"]);
@ -402,8 +410,9 @@ if (!IsAjax()) {
$dadosMonitor["linkaudio"] = "...";
}
if ($statusServer)
if ($statusServer){
$dadosMonitor["tempo_logado"] = sprintf('<span style="color: #00FF00">%s</span>', $dadosMonitor["tempo_logado"]);
}
$dadosMonitor["dac_logado"] = $_SESSION[SS_DAC_DESCRICAO];
$_SESSION[SS_STATUS_AGENTE] = $dadosMonitor["status_agente"] ? $dadosMonitor["status_agente"] : "OFF";
@ -425,17 +434,9 @@ if (!IsAjax()) {
$dadosMonitor['clienteoperacao'] = sprintf("<a href=\"javaScript:NovaJanela('index.php?idProg=45&formAction=4&id=%s&refresh=1', 'clienteOperacao', '760', '600', 'resizable=NO,scrollbars=NO');\"><img src=\"imgSite/usuarios.gif\" alt=\"Ir para a Tela do Cliente\" width=\"25\" border=\"0\" title=\"Visualiza as Informações do cliente!\" /></a>", $clienteOperacao);
}
//
// ALERTA CLASSIFICACAO: INICIO
//
//
// ALERTA CLASSIFICACAO: INICIO
//
/*
* Controla alerta sonoro para agente quando o chamado não é classificado.
*/
$exigeClass = $dadosMonitor["chamada_classificado_exige"];
$naoClass = $dadosMonitor["chamada_classificado"];
$startAlert = ($statusAtual == 'LIVRE');
@ -445,14 +446,12 @@ if (!IsAjax()) {
SetAlertAgente(false);
}
if ($chamadaValida && $exigeClass && !$naoClass && $startAlert && !GetAlertAgente()) {
SetAlertAgente(true);
SetAlertTempo(time());
}
$alertTEmpo = GetAlertTempo();
$alerta = (GetAlertTempo() !== false) && ((time() - GetAlertTempo())) > GetTempoAlertClas();
if (!$naoClass && GetAlertAgente() && $alerta && $startAlert) {
GetUrl(AST_ALERTA_AGENTE);
@ -460,32 +459,6 @@ if (!IsAjax()) {
SetAlertTempo(false);
}
/*
* Controla alerta sonoro para agente quando o chamado não é classificado.
$exigeClass = $dadosMonitor["chamada_classificado_exige"];
$statusLivre = ($statusAtual == 'LIVRE');
if ($chamadaValida && (GetAlertOcupado() === false) && ($statusAtual == 'OCUPADO')) {
SetAlertOcupado(true);
SetAlertAgente(false);
SetAlertTempo(false);
}
$naoClass = $dadosMonitor["chamada_classificado"];
if ($chamadaValida && $exigeClass && $statusLivre && !$naoClass && !GetAlertAgente() && GetAlertOcupado()) {
SetAlertAgente(true);
SetAlertTempo(time());
}
$alerta = (GetAlertTempo() !== false) && ((time() - GetAlertTempo())) > GetTempoAlertClas();
if ($chamadaValida && $statusLivre && GetAlertAgente() && !$naoClass && $alerta && GetAlertOcupado()) {
GetUrl(AST_ALERTA_AGENTE);
SetAlertAgente(false);
SetAlertTempo(false);
}
*/
if (($_SESSION[SS_STATUS_AGENTE] != 'OCUPADO') && ($_SESSION[SS_STATUS_AGENTE] != 'ORIGINANDO')) {
$dadosMonitor["duracao"] = '00:00:00';
}
@ -536,7 +509,6 @@ if (!IsAjax()) {
}
$dadosMonitor["abandonadasRet"] = RetornaAbandon($dbcon, $dadosMonitor["dac_logado"], GetRamalMonitorar(RAMAL_MONITOR_AGENTE), "", "", $dadosMonitor["abandonadasRet"]);
/*
* $dispIntegracao -> Indica que dados obtidos de uma integração seriam mostrados no campo do discador.
*/
@ -573,14 +545,11 @@ if (!IsAjax()) {
$dadosMonitor['tme'] = '0';
$dadosMonitor['vendido'] = !UseModVendas() ? '0' : GetVendasAgente($dac, $matricula);
echo FormataDadosRt($dadosMonitor);
//if($dadosMonitor["tempo_atualiza"] >= 30){ UpdateLogoffRt($dbcon); }
UpdateLogoffRt($dbcon);
}
}
else {
} else {
/*
* Tratamento de ações invocadas pelo agente.
*/
@ -1580,6 +1549,7 @@ function ConnectaAgenteRt($db, $dac, $tpAtend) {
$_SESSION["SS_CK_DISPO"] = 1;
$_SESSION["SS_ultimo_dac_agente"] = $dac;
$_SESSION['SSClassificaPendente'] = 0;
$_SESSION['SS_IS_LOGGED'] = true;
return true;
} catch (Exception $ex) {
//APRESENTA POPUP COM A MENSAGEM DE ERRO
@ -1679,7 +1649,7 @@ function DesConectaAgenteRt($db, $type = '') {
if (!$result) {
GeraExcept("não foi possível finalizar o registro de logoff do agente!");
}
$_SESSION['SS_IS_LOGGED'] = false;
SetMsgAgente("Agente desconectado com sucesso!");
AgenteDesconectRt();
return true;
@ -1772,6 +1742,7 @@ function UpdateLogoffRt($db) {
and id_dac = $dac
and login = (select max(login) from pbx_eventos_agentes where matricula = '$matricula' and id_dac = $dac)";
pg_query($db, $query);
/** ERRO AO ATUALIZAR AGENTE **/
}
function UpdatePausaRt($db) {

112
asterisk/var_lib_asterisk/scripts/integracao/abdAgi.php

@ -149,7 +149,6 @@ try {
$numero = NormalizaNumero($arg3);
MonitoraAbdAgi($conAbd, $uid, $dac, $arg3, $arg4, $direcao, $evento, $atendidaFila);
GravaLogGlobal('Inicio');
/**
* CAPTURA CODIGOS DE PARAMETROS DE CHAMADA.
@ -209,10 +208,7 @@ try {
* Marca o inicio da execucao do script.
* GravaLog(sprintf(": %s\n", $ ,date('Y-m-d H:i:s')), $pathLog);
*/
GravaLogGlobal('Inicio Registra Abandon');
//if ((!$chamadaAtendida) && (($direcao == 'I') || ($direcao == 'E'))) {
if ((!$chamadaAtendida) && ($direcao == 'E')) {
/*
* Inicio do tratamento para chamadas abandonadas.
@ -232,7 +228,6 @@ try {
RaiseExcept("Erro ao obter informacoes sobre a fila.", true);
}
$infoFila = pg_fetch_array($result, null, PGSQL_ASSOC);
GravaLogGlobal('Informacoes da Fila');
/*
* Inserindo informacoes sobre a chamada e a fila no momento do abandono.
*/
@ -241,12 +236,10 @@ try {
. "values(%s,%s,%s,%s,%s,%s,%s,%s)";
$query = sprintf($query, QuotedStr($uid), QuotedStr($dac), QuotedStr($numero), QuotedStr(($infoFila['logado'] ? $infoFila['logado'] : '0')), QuotedStr(($infoFila['pausa'] ? $infoFila['pausa'] : '0')), QuotedStr(($infoFila['ocupado'] ? $infoFila['ocupado'] : '0')), QuotedStr(($infoFila['indisponivel'] ? $infoFila['indisponivel'] : '0')), QuotedStr(($infoFila['nao_classificado']) ? $infoFila['nao_classificado'] : '0'));
$result = pg_query($conAbd, $query);
if (!$result) {
RaiseExcept("Erro ao gravar informacoes sobre a chamada.", true);
}
GravaLogGlobal('Insere Abandonadas');
} else {
GravaLog(sprintf("[ PROCESS ]\n", 'Nao foi possivel encontrar o numero passado pela central', date('Y-m-d H:i:s')), $pathLog);
}
@ -271,7 +264,7 @@ try {
if (!$result) {
RaiseExcept("Erro ao obter informacoes sobre os agentes.", true);
}
GravaLogGlobal('Informacoes Agentes');
/* /var/lib/asterisk/scripts/integracao/abdAgi.php,1531320618.20,FINANCEIRO,4002,
* Inserindo informacoes sobre os agentes no momento da chamada.
*/
@ -285,7 +278,6 @@ try {
if (!pg_query($conAbd, $query)) {
RaiseExcept("Erro ao gravar informacoes sobre os agentes no momento da chamada.", true);
}
GravaLogGlobal('Informacoes Agentes Logados');
}
} else {
/* Sem agente logado na fila */
@ -295,7 +287,6 @@ try {
if (!pg_query($conAbd, $query)) {
RaiseExcept("Erro ao gravar informacoes sobre os agentes no momento da chamada.", true);
}
GravaLogGlobal('Sem agente');
}
} else if ($chamadaAtendida) {
/*
@ -317,7 +308,6 @@ try {
$res = pg_query($conAbd, $query);
GravaLogGlobal('Informacoes de retorno');
if (!$res) {
RaiseExcept("Erro ao consultar informacoes sobre a chamada abandonada", true);
}
@ -342,7 +332,6 @@ try {
if (!$result) {
RaiseExcept("Erro ao atualizar informacoes sobre a chamada abandonada", true);
}
GravaLogGlobal('Atualiza retorno');
/*
* Atualiza chamdas anteriores para o mesmo numero marcando como retornada
*/
@ -360,7 +349,6 @@ try {
if (!$result) {
RaiseExcept("Erro ao atualizar informacoes sobre a chamada abandonada anteriores a atual", true);
}
GravaLogGlobal('Atauliza status retorno');
}
}
if (!pg_query($conAbd, 'commit')) {
@ -375,7 +363,6 @@ try {
* Grava erros gerados durante a execucao.
*/
GravaLog(sprintf("Erro:%s File: %s Line: %s \ncmd: %s\n %s\n", $ex->getMessage(), $ex->getFile(), $ex->getLine(), $query, date('Y-m-d H:i:s')), $pathLog);
GravaLogGlobal('Capltura erro');
}
/* * *************************************************************************
* *************** FIM TRATAMENTO ABANDONADAS NA FILA ***********************
@ -384,7 +371,6 @@ try {
/*
* Marca o fim da execucao do script.
*/
GravaLogGlobal('Fim Execucao');
pg_close($conAbd);
@ -394,60 +380,6 @@ pg_close($conAbd);
$conn = pg_connect($str);
$inTran = false;
/*
* Cria um controle para retorno de chamadas abandonadas,
* as chamadas vão sendo inseridas na tabela e removidas
* conformem forem sendo retornadas pelos agentes da fila
* aonde foram abandonadas.
-- Table: pbx_abandonadas_semretorno
-- DROP TABLE pbx_abandonadas_semretorno;
CREATE TABLE pbx_abandonadas_semretorno
(
abdsr_uniqueid character varying(32) not null primary key,
abdsr_data date NOT NULL default now()::date,
abdsr_fila character varying(64),
abdsr_numero character varying(32) NOT NULL,
abdsr_data_hora_inicio timestamp without time zone NOT NULL default now(),
abdsr_data_hora_retorno timestamp without time zone,
abdsr_data_retorno date,
abdsr_ramal character varying(32),
abdsr_agente character varying(32),
abdsr_agt_logado int,
abdsr_agt_pausa int,
abdsr_agt_ocupado int,
abdsr_agt_indisponivel int,
abdsr_agt_nao_classificado int,
abdsr_uniqueid_ret character varying(32)
);
-- Index: "idxPbxAbdsrDataNumero"
-- DROP INDEX "idxPbxAbdsrDataNumero";
CREATE INDEX "idxPbxAbdsrDataNumero"
ON pbx_abandonadas_semretorno
USING btree
(abdsr_data, abdsr_fila, abdsr_numero);
CREATE INDEX "idxPbxAbdsrUid"
ON pbx_abandonadas_semretorno
USING btree
(abdsr_uniqueid);
-- DROP TABLE pbx_abandonadas_status;
CREATE TABLE pbx_abandonadas_status
(
uniqueid character varying(32) not null,
matricula character varying(16) not null,
id_evt_agt int,
status varchar(32),
ramal varchar(32),
disponivel int,
classificado int,
constraint "pkPbxAbandonadasStatus" primary key(uniqueid, matricula)
);
*
*/
/*
* Função Chamada Ramal da API.
@ -455,46 +387,6 @@ $inTran = false;
include_once '/var/lib/asterisk/scripts/integracao/constServerIntegra.php';
include_once '/var/lib/asterisk/scripts/integracao/localDataBase.php';
$scrpt = $argv[0];
$UNIQUEID = $arg1;
$userfield = $agi->get_variable('MONITOR_FILENAME', true);
$userfield = trim($userfield) ? $userfield : 'AUDIO.WAV';
$path = '/var/log/asterisk/encerra_chamada_satelitenorte.log';
$query = sprintf("select a.chdr_id from pbx_chamada_ramal a where a.uniqueid = '%s' and a.chdr_fim is null", $UNIQUEID);
$result = pg_query($conn, $query);
if (pg_num_rows($result)) {
GravaLog($query . "\n AUDIO: " . $userfield . "\n", $path);
$dados = pg_fetch_array($result, null, PGSQL_ASSOC);
$chdr_id = $dados['chdr_id'];
$audio = str_ireplace('.WAV', '.MP3', $userfield);
$token = '026d3a4b331078aa09d096d11e495215';
$parametros = array('method' => 'terminachamada', 'audio' => $audio, 'id_chamada' => $UNIQUEID, 'token' => $token, 'login' => 'admin', 'senha' => 'SiP1029384756', 'tipoRetorno' => 'JSON');
//$parametros = array('audio' => $audio, 'id_chamada' => $UNIQUEID, 'token' => $token);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://satelitenorte.xpro.me/gestaodeleads/terminachamada");
//curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1/aplicativo/integracao/index.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parametros);
$content = trim(curl_exec($ch));
curl_close($ch);
$retorno = json_decode($content, true);
$log = sprintf("Status: %s Msg: %s", $retorno["status"], $retorno["mensagem"]);
$query = sprintf("update pbx_chamada_ramal set chdr_fim = now(), chdr_log = %s where chdr_id = '%s'", QuotedStr($log), $chdr_id);
GravaLog($query . "\n", $path);
$result = pg_query($conn, $query);
if (!$result) {
GravaLog($query . "\n", $path);
}
}
$integra = $agi->get_variable('INTEGRA-SAIDA', true);
if ($integra == 'SAIDA') {
@ -569,7 +461,6 @@ if ($agi->get_variable('MEMBERINTERFACE', true) || $evento == 'ABANDON') {
} else {
include($nomeMetodo);
}
exit;
}
}
@ -580,7 +471,6 @@ function GetVarFila() {
foreach ($varFila as $varName) {
$vars[$varName] = AgiGetVariable($varName);
}
return $vars;
}

BIN
audio_old.php

Binary file not shown.

12
cadastros/ServicosChamadas/servicosChamadas.php

@ -3,6 +3,7 @@
include_once 'funcoesFormulario.php';
$tpl = 'cadastros/ServicosChamadas/servicosChamadas.tpl';
$acao = isset($_REQUEST['acao']) ? $_REQUEST['acao'] : 'select';
$filtroStatus = isset($_POST['status']) ? $_POST['status'] : 'A';
$paramPesquisa = isset($_REQUEST['paramPesquisa']) ? $_REQUEST['paramPesquisa'] : '';
$filtro = isset($_REQUEST["paramPesquisa"]) ? trim($_REQUEST["paramPesquisa"]) : '';
$filtroNovo = !isset($_REQUEST["pgn"]) ? '' : sprintf("&paramPesquisa%s&pgn=%s&bloco=%s&pg=%s", $_REQUEST["paramPesquisa"], $_REQUEST["pgn"], $_REQUEST["bloco"], $_REQUEST["pg"]);
@ -55,6 +56,16 @@ if (isset($_REQUEST['paramPesquisa']) && $_REQUEST['paramPesquisa']) {
$compl = PreparaLike($filtro, true);
$compl = sprintf("and (a.serv_id ilike %s)", $compl);
}
switch($filtroStatus){
case 'A':
$compl .= 'AND serv_status = 1';
break;
case 'I':
$compl .= 'AND serv_status = 0';
break;
}
$query = "select serv_id, serv_status from pbx_servicos a where 1=1 $compl order by 1";
$linha = "";
$params = "&paramPesquisa=$filtro";
@ -90,6 +101,7 @@ $smarty->assign("totalReg", $totalReg);
$smarty->assign("pgn", $_REQUEST["pgn"]);
$smarty->assign("bloco", $_REQUEST["bloco"]);
$smarty->assign("pg", $_REQUEST["pg"]);
$smarty->assign('filtroStatus', $filtroStatus);
GetTemplate($smarty, $tpl);

12
cadastros/classificaAtendimento/classificaAtendimento.php

@ -12,7 +12,7 @@ $filtroNovo = !isset($_REQUEST["pgn"]) ? '' : sprintf("&paramPesquisa%s&pgn=%s&b
$recontaPag = ($acao == 'inseri') || (GetFormAcao() == FORM_DELETE) || isset($_POST['pesquisa']);
$imgNovo = "<img id=\"incClass\" src=\"images/novo.gif\" width=\"16\" height=\"16\" border=\"0\" align=\"absmiddle\" title=\"Inclui nova classificação\">";
$imgClass = "<a href=\"javaScript:NovaJanela('index.php?idProg=28$filtroNovo', 'clasCad', '$janW', '$janH', 'resizable=NO,scrollbars=NO');\">$imgNovo Nova Classificação</a>";
$filtroStatus = isset($_POST['status']) ? $_POST['status'] : 'A';
if (!IsAjax()) {
@ -28,6 +28,15 @@ if (!IsAjax()) {
$linhaDados = "";
$codDetalhe = 0;
switch($filtroStatus){
case 'A':
$compl .= "AND clas_status = '1'";
break;
case 'I':
$compl .= "AND clas_status = '0'";
break;
}
$query = "select clas_id as id, clas_descricao as desc, clas_status as status from pbx_classifica_atendimento a where 1=1 $compl order by 2";
$params = "&paramPesquisa=$filtro";
$links = PaginaDados($idProg, $query, $params, $regPagina, $offSet, $pagMostra, true);
@ -115,6 +124,7 @@ if (IsAjax()) {
$smarty->assign("bloco", $_REQUEST["bloco"]);
$smarty->assign("pg", $_REQUEST["pg"]);
$smarty->assign("desc", $desc);
$smarty->assign('filtroStatus', $filtroStatus);
GetTemplate($smarty, 'cadastros/classificaAtendimento/classificaItem.tpl');
}
?>

0
cadastros/licenca~b8e6413 (Adicionar 'cadastros_licenca')

4
cadastros/motivosPausa/motivosPausaDelete.php

@ -36,7 +36,9 @@ if ($result) {
echo "ERRO; Não é possível excluir este registro! Erro: " . pg_last_error();
}
} else {
echo "ERRO; Não é possível excluir este registro, o mesmo já foi utilizada na movimentação!";
echo "ERRO; Não é possível excluir o registro, o mesmo está sendo utilizado para auditorias! O registro será desativado.";
$query = "update pbx_motivos_pausas set flag = '0' where id = $id";
$result = pg_query($dbcon, $query);
}
}
?>

12
cadastros/pesquisa/pesquisaDacs.php

@ -7,7 +7,7 @@ $plDescricao = $_REQUEST["pl_descricao"];
if (isset($_POST["btIncDac"])) {
$dacs = $_POST["dacs"];
pg_query($dbcon, 'begin');
@pg_query($dbcon, 'begin');
foreach ($dacs as $idDac) {
$query = "insert into pbx_pesquisa_liberacao_dacs(pl_id, id_dac )
select '$plId', '$idDac'
@ -18,16 +18,16 @@ if (isset($_POST["btIncDac"])) {
}
if ($result) {
pg_query($dbcon, 'commit');
@pg_query($dbcon, 'commit');
$msg = "<span style=\"color: #0000FF\">Operação realizada com sucesso!</span>";
} else {
pg_query($dbcon, 'rollback');
@pg_query($dbcon, 'rollback');
$erroDb = pg_last_error($dbcon);
$msg = "<span style=\"color: #FF0000\">A operação não pode realizada!" . ($erroDb ? (" Erro: " . $erroDb) : "") . "</span>";
}
} else if (isset($_POST["btRmDac"])) {
$dacs = $_POST["dacsInc"];
pg_query($dbcon, 'begin');
@pg_query($dbcon, 'begin');
foreach ($dacs as $idDac) {
$query = "delete from pbx_pesquisa_liberacao_dacs where id_dac = '$idDac' and pl_id = '$plId' ";
$result = pg_query($dbcon, $query);
@ -39,10 +39,10 @@ if (isset($_POST["btIncDac"])) {
}
if ($result) {
pg_query($dbcon, 'commit');
@pg_query($dbcon, 'commit');
$msg = "<span style=\"color: #0000FF\">Operação realizada com sucesso!</span>";
} else {
pg_query($dbcon, 'rollback');
@pg_query($dbcon, 'rollback');
$erroDb = pg_last_error($dbcon);
$msg = "<span style=\"color: #FF0000\">A operação não pode realizada!" . ($erroDb ? (" Erro: " . $erroDb) : "") . "</span>";
}

4
cadastros/pesquisa/pesquisaFuncoes.php

@ -66,7 +66,7 @@ function GetPesquisaDac($db, $idDac) {
return $ret;
}
function GetPesquisaAgente($db, $plId, $matricula, $idDac, $dtIni, $dtFim, $incTodos = false) {
function GetPesquisaAgente($db, $plId, $matricula, $idDac, $dtIni, $dtFim, $incTodos) {
$ret = "";
$sel = "";
$dataIni = soNumero($dtIni) == "" ? "null" : "'$dtIni'";
@ -87,7 +87,7 @@ function GetPesquisaAgente($db, $plId, $matricula, $idDac, $dtIni, $dtFim, $incT
$result = pg_query($db, $query);
//if(IsAdmin())echo $query;
if (!$plId)
if (!$id)
$sel = "selected=\"selected\"";
if ($incTodos) {
$ret = "<option value=\"0\" $sel>Todos</option>";

114
cadastros/pesquisa/pesquisaRelAgente.php

@ -1,4 +1,5 @@
<?php
include_once 'util/relatoriosBase.php';
require("pesquisaFuncoes.php");
@ -11,26 +12,12 @@
private $___ppNome = '';
private $___datas = array();
private $___matricula;
private $___tipoRelatorio;
private $___servico;
public function __construct($idProg, $dbcon, $incDac) {
parent::__construct($idProg, $dbcon, $incDac);
$this->___dac = isset($_POST["listaDacs"]) ? $_POST["listaDacs"] : 0;
$this->___lstPesquisa = isset($_POST["lstPesquisa"]) ? $_POST["lstPesquisa"] : '0| | | |0| ';
$this->___matricula = isset($_POST["matricula"]) ? $_POST["matricula"] : 0;
$this->___servico = isset($_POST["listaServico"]) ? $_POST["listaServico"] : 0;
}
function ___ValidaForm() {
parent::___ValidaForm();
if (!IsPostBack()) {
return;
}
if (!$this->___lstPesquisa) {
GeraExcept('Informe uma Pesquisa!');
}
}
function ___FiltrosRelatorio() {
@ -89,7 +76,6 @@
$filtro .= '<td>Pesquisa</td>';
if ($this->GetIncDac())
$filtro .= '<td>Fila</td>';
$filtro .= GetUsoServico() ? '<td>Serviço</td>' : '';
$filtro .= '<td>Agente</td>';
$filtro .= '<td>Data Inicial</td>';
$filtro .= '<td>Data Final </td>';
@ -103,10 +89,7 @@
$filtro .= "<td><select name=\"lstPesquisa\">$lstPesquisa</select></td>";
if ($this->GetIncDac())
$filtro .= sprintf('<td>%s</td>', $dacs);
if (GetUsoServico()) {
$filtro .= sprintf('<td>%s</td>', GetIdentRota(false, $this->___servico));
}
$filtro .= "<td> <select name='matricula'>" . GetPesquisaAgente($dbcon, $this->___plId, $this->___matricula, $this->___dac, FormatDtMssql($this->___dataIni), FormatDtMssql($this->___dataFim), 1) . "</select></td>";
$filtro .= "<td> <select name='matricula'>" . GetPesquisaAgente($dbcon, $this->___plId, $this->___matricula, $this->___dac, FormatDtMssql($this->___dataIni), FormatDtMssql($this->___dataFim)) . "</select></td>";
$filtro .= '<td><input name="dataIni" id="dataIni" type="text" size="15" maxlength="10" value="%s" onkeyup="formataData(this)" title="dd/mm/aaaa"></td>';
$filtro .= '<td><input name="dataFim" id="dataFim" type="text" size="15" maxlength="10" value="%s" onkeyup="formataData(this)" title="dd/mm/aaaa"></td>';
$filtro .= '<td><input type="submit" name="btConsulta" id="btConsulta" value="Consultar"></td>';
@ -134,39 +117,24 @@
$plDescricao = $this->___plDescricao;
$datas = $this->___datas;
$matricula = $this->___matricula;
$srv = $this->___servico;
$mostraColunaServicos = GetUsoServico() == RELATORIO_SERVICOS_HABILITA;
GetDadosPesq($dbcon, $this->___lstPesquisa, $plId, $plDescricao, $ppId, $ppNome, $datas);
$query = "SELECT pq_display, pq_questao,
(select count(*)
from pbx_pesquisa_movimento a \n";
if (GetUsoServico()) {
$query .= " left join pbx_servicos_registra c on c.uniqueid = a.uniqueid \n";
}
$query .= " where pl_id = $plId
from pbx_pesquisa_movimento
where pl_id = $plId
and pp_id = a.pp_id
and pq_id = a.pq_id
and id_dac = $dac \n";
if (GetUsoServico() && $srv) {
$query .= " AND c.serv_id = '{$srv}' \n";
}
$matricula ? $query .= "and user_reg = '$matricula' \n" : '';
$query .= "and pm_data >= '$dataIni'
and id_dac = $dac
and user_reg = '$matricula'
and pm_data >= '$dataIni'
and pm_data <= '$dataFim')
as num_resp,pq_id
from pbx_pesquisa_questoes a, pbx_pesquisa_liberacao b
where b.pp_id = a.pp_id
and b.pl_id = '$plId'
and pq_status = 1 order by 1";
$result = $this->___GetQuery($query);
$row = pg_fetch_all($result);
$this->SetData($row ? $row : array());
@ -178,23 +146,12 @@
and pl_id = $plId
and b.pq_id = a.pq_id
and b.id_dac = $dac
and b.user_reg = '$matricula'
and b.pm_data >= '$dataIni'
and b.pm_data <= '$dataFim' \n";
$matricula ? $sql .= " and b.user_reg = '$matricula' \n" : '';
if (GetUsoServico()) {
$sql .= " left join pbx_servicos_registra c on c.uniqueid = b.uniqueid ";
}
$sql .= " where a.pq_id = {$dataPsq['pq_id']} ";
if (GetUsoServico() && $srv) {
$sql .= " AND c.serv_id = '{$srv}' \n";
}
$sql .= " group by a.po_id, a.po_tecla, a.po_opcao
and b.pm_data <= '$dataFim'
where a.pq_id = {$dataPsq['pq_id']}
group by a.po_id, a.po_tecla, a.po_opcao
order by 2";
$res = $this->___GetQuery($sql);
$rows = pg_fetch_all($res);
$this->SetData($rows ? $rows : array());
@ -208,22 +165,12 @@
INNER JOIN pbx_eventos_dacs b ON a.uniqueid = b.uid2
LEFT JOIN pbx_pesquisa_regitra c ON a.uniqueid = c.uniqueid
LEFT JOIN pbx_usuarios d ON d.matricula = SUBSTRING(b.agente, 7, 4)
LEFT JOIN pbx_queues_grupos e ON e.nome = b.fila";
if (GetUsoServico()) {
$query_status .= " LEFT JOIN pbx_servicos_registra s ON s.uniqueid = a.uniqueid ";
}
$query_status .= " WHERE calldate::DATE >= '{$dataIni}' AND calldate::DATE <= '{$dataFim}'
INNER JOIN pbx_queues_grupos e ON e.nome = b.fila
WHERE calldate::DATE >= '{$dataIni}' AND calldate::DATE <= '{$dataFim}'
AND b.evento IN('COMPLETEAGENT','COMPLETECALLER', 'TRANSFER','COMPLETEAGENTRAMAL','COMPLETECALLERRAMAL', 'COMPLETACALLER', 'COMPLETAAGENT')
AND e.id = {$dac} \n";
if (GetUsoServico() && $srv) {
$query_status .= " AND s.serv_id = '{$srv}' \n";
}
$matricula ? $query_status .= "and d.matricula = '$matricula' \n" : '';
$query_status .= "GROUP BY fila, d.matricula, apelido";
AND e.id = {$dac}
AND d.matricula = '{$matricula}'
GROUP BY fila, d.matricula, apelido";
$res = $this->___GetQuery($query_status);
$rows = pg_fetch_all($res);
@ -261,16 +208,18 @@
$linha[] = $value;
}
$dataRel[] = GenerateCsvFromArray($linha);
$dataRel[] = $linha;
//$row['po_opcao'] = RemoveAcentos($row['po_opcao']);
// Formata linha de dados.
foreach ($this->GetData()[$x] as $dataPsq) {
$linha = array();
foreach ($dadosField as $key) {
if ($key == 'po_opcao') {
$linha[] = RemoveAcentos($dataPsq["$key"]);
} else if ($key == 'por_resp') {
$dataPsq['por_resp'] = $dataPsq["num_resp"] ?? number_format(($dataPsq["num_resp"] / $somaResp) * 100.0, 2, ',', '.') . '%';
$dataPsq['por_resp'] = number_format(($dataPsq["num_resp"] / $somaResp) * 100.0, 2, ',', '.') . '%';
$linha[] = $dataPsq['por_resp'];
} else {
$linha[] = $dataPsq["$key"];
@ -279,7 +228,7 @@
$dataRel[] = GenerateCsvFromArray($linha);
unset($linha);
}
$dataRel[] = GenerateCsvFromArray(array('Total', '', 'Resp.: ' . $somaResp, $somaResp ?? number_format(($somaResp / $somaResp) * 100.0, 2, ',', '.') . '%'));
$dataRel[] = GenerateCsvFromArray(array('Total', '', 'Resp.: ' . $somaResp, number_format(($somaResp / $somaResp) * 100.0, 2, ',', '.') . '%'));
$x++;
}
@ -351,15 +300,17 @@
}
$dataRel[] = $linha;
//$row['po_opcao'] = RemoveAcentos($row['po_opcao']);
// Formata linha de dados.
foreach ($this->GetData()[$x] as $dataPsq) {
$linha = array('DADOS');
foreach ($dadosField as $key) {
if ($key == 'po_opcao') {
$linha[] = RemoveAcentos($dataPsq["$key"]);
} else if ($key == 'por_resp') {
$dataPsq['por_resp'] = $dataPsq["num_resp"] ?? number_format(($dataPsq["num_resp"] / $somaResp) * 100.0, 2, ',', '.') . '%';
$dataPsq['por_resp'] = number_format(($dataPsq["num_resp"] / $somaResp) * 100.0, 2, ',', '.') . '%';
$linha[] = $dataPsq['por_resp'];
} else {
$linha[] = $dataPsq["$key"];
@ -369,7 +320,7 @@
$dataRel[] = $linha;
unset($linha);
}
$dataRel[] = array('LABEL', 'Total', '', 'Resp.: ' . $somaResp, $somaResp ?? number_format(($somaResp / $somaResp) * 100.0, 2, ',', '.') . '%');
$dataRel[] = array('LABEL', 'Total', '', 'Resp.: ' . $somaResp, number_format(($somaResp / $somaResp) * 100.0, 2, ',', '.') . '%');
$x++;
}
@ -435,7 +386,6 @@
//print_r($this->GetData());
$x = 1;
$somaResp = 0;
$linhas = '';
/*
* Linhas de dados.
@ -444,6 +394,7 @@
//Monta a Questão da Pergunta da pesquisa.
$linhas .= sprintf("<tr><th colspan=\"4\"><span style='color:#404040'>%s</span></th></tr>", $row['pq_questao']);
$linhas .= "<tr>";
foreach ($dadosCabecalio as $key => $value) {
$linhas .= sprintf("<th %s>%s</th>", $value, $key);
@ -458,14 +409,14 @@
$linhas .= "<tr>";
foreach ($dadosField as $k => $value) {
if ($k == 'por_resp') {
$linhas .= sprintf("<td %s>%s%%</td>", $value, $dataPesquisa["num_resp"] ?? number_format(($dataPesquisa["num_resp"] / $somaResp) * 100.0, 2, ',', '.'));
$linhas .= sprintf("<td %s>%s%%</td>", $value, number_format(($dataPesquisa["num_resp"] / $somaResp) * 100.0, 2, ',', '.'));
} else {
$linhas .= sprintf("<td %s>%s</td>", $value, $dataPesquisa["$k"]);
}
}
$linhas .= "</tr>";
}
$linhas .= sprintf("<tr><td colspan='2' align='center'><b>Total</b></td><td align='center'><b>$somaResp</b></td><td align='center'><b>%s</b></td></tr>", $somaResp ?? number_format(($somaResp / $somaResp) * 100.0, 2, ',', '.') . '%');
$linhas .= sprintf("<tr><td colspan='2' align='center'><b>Total</b></td><td align='center'><b>$somaResp</b></td><td align='center'><b>%s</b></td></tr>", number_format(($somaResp / $somaResp) * 100.0, 2, ',', '.') . '%');
$x++;
@ -541,10 +492,10 @@
$dataQst[$z]['po_opcao'] = $data['po_opcao'];
$dataQst[$z]['num_resp'] = $data['num_resp'];
$dataQst[$z]['po_tecla'] = $data['po_tecla'];
$dataQst[$z]['por_resp'] = $data["num_resp"] ?? number_format(($data["num_resp"] / $somaTotalQtd) * 100.0, 2, ',', '.') . '%';
$dataQst[$z]['por_resp'] = number_format(($data["num_resp"] / $somaTotalQtd) * 100.0, 2, ',', '.') . '%';
$z++;
}
$totalizador = array('Total: ', $row['pq_questao'], 'Resp.: ' . $somaTotalQtd, $somaTotalQtd ?? number_format(($somaTotalQtd / $somaTotalQtd) * 100.0, 2, ',', '.') . '%');
$totalizador = array('Total: ', $row['pq_questao'], 'Resp.: ' . $somaTotalQtd, number_format(($somaTotalQtd / $somaTotalQtd) * 100.0, 2, ',', '.') . '%');
$tables[] = array($dadosCabecalio, $dadosField, $dataQst, $widthHeader, $totalizador, 0);
$x++;
unset($dataQst);
@ -622,3 +573,4 @@
$relPesquisaAgt = new RelPesquisaAgente($idProg, $dbcon, 1);
$relPesquisaAgt->ExecutaRelatorio();

41
cadastros/pesquisa/pesquisaRelAudio.php

@ -1,4 +1,5 @@
<?php
include_once 'util/relatoriosBase.php';
require("pesquisaFuncoes.php");
@ -13,7 +14,6 @@
private $___protocolo = 0;
private $___matricula;
private $___opcResposta;
private $___servico;
public function __construct($idProg, $dbcon, $incDac) {
parent::__construct($idProg, $dbcon, $incDac);
@ -22,7 +22,6 @@
$this->___protocolo = isset($_POST['protocolo']) ? $_POST['protocolo'] : '';
$this->___matricula = isset($_POST["matricula"]) ? $_POST["matricula"] : 0;
$this->___opcResposta = isset($_POST["lstOpcoes"]) ? $_POST["lstOpcoes"] : -1;
$this->___servico = isset($_POST["listaServico"]) ? $_POST["listaServico"] : 0;
$this->___GetRelAudio();
}
@ -102,10 +101,9 @@
$filtro .= "<tr>";
if ($this->GetIncDac())
$filtro .= '<td>Fila</td>';
$filtro .= GetUsoServico() ? '<td>Serviço</td>' : '';
$filtro .= '<td>Agente </td>';
$filtro .= '<td>Data Inicial</td>';
$filtro .= '<td>Data Final </td>';
$filtro .= '<td>Agente </td>';
$filtro .= '<td>Protocolo</td>';
$filtro .= '<td align="center" valign="middle">&nbsp;</td>';
$filtro .= '</tr>';
@ -116,12 +114,9 @@
$filtro .= '<tr>';
if ($this->GetIncDac())
$filtro .= sprintf('<td>%s</td>', $dacs);
if (GetUsoServico()) {
$filtro .= sprintf('<td>%s</td>', GetIdentRota(false, $this->___servico));
}
$filtro .= "<td><select name='matricula'>" . GetPesquisaAgente($dbcon, $this->___plId, $this->___matricula, $this->___dac, FormatDtMssql($this->___dataIni), FormatDtMssql($this->___dataFim), 1) . "</select></td>";
$filtro .= '<td><input name="dataIni" id="dataIni" type="text" size="15" maxlength="10" value="%s" onkeyup="formataData(this)" title="dd/mm/aaaa"></td>';
$filtro .= '<td><input name="dataFim" id="dataFim" type="text" size="15" maxlength="10" value="%s" onkeyup="formataData(this)" title="dd/mm/aaaa"></td>';
$filtro .= "<td><select name='matricula'>" . GetPesquisaAgente($dbcon, $this->___plId, $this->___matricula, $this->___dac, FormatDtMssql($this->___dataIni), FormatDtMssql($this->___dataFim), 1) . "</select></td>";
$filtro .= "<td><input name=\"protocolo\" id=\"prot\" type=\"text\" size=\"15\" maxlength=\"15\" value=\"\" title=\"Protocolo de Atendimento\"></td>";
$filtro .= '<td><input type="submit" name="btConsulta" id="btConsulta" value="Consultar"></td>';
$filtro .= '<td>%s</td>';
@ -149,8 +144,6 @@
$datas = $this->___datas;
$protocolo = $this->___protocolo;
$matricula = $this->___matricula;
$srv = $this->___servico;
$mostraColunaServicos = GetUsoServico() == RELATORIO_SERVICOS_HABILITA;
GetDadosPesq($dbcon, $this->___lstPesquisa, $plId, $plDescricao, $ppId, $ppNome, $datas);
@ -164,13 +157,7 @@
LEFT JOIN pbx_protocolo_reg d ON d.uniqueid = a.uniqueid
INNER JOIN pbx_pesquisa e ON e.pp_id = a.pp_id
INNER JOIN pbx_dacs f ON f.id = a.id_dac
INNER JOIN pbx_pesquisa_opcoes g ON g.pp_id = a.pp_id AND g.po_id = a.po_id\n";
if (GetUsoServico()) {
$query .= " LEFT JOIN pbx_servicos_registra s ON s.uniqueid = a.uniqueid \n";
}
$query .= "
INNER JOIN pbx_pesquisa_opcoes g ON g.pp_id = a.pp_id AND g.po_id = a.po_id
WHERE b.lastapp <> 'Transferred Call'
AND COALESCE(b.userfield, '') <> ''
AND duration > 0
@ -195,10 +182,6 @@
$query .= "AND d.protocolo = '$protocolo' ";
}
if (GetUsoServico() && $srv) {
$query .= " AND s.serv_id = '{$srv}' \n";
}
$query .= " ORDER BY c.nome, a.pm_data";
$result = $this->___GetQuery($query);
@ -207,6 +190,7 @@
}
protected function ___PreparaCsv() {
global $dbcon;
$dataRel = array();
$filtro = $this->___FiltrosRelatorio();
@ -229,6 +213,8 @@
* Linhas de dados.
*/
foreach ($this->GetData()[0] as $row) {
;
$dac = GetDacDesc($dbcon, $this->___dac);
$downloadAudio = VerificaPerfilAcesso($dbcon, GetIdProgFromNomeArq('downloadAudio.php'));
$acessoAudio = GetAcessoAudio($dac);
@ -239,7 +225,6 @@
$msgAudio = sprintf("[ %s ]", RemoveAcentos($row['userfield']));
}
$row['src'] = ocultarTelefone($row['src']);
$row['agente'] = RemoveAcentos($row['agente']);
$row['pm_data'] = date('d/m/Y', strtotime($row['pm_data']));
$row['protocolo'] = $row['protocolo'] ? $row['protocolo'] : ' ---- ';
@ -261,6 +246,10 @@
$dataRel = array();
$filtro = $this->___FiltrosRelatorio();
/*
* Inicia o relatório.
*/
/*
* Cria os filtros
*/
@ -309,7 +298,6 @@
$msgAudio = sprintf("[ %s ]", RemoveAcentos($row['userfield']));
}
$row['src'] = ocultarTelefone($row['src']);
$row['agente'] = RemoveAcentos($row['agente']);
$row['pm_data'] = date('d/m/Y', strtotime($row['pm_data']));
$row['protocolo'] = $row['protocolo'] ? $row['protocolo'] : ' ---- ';
@ -327,6 +315,7 @@
}
protected function ___PreparaGrid() {
global $dbcon, $infoDispositivo;
$dataRel = array();
@ -375,9 +364,10 @@
*/
$total = 0;
foreach ($this->GetData()[0] as $row) {
$row['src'] = ocultarTelefone($row['src']);
$row['pm_data'] = date('d/m/Y', strtotime($row['pm_data']));
$row['protocolo'] = $row['protocolo'] ? $row['protocolo'] : ' ---- ';
$dac = GetDacDesc($dbcon, $this->___dac);
$downloadAudio = VerificaPerfilAcesso($dbcon, GetIdProgFromNomeArq('downloadAudio.php'));
$acessoAudio = GetAcessoAudio($dac);
@ -454,6 +444,7 @@
$widthHeader = array(15, 37, 37, 10, 15, 45);
foreach ($dados as $row) {
$dac = GetDacDesc($dbcon, $this->___dac);
$downloadAudio = VerificaPerfilAcesso($dbcon, GetIdProgFromNomeArq('downloadAudio.php'));
$acessoAudio = GetAcessoAudio($dac);
@ -466,7 +457,7 @@
$dataQst[$z]['pm_data'] = date('d/m/Y', strtotime($row['pm_data']));
$dataQst[$z]['agente'] = $row['agente'];
$dataQst[$z]['src'] = ocultarTelefone($row['src']);
$dataQst[$z]['src'] = $row['src'];
$dataQst[$z]['protocolo'] = $row['protocolo'] ? $row['protocolo'] : ' ---- ';
$dataQst[$z]['po_opcao'] = $row['po_opcao'];
$dataQst[$z]['userfield'] = $msgAudio;

4
include/configBd.php

@ -1,9 +1,9 @@
<?php
/*
* Configuração para acesso ao banco de dados principal da aplicação.
* configuração para acesso ao banco de dados principal da aplicação.
*/
$dbPort = getenv('DB_PORT') ? getenv('DB_PORT') : '5432';
$dbHost = getenv('DB_HOST') ? getenv('DB_HOST') : '127.0.0.1';
$dbHost = getenv('DB_HOST') ? getenv('DB_HOST') : '164.152.59.203';
$dbName = getenv('DB_BASE') ? getenv('DB_BASE') : 'pbx';
$dbUser = getenv('DB_USER') ? getenv('DB_USER') : 'contacte';
$dbPassword = getenv('DB_PASSWD') ? getenv('DB_PASSWD') : 'ctepgSQL';

2
include/util/display_errors.php

@ -1,7 +1,7 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors', 0);
ini_set('display_errors', 1);
ini_set("memory_limit", "512M");

25
include/util/funcoesApl.php

@ -313,6 +313,9 @@ function VerificaCadastroMenu($conn) {
$menuUsuario[] = array('176', 'mnGrupoVendas', '1', 'Regionais', 'index.php?idProg=285', '', '173', '1', '0', '', '285');
}
$menuUsuario[] = array('177', 'mnCustomizados', '1', 'Customizados', 'index.php?idProg=58&idMenu=177&menuNome=Customizados', '', '17', '1', '0', '', '58');
$menuUsuario[] = array('178', 'mnRelChamadasGeral', '1', 'Chamadas Geral', 'index.php?idProg=366', '', '177', '1', '0', '', '366');
// $menuUsuario[] = array('177', 'mnAnalysis', '1', 'Gráficos', 'index.php?idProg=58&idMenu=177&menuNome=Analysis', '', '17', '1', '0', '', '58');
// $menuUsuario[] = array('178', 'mnResumoOperacao', '1', 'Resumo Chamadas/DAC', 'index.php?idProg=289', '', '177', '1', '0', '', '289');
// $menuUsuario[] = array('179', 'mnResumoOperacaoServico', '1', 'Resumo Chamadas/Serviços', 'index.php?idProg=290', '', '177', '1', '0', '', '290');
@ -384,15 +387,11 @@ function VerificaCadastroMenu($conn) {
$menuUsuario[] = array('205', 'mnListaDiscador', '1', 'Lista Discador', 'index.php?idProg=331', '', '109', '1', '0', '', '331');
// ------------------- '206' -- ESTA EM USO ALGAR
// ------------------- '207' -- ESTA EM USO ALGAR
$menuUsuario[] = array('208', 'mnPrevendaLista', '1', 'Lista Pré-venda', 'index.php?idProg=338', 'Lista Pré-Venda', '209', '1', '0', '', '338');
$menuUsuario[] = array('209', 'mnPreVenda', '1', 'Pré-Venda', 'index.php?idProg=58&idMenu=209&menuNome=' . 'Pré-Venda', '', '', '1', '0', '6', '58');
$menuUsuario[] = array('210', 'mnPreVendaPermissao', '1', 'Pré-Venda Permissão', 'index.php?idProg=338&prmPopup=1', '', '209', '1', '0', '6', '340');
$menuUsuario[] = array('211', 'mnRelPreVenda', '1', 'Relatórios Pré-Venda', 'index.php?idProg=351', 'Relatório Pré-Venda', '209', '1', '0', '6', '340');
$menuUsuario[] = array('212', 'mnRelComissao', '1', 'Relatórios Comissão', 'index.php?idProg=352', 'Relatórios Comissão', '209', '1', '0', '6', '340');
$menuUsuario[] = array('213', 'mnRelWhatsApp', '1', 'Atendimento WhatsApp', 'index.php?idProg=353', '', '18', '1', '0', '', '353');
$menuUsuario[] = array('214', 'mnSimplesChat', '1', 'ChannelChat', 'index.php?idProg=355', '', '1', '1', '0', '', '355');
// $menuUsuario[] = array('208', 'mnPrevendaLista', '1', 'Lista Pré-venda', 'index.php?idProg=338', 'Lista Pré-Venda', '209', '1', '0', '', '338');
// $menuUsuario[] = array('209', 'mnPreVenda', '1', 'Pré-Venda', 'index.php?idProg=58&idMenu=209&menuNome=' . 'Pré-Venda', '', '', '1', '0', '6', '58');
// $menuUsuario[] = array('210', 'mnPreVendaPermissao', '1', 'Pré-Venda Permissão', 'index.php?idProg=338&prmPopup=1', '', '209', '1', '0', '6', '340');
// $menuUsuario[] = array('211', 'mnRelPreVenda', '1', 'Relatórios Pré-Venda', 'index.php?idProg=351', 'Relatório Pré-Venda', '209', '1', '0', '6', '340');
// $menuUsuario[] = array('212', 'mnRelComissao', '1', 'Relatórios Comissão', 'index.php?idProg=352', 'Relatórios Comissão', '209', '1', '0', '6', '340');
if (UseModVendas()) {
$menuUsuario[] = array('215', 'mnDashboard', '1', 'Dashboard ' . MenuVendas(), 'index.php?idProg=358', '', '173', '1', '0', '', '358');
@ -422,13 +421,14 @@ function VerificaCadastroMenu($conn) {
}
//registro apgados com sucesso
if ($result) {
if(!IsAdmin()){
$permissions = existLicense($conn);
foreach ($menuUsuario as $key => $value) {
if (!in_array($value[0], $permissions) && ($value[0] != '112')) {
unset($menuUsuario[$key]);
}
}
}
//recria o menu no banco de dados
foreach ($menuUsuario as $key => $value) {
@ -650,7 +650,7 @@ function GetIdSysAdmin($dbcon) {
}
function __GetLoginFromId($id) {
if ($id < 0) {
if ($id && $id < 0) {
$gpId = abs($id);
$query = "select gp_nome from pbx_grupo where gp_id = '$gpId'";
} else {
@ -1135,6 +1135,7 @@ function GetDispProgSel($idProg) {
$dispProgSel[356] = 'SimplesChat';
$dispProgSel[358] = 'Dashboard';
$dispProgSel[365] = 'Recebidas Agente/Serviços';
$dispProgSel[366] = 'Relatório Chamadas Geral';
$dispProgSel[10001] = "Cadastro de Agentes PBX";
$dispProgSel[10002] = "Cadastro de Filas";
@ -1916,7 +1917,7 @@ function SetModuAtendimentoDefault() {
}
function GetVersao() {
return "1.7.11.12";
return "1.8.1";
}
function GetEncType($upload) {

6
include/util/funcoesInternas.php

@ -159,7 +159,7 @@ $funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(153,'relatorios/callcenter/metas/metricasAnualImp.php',152,0,1)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(154,'relatorios/callcenter/geral/relClassificacaoMensal.php',154,0,0)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(155,'relatorios/callcenter/geral/relClassificacaoMensalImp.php',154,0,1)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(156,'agente/agentert.php',156,0,0)";
//$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(156,'agente/agentert.php',156,0,0)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(157,'agente/monitorAgente.php',-1,9,1)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(158,'agente/monitorAgente.php',-1,9,1)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(159,'relatorios/pbx/chamadasSaintes/totalizadorCentroCusto.php',159,0,0)";
@ -253,7 +253,7 @@ $funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(281,'seguranca/grupos/grupoRevendas.php',23,0,0)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(282,'vendas/funilVendasDetalhes.php',280,0,0)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(283,'vendas/rejeitadosVendas.php',6,0,0)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(284,'agente/agenteMesa.php',284,0,0)";
//$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(284,'agente/agenteMesa.php',284,0,0)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(285,'vendas/grupoVendas.php',285,0,0)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(286,'vendas/grupoVendasCad.php',285,0,0)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(287,'vendas/grupoVendasEmpresas.php',285,0,0)";
@ -334,6 +334,8 @@ $funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(362,'seguranca/licencaUsuarioFixo.php',21,0,0)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(363,'agente/complementoCampanha.php',14,0,0)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(364,'admLgpd.php',364,0,0)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(365,'downloadRel.php',365,0,0)";
$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(366,'relatorios/custom/relChamadaGeral.php',366,0,0)";

3
projeto/base/sql/versao-1.8.1.sql

@ -0,0 +1,3 @@
-- Correcao dados tipo preco
update pbx_tarifa_tipo_preco set ttp_descricao = 'Móvel Local' where ttp_id = 'vc3';
update pbx_tarifa_tipo_preco set ttp_descricao = 'Móvel Interurbano' where ttp_id = 'vc4';

5
recuperarsenha.php

@ -15,6 +15,11 @@
}
$account = verificaEmail($dbcon, $email);
if(!$account){
throw new Exception("O email informado não foi encontrado!");
}
$token = md5($account['id'] . $account['matricula'] . time());
$_SESSION['SSREcoveryPassword'] = ['token' => $token, 'id' => $account['id'], 'login' => $account['apelido']];

600
relatorios/custom/relChamadaGeral.php

@ -0,0 +1,600 @@
<?php
include_once 'util/relatoriosBase.php';
class RelChamadasGeral extends Relatorios {
private $__agente;
private $__tipoLigacao;
private $__classificacao;
private $__pesquisa;
private $__filtro;
public function __construct($idProg, $dbcon, $incDac) {
parent::__construct($idProg, $dbcon, $incDac);
$this->__agente = isset($_POST["listaAgente"]) ? $_POST["listaAgente"] : '';
$this->__tipoLigacao = isset($_POST["tipoLigacao"]) ? $_POST["tipoLigacao"] : 0;
$this->__filtro = isset($_POST["filtro"]) ? $_POST["filtro"] : '';
$this->__classificacao = isset($_POST["classificacao"]) ? $_POST["classificacao"] : '';
$this->__pesquisa = isset($_POST["pesquisa"]) ? $_POST["pesquisa"] : '';
}
function ___FiltrosRelatorio() {
if ($this->___media != MEDIA_PRINT_GRID) {
/*
* Recupera os filtros da sessão do usuário.
*/
list($this->___dac, $this->___dataIni, $this->___dataFim, $this->___tipoRelatorio, $this->___agente, $this->__classificacao, $this->__pesquisa) = $_SESSION["SSstorageFiltros"];
if ($this->___media == MEDIA_PRINT_HTML) {
$fila = $this->GetIncDac() ? 'Fila: ' . GetDacDesc($this->GetDbCon(), $this->GetIdProg() . ' ') : '';
return sprintf("%sData Inicial: %s Data Final: %s Tipo: %s", $fila, $this->___dataIni, $this->___dataFim, ($this->___tipoRelatorio ? 'Analítico' : 'Sintético'));
}
$fltCsv = array();
if ($this->GetIncDac()) {
$fltCsv[] = 'Fila:' . GetDacDesc($this->GetDbCon(), $this->___dac);
}
$fltCsv[] = "Data Inicial:" . $this->___dataIni;
$fltCsv[] = "Data Final:" . $this->___dataFim;
$fltCsv[] = "Data Emissao:" . date('d/m/Y H:i:s');
$fltCsv[] = "Emitido Por:" . GetLogin();
return $fltCsv;
}
if ($this->GetIncDac()) {
$dacs = GetDac($this->GetDbCon(), $this->___dac, "", 0, 1, 0, 0, 1);
}
$agentes = $this->getAgentes();
$lkPrint = "";
if ($this->___dataCount) {
$prt = '<a href="index.php?idProg=%s&media=%s&tipoRelatorio=%s"><img src="imgSite/%s" alt="Clique aqui para imprimir!" width="24" height="24" border="0"></a>';
$prtHtml = "<a href=\"javaScript:NovaJanela('index.php?idProg=%s&media=%s&tipoRelatorio=%s', '%s', '720', '700', 'scrollbars=YES');\"><img src=\"imgSite/%s\" alt=\"Clique aqui para imprimir!\" width=\"24\" height=\"24\" border=\"0\"></a>";
$lkPrint .= sprintf($prtHtml, $this->GetidProg(), MEDIA_PRINT_HTML, $this->___tipoRelatorio, substr(LimpaString(GetDispProgSel($this->GetIdProg())), 0, 20), 'print.gif');
$lkPrint .= sprintf($prt, $this->GetidProg(), MEDIA_PRINT_EXCEL, $this->___tipoRelatorio, 'prt-xls.png');
$lkPrint .= sprintf($prt, $this->GetidProg(), MEDIA_PRINT_PDF, $this->___tipoRelatorio, 'prt-pdf.png');
$lkPrint .= sprintf($prt, $this->GetidProg(), MEDIA_PRINT_CSV, $this->___tipoRelatorio, 'prt-csv.png');
}
$tipoRel = !$this->___tipoRelatorio ? '' : 'checked="checked"';
/*
* Personalise esta funcao se necessitar de outras opcoes de filtro.
*/
$filtro = '<table border="0" cellspacing="1" cellpadding="1">';
/*
* Rotulos.
*/
$filtro .= '<tr>';
$filtro .= '<td>Data Inicial</td>';
$filtro .= '<td>Data Final </td>';
if ($this->GetIncDac()){
$filtro .= '<td>Fila</td>';
}
$filtro .= '<td align="center" valign="middle">Agente</td>';
$filtro .= '<td align="center" valign="middle">Filtro</td>';
$class = $this->__classificacao ? "checked" : '';
$pesq = $this->__pesquisa ? "checked" : '';
$filtro .= sprintf('<td>'
. '<table>'
. '<tr><td>'
. '<div class="geral">'
. '<input name="classificacao" id="tipoLigacao" type="checkbox" size="15" class="clean" %s value="classificacao"/> Classificação &nbsp'
. '<input name="pesquisa" id="tipoLigacao" type="checkbox" size="15" class="clean" %s value="pesquisa"/> Pesquisa &nbsp'
. '</div>'
. '</td></tr>'
. '</table></td>', $class, $pesq);
$filtro .= '</tr>';
/*
* Valores.
*/
$filtro .= '<tr>';
$filtro .= '<td><input name="dataIni" id="dataIni" type="text" size="15" maxlength="10" value="%s" onkeyup="formataData(this)" title="dd/mm/aaaa"></td>';
$filtro .= '<td><input name="dataFim" id="dataFim" type="text" size="15" maxlength="10" value="%s" onkeyup="formataData(this)" title="dd/mm/aaaa"></td>';
if ($this->GetIncDac()){
$filtro .= sprintf('<td>%s</td>', $dacs);
}
$filtro .= "<td>$agentes</td>";
$filtro .= sprintf('<td><input name="filtro" id="filtro" type="text" size="24" placeholder="Protocolo/Telefone/Ramal" value="%s" /></td>', $this->__filtro);
$entrada = $this->__tipoLigacao == 2 ? "checked" : "";
$saida = $this->__tipoLigacao == 3 ? "checked" : "";
$ambos = $this->__tipoLigacao == 0 ? "checked" : "";
$filtro .= sprintf('<td>'
. '<table><tr><td><div class="geral">'
. '<input name="tipoLigacao" id="tipoLigacao" type="radio" size="15" class="clean" %s value="2"/>Entrada &nbsp'
. '<input name="tipoLigacao" id="tipoLigacao" type="radio" size="15" class="clean" %s value="3"/>Saída &nbsp'
. '<input name="tipoLigacao" id="tipoLigacao" type="radio" size="15" class="clean" %s value="0"/>Ambos'
. '</div></td></tr></table>'
. '</td>', $entrada, $saida, $ambos);
$filtro .= '<td><input type="submit" name="btConsulta" id="btConsulta" value="Consultar"></td>';
$filtro .= '<td>%s</td>';
$filtro .= '</tr>';
$filtro .= '</table>';
/*
* Guarda os filtros passados para recuperar na emissão dos relatóios para impressão.
*/
$_SESSION["SSstorageFiltros"] = array($this->___dac, $this->___dataIni, $this->___dataFim, $this->___tipoRelatorio, $this->___agente, $this->__classificacao, $this->__pesquisa);
return sprintf($filtro, $this->___dataIni, $this->___dataFim, $lkPrint);
}
protected function ___GetDadosDb() {
$dataIni = FormatDtMssql($this->___dataIni);
$dataFim = FormatDtMssql($this->___dataFim);
$classificacao = $this->__classificacao ? "LEFT JOIN (SELECT id_bilhetes, STRING_AGG(remove_acentos(clas_descricao || ' -> ' || clit_descricao) , '; ' ORDER BY cr.clas_id) AS classificacao
FROM pbx_classifica_reg cr
INNER JOIN pbx_classifica_atendimento ca ON cr.clas_id = ca.clas_id
INNER JOIN pbx_classifica_item ci ON cr.clit_id = ci.clit_id
WHERE data_reg::DATE >= '$dataIni' AND data_reg::DATE <= '$dataFim'
GROUP BY id_bilhetes) AS class ON class.id_bilhetes = a.uniqueid": '';
$pesquisa = $this->__pesquisa ? "LEFT JOIN (SELECT a.uniqueid, STRING_AGG(remove_acentos(pq_questao || ' -> ' || po_opcao) , '; ' ORDER BY po_display) AS pesquisa
FROM pbx_pesquisa_movimento a
INNER JOIN pbx_pesquisa_questoes b ON b.pp_id = a.pp_id AND b.pq_id = a.pq_id
INNER JOIN pbx_pesquisa_opcoes c ON c.pp_id = b.pp_id AND c.pq_id = b.pq_id AND c.po_id = a.po_id
INNER JOIN pbx_pesquisa_regitra d ON d.uniqueid = a.uniqueid
INNER JOIN pbx_pesquisa e ON e.pp_id = a.pp_id
WHERE a.data_reg::DATE >= '$dataIni' AND a.data_reg::DATE <= '$dataFim'
GROUP BY a.uniqueid) AS pesq ON pesq.uniqueid = a.uniqueid" : '';
$columnPesq = $this->__pesquisa ? "pesquisa," : "";
$columnClass = $this->__classificacao ? "classificacao," : "";
$query = "SELECT calldate, protocolo, src, dst, tplg_descricao,
CASE WHEN(ed.evento = 'ABANDON')THEN strtoint(ed.param3) ELSE a.billsec END AS tempo_atendimento,
userfield, fila, apelido, evento, $columnClass $columnPesq
REPLACE(SUBSTRING(retorno_cliente, POSITION('||' in retorno_cliente), 99999), '||', '') AS dados_cliente,
CASE WHEN (abdsr_agente IS NOT NULL) THEN 'RETORNADA' ELSE '-' END AS retorno_abd
FROM pbx_bilhetes a
LEFT JOIN pbx_eventos_dacs ed ON a.uniqueid = ed.uid2 AND evento IN ('COMPLETAAGENT','COMPLETACALLERRAMAL','COMPLETACALLER','COMPLETECALLERRAMAL','COMPLETEAGENT','COMPLETEAGENTRAMAL','COMPLETECALLER','ABANDON')
LEFT JOIN pbx_usuarios us ON us.matricula = substring(ed.agente,7,4)
LEFT JOIN pbx_protocolo_reg pr ON pr.uniqueid = a.uniqueid
LEFT JOIN pbx_tipo_ligacao tp ON tp.tplg_codigo = a.tipo_chamada
$classificacao
$pesquisa
LEFT JOIN pbx_abandonadas_semretorno asr ON asr.abdsr_uniqueid = a.uniqueid
LEFT JOIN pbx_integracao_reg ir ON ir.reg_uniqueid = a.uniqueid
LEFT JOIN pbx_queues_grupos qg ON qg.nome = ed.fila
WHERE calldate::DATE >= '$dataIni' AND calldate::DATE <= '$dataFim'
AND a.lastapp NOT IN ('Transferred Call','Playback','BackGround', 'AppDial2', 'Goto') ";
if($this->__filtro){
$query .= "AND ((src LIKE '%{$this->__filtro}%') OR (dst LIKE '%{$this->__filtro}%') OR (protocolo::VARCHAR LIKE '%{$this->__filtro}%')) ";
}
if($this->___dac){
$query .= "AND qg.id = {$this->___dac} ";
}
if($this->__tipoLigacao){
$query .= "AND tplg_tipo = {$this->__tipoLigacao} ";
}
$query .= "ORDER BY a.uniqueid";
$result = $this->___GetQuery($query);
$row = pg_fetch_all($result);
$this->SetData($row ? $row : array());
}
protected function ___PreparaCsv() {
$dataRel = array();
$filtro = $this->___FiltrosRelatorio();
/*
* Inicia o relatório.
*/
$dataRel[] = GenerateCsvFromArray($filtro);
$dadosCabecalio = array(
'Data Hora',
'Tipo',
'Protocolo',
'Origem',
'Destino',
'Duração',
'Fila',
'Agente',
'Status',
'Retornada ABD.',
);
$this->__classificacao ? $dadosCabecalio[] = 'Classificação' : '';
$this->__pesquisa ? $dadosCabecalio[] = 'Pesquisa' : '';
$dadosField = array(
'calldate',
'tplg_descricao',
'protocolo',
'src',
'dst',
'tempo_atendimento',
'fila',
'apelido',
'evento',
'retorno_abd'
);
$this->__classificacao ? $dadosField[] = 'classificacao' : '';
$this->__pesquisa ? $dadosField[] = 'pesquisa' : '';
/*
* Monta a linha de cabecalio.
*/
$dataRel[] = GenerateCsvFromArray($dadosCabecalio);
/*
* Linhas de dados.
*/
foreach ($this->GetData()[0] as $row) {
$row['calldate'] = date('d/m/Y H:i:s', strtotime($row['calldate']));
$row['tempo_atendimento'] = SecondToStrTime($row["tempo_atendimento"]);
$row['retorno_abd'] = $row["retorno_abd"] ? $row["retorno_abd"] : '-';
$row['evento'] = $this->__statusEventos($row['evento']);
$row['protocolo'] = $row['protocolo'] ? $row['protocolo'] : '-';
$row['apelido'] = $row['apelido'] ? $row['apelido'] : '-';
$row['classificacao'] = $row['classificacao'] ? RemoveAcentos($row['classificacao']) : '-';
$row['pesquisa'] = $row['pesquisa'] ? RemoveAcentos($row['pesquisa']) : '-';
// Formata linha de dados.
$linha = array();
foreach ($dadosField as $value) {
$linha[] = $row["$value"];
}
$dataRel[] = GenerateCsvFromArray($linha);
}
$dataRel[] = GenerateCsvFromArray(array('Total', ''));
$this->___dataRel[] = $dataRel;
}
protected function ___PreparaExcel() {
$dataRel = array();
$filtro = $this->___FiltrosRelatorio();
/*
* Inicia o relatório.
*/
/*
* Cria os filtros
*/
$linha = array('LABEL');
foreach ($filtro as $values) {
list($label, $value) = explode(":", $values);
$linha[] = $label;
}
$dataRel[] = $linha;
$linha = array('DADOS');
foreach ($filtro as $values) {
list($label, $value) = explode(":", $values);
$linha[] = $value;
}
$dataRel[] = $linha;
$dadosCabecalio = array(
'Data Hora',
'Tipo',
'Protocolo',
'Origem',
'Destino',
'Duracao',
'Fila',
'Agente',
'Status',
'Retornada ABD.',
);
$this->__classificacao ? $dadosCabecalio[] = 'Classificacao' : '';
$this->__pesquisa ? $dadosCabecalio[] = 'Pesquisa' : '';
$dadosField = array(
'calldate',
'tplg_descricao',
'protocolo',
'src',
'dst',
'tempo_atendimento',
'fila',
'apelido',
'evento',
'retorno_abd'
);
$this->__classificacao ? $dadosField[] = 'classificacao' : '';
$this->__pesquisa ? $dadosField[] = 'pesquisa' : '';
/*
* Monta a linha de cabecalio.
*/
$linha = array('LABEL');
foreach ($dadosCabecalio as $value) {
$linha[] = $value;
}
$dataRel[] = $linha;
/*
* Linhas de dados.
*/
foreach ($this->GetData()[0] as $row) {
$row['calldate'] = date('d/m/Y H:i:s', strtotime($row['calldate']));
$row['tempo_atendimento'] = SecondToStrTime($row["tempo_atendimento"]);
$row['retorno_abd'] = $row["retorno_abd"] ? $row["retorno_abd"] : '-';
$row['evento'] = $this->__statusEventos($row['evento']);
$row['protocolo'] = $row['protocolo'] ? $row['protocolo'] : '-';
$row['apelido'] = $row['apelido'] ? $row['apelido'] : '-';
$row['classificacao'] = $row['classificacao'] ? RemoveAcentos($row['classificacao']) : '-';
$row['pesquisa'] = $row['pesquisa'] ? RemoveAcentos($row['pesquisa']) : '-';
// Formata linha de dados.
$linha = array('DADOS');
foreach ($dadosField as $key) {
$linha[] = $row["$key"];
}
$dataRel[] = $linha;
}
$dataRel[] = array('LABEL', 'Total');
$this->___dataRel[] = $dataRel;
}
protected function ___PreparaGrid() {
$dataRel = array();
$dadosCabecalio = array(
'Data Hora' => 'align="center"',
'Tipo' => 'align="center"',
'Protocolo' => 'align="center"',
'Origem' => 'align="center"',
'Destino' => 'align="center"',
'Duração' => 'align="center"',
'Fila' => 'align="center"',
'Agente' => 'align="center"',
'Status' => 'align="center"',
'Retornada ABD.' => 'align="center"',
);
$this->__classificacao ? $dadosCabecalio['Classificação'] = 'align="center"' : '';
$this->__pesquisa ? $dadosCabecalio['Pesquisa'] = 'align="center"' : '';
$dadosField = array(
'calldate' => 'align="center"',
'tplg_descricao' => 'align="center"',
'protocolo' => 'align="center"',
'src' => 'align="center"',
'dst' => 'align="center"',
'tempo_atendimento' => 'align="center"',
'fila' => 'align="center"',
'apelido' => 'align="center"',
'evento' => 'align="center"',
'retorno_abd' => 'align="center"'
);
$this->__classificacao ? $dadosField['classificacao'] = 'align="center"' : '';
$this->__pesquisa ? $dadosField['pesquisa'] = 'align="center"' : '';
/*
* Inicia o relatório.
*/
$dataRel[] = '<table width="100%" cellpadding="2" class="grid">';
/*
* Monta a linha de cabecalio.
*/
$linha = '<tr>';
foreach ($dadosCabecalio as $key => $value) {
$linha .= sprintf("<th %s>%s</th>", $value, $key);
}
$linha .= "</tr>";
$dataRel[] = $linha;
/*
* Verifica se retornou dados
*/
if (!IsPostBack() || !count($this->GetData()[0])) {
$dataRel[] = sprintf("<tr><td align=\"center\" colspan=\"%s\">%s</td></tr></table>", count($dadosCabecalio), (!IsPostBack() ? 'Informe os parametros e clique em consultar!' : 'Nenhum registro encontado!'));
$this->___dataRel[] = $dataRel;
return;
}
/*
* Linhas de dados.
*/
foreach ($this->GetData()[0] as $row) {
$row['calldate'] = date('d/m/Y H:i:s', strtotime($row['calldate']));
$row['tempo_atendimento'] = SecondToStrTime($row["tempo_atendimento"]);
$row['retorno_abd'] = $row["retorno_abd"] ? $row["retorno_abd"] : '-';
$row['evento'] = $this->__statusEventos($row['evento']);
$row['protocolo'] = $row['protocolo'] ? $row['protocolo'] : '-';
$row['apelido'] = $row['apelido'] ? $row['apelido'] : '-';
$row['classificacao'] = $row['classificacao'] ? $row['classificacao'] : '-';
$row['pesquisa'] = $row['pesquisa'] ? $row['pesquisa'] : '-';
// Formata linha de dados.
$linha = "<tr>";
foreach ($dadosField as $key => $value) {
$linha .= sprintf("<td %s>%s</td>", $value, $row["$key"]);
}
$linha .= "</tr>";
$dataRel[] = $linha;
}
/*
* Linha de totalizacao.
*/
$linha = '<tr><th align="left">Total</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>';
$dataRel[] = sprintf($linha, '');
/*
* Fecha relatorio.
*/
$dataRel[] = '</table>';
$this->___dataRel[] = $dataRel;
}
protected function ___PreparaHtml() {
}
protected function ___PreparaPdf() {
list($this->___dac, $this->___dataIni, $this->___dataFim, $this->___tipoRelatorio, $this->___agente, $this->__classificacao, $this->__pesquisa) = $_SESSION["SSstorageFiltros"];
$this->settype("L");
/**
* TABELA DADOS PRINCIPAIS
*/
$dadosCabecalio = array(
'Data Hora' => 'C',
'Tipo' => 'C',
'Protocolo' => 'C',
'Origem' => 'C',
'Destino' => 'C',
'Duração' => 'C',
'Fila' => 'C',
'Agente' => 'C',
'Status' => 'C',
'Retornada ABD.' => 'C',
);
$this->__classificacao ? $dadosCabecalio['Classificação'] = 'C' : '';
$this->__pesquisa ? $dadosCabecalio['Pesquisa'] = 'C' : '';
$dadosField = array(
'calldate' => 'C',
'tplg_descricao' => 'C',
'protocolo' => 'C',
'src' => 'C',
'dst' => 'C',
'tempo_atendimento' => 'C',
'fila' => 'C',
'apelido' => 'C',
'evento' => 'C',
'retorno_abd' => 'C'
);
$this->__classificacao ? $dadosField['classificacao'] = 'C' : '';
$this->__pesquisa ? $dadosField['pesquisa'] = 'C' : '';
$dados = $this->GetData()[0];
$x = 0;
foreach ($dados as $row) {
$dados[$x]['calldate'] = date('d/m/Y H:i:s', strtotime($row['calldate']));
$dados[$x]['tempo_atendimento'] = SecondToStrTime($row["tempo_atendimento"]);
$dados[$x]['retorno_abd'] = $row["retorno_abd"] ? $row["retorno_abd"] : '-';
$dados[$x]['evento'] = $this->__statusEventos($row['evento']);
$dados[$x]['protocolo'] = $row['protocolo'] ? $row['protocolo'] : '-';
$dados[$x]['apelido'] = $row['apelido'] ? $row['apelido'] : '-';
$dados[$x]['classificacao'] = $row['classificacao'] ? $row['classificacao'] : '-';
$dados[$x]['pesquisa'] = $row['pesquisa'] ? $row['pesquisa'] : '-';
$x++;
}
$widthHeader = array(25, 28, 17, 17, 17, 17, 23, 18, 35, 20);
$this->__classificacao ? $widthHeader[] = 30 : '';
$this->__pesquisa ? $widthHeader[] = 30 : '';
$totalizador = array('Total' , '');
//Monta o array para passar para o prepara; Necessário passar 6 parametros
$table1 = array($dadosCabecalio, $dadosField, $dados, $widthHeader, $totalizador, 1);
$this->___dataRel = array($table1);
}
protected function getAgentes() {
$sel = $this->__agente ? '' : 'selected';
$agentes = "<select name=\"listaAgente\" id=\"listaAgente\" size=\"1\">";
$agentes .= "<option value=\"0\" $sel>Todos</option>";
$query = sprintf("SELECT apelido AS nome
FROM pbx_usuarios u
WHERE EXISTS(SELECT '' FROM pbx_eventos_agentes WHERE matricula = u.matricula
AND CAST(login as date) >= '%s'
AND CAST(login as date) <= '%s')", $this->___dac, FormatDtMssql($this->___dataIni), FormatDtMssql($this->___dataFim));
$result = pg_query($query);
if($result){
while ($dados = pg_fetch_row($result)) {
if ($codSel == $dados[0]) {
$sel = "selected";
$i = 1;
} else {
$sel = "";
}
$agentes .= "<option value=\"$dados[0]\" $sel>$dados[0]</option>";
}
}
$agentes .= "</select>";
return $agentes;
}
public function __statusEventos($status){
// 'COMPLETECALLER', 'COMPLETEAGENTRAMAL'
$eventos = [
'COMPLETAAGENT' => "ATENDIDA - DESL. AGENTE",
'COMPLETACALLERRAMAL' => "ATENDIDA - DESL. CLIENTE",
'COMPLETACALLER' => "ATENDIDA - DESL. CLIENTE",
'COMPLETECALLERRAMAL' => "ATENDIDA - DESL. CLIENTE",
'COMPLETEAGENT' => "ATENDIDA - DESL. AGENTE",
'COMPLETEAGENTRAMAL' => "ATENDIDA - DESL. AGENTE",
'COMPLETECALLER' => "ATENDIDA - DESL. CLIENTE",
'ABANDON' => "ABANDONADA",
'TRANSFER' => "TRANSFERIDA",
'BUSY' => "OCUPADA",
];
return $eventos[$status];
}
public function ExecutaRelatorio() {
global $jsStartup, $jsJQuery, $smarty;
try {
/*
* Use esta função para validar dados do formulário.
*/
$this->___ValidaForm();
/*
* Recupera os dados do banco.
*/
$this->___ConteudoRelatorio();
/*
* Imprime relatório de acordo com a media passada.
*/
$conteudoRelatorio = $this->___ImprimeRelatorio();
} catch (Exception $exc) {
$this->SetMsg($exc->getMessage());
$jsStartup[] = sprintf("alert('%s');", $this->GetMsg());
$this->___GravaLog();
}
/*
* Inclua os scripts necessários aqui.
*/
$jsJQuery[] = "\$('#dataIni').keypress(function(){formataDataHora(this);}) ";
$jsJQuery[] = "\$('#dataFim').keypress(function(){formataDataHora(this);}) ";
$smarty->assign('filtros', $this->___FiltrosRelatorio());
$smarty->assign('conteudo', $conteudoRelatorio);
$smarty->assign('msg', $this->GetMsg());
GetTemplate($smarty, 'relatoriosGrid.tpl');
}
}
$relChamadasGeral = new RelChamadasGeral($idProg, $dbcon, 1);
$relChamadasGeral->ExecutaRelatorio();
?>

32
relatorios/pbx/chamadasSaintes/saintesCentroCusto.php

@ -29,7 +29,7 @@
GeraExcept('Informe uma empresa!');
}
if (!$this->___tempoDuracao) {
GeraExcept('Informe um tempo de duração!');
GeraExcept('Informe um tempo de duração!');
}
}
@ -37,7 +37,7 @@
global $dbcon;
if ($this->___media != MEDIA_PRINT_GRID) {
/*
* Recupera os filtros da sess�o do usu�rio.
* Recupera os filtros da sess�o do usu�rio.
*/
list($this->___dataIni, $this->___dataFim, $this->___listaDptos, $this->___listaEmpresa, $this->___tempoDuracao) = $_SESSION["SSstorageFiltros"];
@ -64,7 +64,7 @@
}
/*
* Personalise esta função se necessitar de outras opções de filtro.
* Personalise esta função se necessitar de outras opções de filtro.
*/
$filtro = '<table class="filtro" border="0" cellspacing="1" cellpadding="1">';
/*
@ -76,7 +76,7 @@
$filtro .= '<td>Data Final </td>';
$filtro .= '<td>Empresa </td>';
$filtro .= '<td>Depto. </td>';
$filtro .= '<td>Duração</td>';
$filtro .= '<td>Duração</td>';
$filtro .= '<td align="center" valign="middle">&nbsp;</td>';
$filtro .= '</tr>';
@ -100,7 +100,7 @@
$filtro .= '</table>';
/*
* Guarda os filtros passados para recuperar na emiss�o dos relat?ios para impress�o.
* Guarda os filtros passados para recuperar na emissao dos relatoios para impressao.
*/
$_SESSION["SSstorageFiltros"] = array($this->___dataIni, $this->___dataFim);
@ -179,7 +179,7 @@
$somaQuantidade = 0;
/*
* Inicia o relat�rio.
* Inicia o relat�rio.
*/
foreach ($this->GetData()[0] as $row) {
$somaTempo += $row["duracao"];
@ -211,7 +211,7 @@
$filtro = $this->___FiltrosRelatorio();
/*
* Inicia o relatório.
* Inicia o relatório.
*/
/*
@ -278,10 +278,10 @@
$dataAgrup = array();
$dadosCabecalio = array('Ramal' => 'align="center"', 'Destino' => 'align="center"', 'Conta' => 'align="left"', 'Usuário' => 'align="left"', 'Data/Hora' => 'align="center"', 'Duração' => 'align="center"');
$dadosCabecalio = array('Ramal' => 'align="center"', 'Destino' => 'align="center"', 'Conta' => 'align="left"', 'Usuário' => 'align="left"', 'Data/Hora' => 'align="center"', 'Duração' => 'align="center"');
$dadosField = array('src' => 'align="center"', 'dst' => 'align="center"', 'matricula' => 'align="left"', 'apelido' => 'align="left"', 'data' => 'align="center"', 'duracao' => 'align="center"');
/*
* Inicia o relat�rio.
* Inicia o relat�rio.
*/
$dataRel[] = '<table width="800" cellpadding="2" class="grid">';
@ -365,9 +365,9 @@
'Ramal' => 'C',
'Destino' => 'C',
'Conta' => 'L',
'Usuário' => 'L',
'Usuário' => 'L',
'Data/Hora' => 'C',
'Duração' => 'C'
'Duração' => 'C'
);
$dataHeader = array(
'src' => 'C',
@ -378,9 +378,9 @@
'duracao' => 'C'
);
$widthHeader = array(20, 30, 35, 35, 35, 35);
$totaliza = array('Total', '','', "Registros: " . $somaQtd, '', "Duração: " . SecondToStrTime($somaTempo));
$totaliza = array('Total', '','', "Registros: " . $somaQtd, '', "Duração: " . SecondToStrTime($somaTempo));
//Monta o array para passar para o prepara; Necessário passar 6 parametros
//Monta o array para passar para o prepara; Necessário passar 6 parametros
$table1 = array($header, $dataHeader, $dados, $widthHeader, $totaliza, 0);
$this->___dataRel = array($table1);
@ -390,7 +390,7 @@
global $jsStartup, $jsJQuery, $smarty;
try {
/*
* Use esta fun��o para validar dados do formul�rio.
* Use esta fun��o para validar dados do formul�rio.
*/
$this->___ValidaForm();
@ -400,7 +400,7 @@
$this->___ConteudoRelatorio();
/*
* Imprime relat�rio de acordo com a media passada.
* Imprime relat�rio de acordo com a media passada.
*/
$conteudoRelatorio = $this->___ImprimeRelatorio();
} catch (Exception $exc) {
@ -410,7 +410,7 @@
}
/*
* Inclua os scripts necess�rios aqui.
* Inclua os scripts necess�rios aqui.
*/
$jsJQuery[] = "\$('#dataIni').keypress(function(){formataDataHora(this);}) ";
$jsJQuery[] = "\$('#dataFim').keypress(function(){formataDataHora(this);}) ";

7
scriptApl/functions15.js

@ -249,11 +249,18 @@ function GetDadosAgenteRt()
if (GetStatusAjax())
{
//Dados retornados em uma string
var listaSuper = $.trim(ajax.responseText);
var tb = listaSuper.split('@');
var dadosAgente = new Object();
var checaLogoff = $.trim(tb[0].substr(0, 5).toUpperCase());
var chanellTransf = '';
var error = listaSuper.split('@@');
if(error[0].toUpperCase() == 'ERROR'){
alert(error[1])
$('#msg_sis').text(error[1])
}
//document.getElementById('msg_sis').innerHTML = 'Status Logoff: ' + checaLogoff + ' Lista: ' + listaSuper + ' array: ' + tb[0];
if (checaLogoff == 'CLOSE')
{

161
scriptApl/supervisorchat.js

@ -27,148 +27,6 @@ const desconectMesa = async () => {
})
}
const finalizarAtendimento = (uniqueid, matricula) => {
$.ajax({
url: localStorage.getItem('chatserverapi') + '/integracao/media/api/agente/finalizarAtendimento',
type: "POST",
data: JSON.stringify({
matricula,
uniqueid
}),
success: function (res) {
if (res.status == "success") {
console.log(res)
}
}
});
}
const atendimentoAgente = (matricula) => {
$.ajax({
url: localStorage.getItem('chatserverapi') + '/integracao/media/api/agente/listarAtendimentoAgente',
type: "POST",
data: JSON.stringify({
matricula
}),
success: function (res) {
if (res.status == "success") {
const atOn = []
res.data.forEach((el) => {
let id_unique = el.uniqueid.replace('.', `\\.`)
if (el.evento == 'START' && $("#" + id_unique).length == 0) {
let tipo = el.direcao == 'E' ? 'Entrada' : 'Saída';
let plataforma = el.context.charAt(0).toUpperCase() + el.context.slice(1);
let dataParse = new Date(el.data_reg).toLocaleString()
const tempo = timeDiffCalc(new Date(el.data_reg), new Date())
$('#tableChatAgente tbody').append(`<tr id="${el.uniqueid}">
<td align="center">${el.profile_name}</td>
<td align="center">${el.cliente_id}</td>
<td align="center">${plataforma}</td>
<td align="center">${dataParse}</td>
<td align="center" id="${el.uniqueid}_tempo">${tempo}</td>
<td align="center">${tipo}</td>
<td align="center">${el.protocolo}</td>
<td align="center">
<a onclick="finalizarAtendimento('${el.uniqueid}','${el.matricula}')" style='cursor: pointer'>
<img src="imgSite/exit16.png" width="16" height="16" border="0" title="Finalizar atendimento" alt="Finalizar atendimento">
</a>
</td>
</tr>`);
} else if ($("#" + id_unique).length > 0) {
$("#" + id_unique + "_tempo").text(timeDiffCalc(new Date(el.data_reg), new Date()))
}
if (el.evento == 'START') {
atOn.push(el.uniqueid);
}
})
const ids = []
$("#tableChatAgente tbody").find("tr").each(function () {
ids.push(this.id);
});
ids.forEach((el) => {
if (atOn.indexOf(el) < 0) {
$("#" + el.replace('.', `\\.`)).remove()
}
})
}
}
});
setTimeout(() => {
atendimentoAgente(matricula)
}, 1200);
}
const atualizaStatusAgente = (matricula) => {
$.ajax({
url: localStorage.getItem('chatserverapi') + '/integracao/media/api/agente/statusAgente',
type: "POST",
data: JSON.stringify({
matricula
}),
success: function (res) {
if (res.status == "success") {
$('#status_agente').text(() => {
if ($(this).text() != res.data.status) {
return res.data.status
}
})
$('#pausa_agente').text(() => {
if ($(this).text() != res.data.motivo_pausa) {
return res.data.motivo_pausa ? res.data.motivo_pausa : '-'
}
})
$('#atendimento_agente').text(() => {
if ($(this).text() != res.data.numero_atendimento) {
return res.data.numero_atendimento
}
})
}
}
});
setTimeout(() => {
atualizaStatusAgente(matricula)
}, 3000);
}
const finalizarAgente = (matricula) => {
$.ajax({
url: localStorage.getItem('chatserverapi') + '/integracao/media/api/agente/sair',
type: "POST",
data: JSON.stringify({
matricula
}),
success: function (res) {
if (res.status == "success") {
alert('Agente foi desconectado')
}
}
});
}
const sairPausa = (matricula) => {
$.ajax({
url: localStorage.getItem('chatserverapi') + '/integracao/media/api/agente/sairPausa',
type: "POST",
data: JSON.stringify({
matricula
}),
success: function (res) {
if (res.status == "success") {
alert('Agente removido de pausa!')
}
}
});
}
const criarGrid = (data) => {
let cont = 0
let line = ''
@ -184,6 +42,11 @@ const criarGrid = (data) => {
}
cdata++
})
if(cont <= 4){
rline += `<tr>${line}</tr>`
}
$('#dadosContato').append(rline);
}
@ -201,7 +64,7 @@ const HangupCall = (id) => {
const AtualizaChamdas = () => {
if(localStorage.getItem('monitorRamaisStatus') != 'OK'){
if(!localStorage.getItem('monitorRamaisStatus')){
return
}
@ -212,7 +75,6 @@ const AtualizaChamdas = () => {
if (res) {
let lrow = []
let crow = 0
let status
Object.keys(res).forEach((el) => {
if (res[el].Status == localStorage.getItem('monitorRamaisStatus') || res[el].Status.indexOf(localStorage.getItem('monitorRamaisStatus')) >= 0) {
let direct = ''
@ -229,12 +91,12 @@ const AtualizaChamdas = () => {
status = `<img src="imgSite/Warning.png" width="12px" align="absmiddle" style="margin-top:-2px"> INATIVO`
}
let tbl = `<table align='center' style='border: 1px solid #D7D7D7;border-collapse: collapse;padding: 15px;' id='tblFunc'><tr>`
if (res[el].CallChannel) {
/** ATIVACAO DO HUNGUP NA TELA DA MESA **/
// let tbl = `<table align='center' style='border: 1px solid #D7D7D7;border-collapse: collapse;padding: 15px;' id='tblFunc'><tr>`
// if (res[el].CallChannel) {
// /** ATIVACAO DO HUNGUP NA TELA DA MESA **/
// tbl += `<td><a id='${res[el].CallChannel}' href="#" onClick='HangupCall(this.id)'><img src='imgSite/exit16.png' background-repeat: no-repeat;border:0;padding-top:0"></a></td>`
}
tbl += `</tr></table>`
// }
// tbl += `</tr></table>`
lrow.push({
ramal: res[el].ObjectName,
@ -243,7 +105,6 @@ const AtualizaChamdas = () => {
<p>${res[el].Duration} - ${direct}</p>
<p>${status}</p>
<p>${res[el].Status}</p>
${tbl}
</th>`})
crow++
}

2
scriptApl/utils.js

@ -581,7 +581,7 @@ function limpaEspaco(campo) {
function DeletaUser(id, params) {
if (confirm('Esta ação irá excluir o usuário! Deseja continuar?'))
if (confirm('Esta ação irá desabilitar o usuário! Deseja continuar?'))
{
window.location.href = 'index.php?idProg=21&idDelete=' + id + params;
}

4
seguranca/grupos/grupoInsert.php

@ -24,8 +24,8 @@ if ($formAction == FORM_NEW) {
$msgUser = "alert('O nome do grupo é campo de preenchimento obrigatório!');";
} else {
//string para inserção do registro
$query = "insert into pbx_grupo(gp_nome, gp_status, gp_user)
values(%s, %s, %s)";
$query = "insert into pbx_grupo(gp_nome, gp_status, gp_user, gp_system)
values(%s, %s, %s, '0')";
GetGpValues();

2
seguranca/trocaSenha.php

@ -55,7 +55,7 @@ if (!isset($_POST["senhaAtu"])) {
$jsStartup[] = "alert('Não foi possível alterar a senha');";
$jsStartup[] = $setFocus;
//registra o login corrente para registrar log de erros do usuario
$siteError->SetLogin(GetLogin());
//$siteError->SetLogin(GetLogin());
} else {
// if(!$siteError->GetNumError())
$jsStartup[] = "alert('Usuário/Senha inválidos ou já foi utilizada recentemente!');";

4
templates/agendaRamais/depto/deptoRamais.htm

@ -33,7 +33,9 @@
</tr>
{$linhas}
<tr>
<th align="center" colspan="6"><table width="100%" class="grid" border="0" cellspacing="0" cellpadding="2"><tr><th align="center" style="width: 90%; border:0;">{$links}</th><th align="right" style="width: 10%; border:0;">{$pagMostra}/{$totalReg}</th></tr></table></th>
<th align="center" colspan="6"><table width="100%" class="grid" border="0" cellspacing="0" cellpadding="2"></th>
<th align="center" style="width: 90%; border:0;">{$links}</th>
<th align="right" style="width: 10%; border:0;">{$pagMostra}/{$totalReg}</th>
</tr>
</table>
</td>

11
templates/agendaRamais/depto/deptoRamaisInsert.html

@ -1,11 +1,14 @@
{capture name="display"}
<table width="100%" border="1" cellspacing="0" cellpadding="2" class="formCad">
<table width="100%" cellspacing="0" cellpadding="2" class="formCad">
<tr>
<td colspan="2" align="center" height="30"><img src="imgSite/icone_departamento.png" width="20" height="20"><span class="formHed">Cadastro de Departamento</span></td>
<td colspan="2" align="center" height="30">
<img src="imgSite/icone_departamento.png" width="20" height="20">
<span class="formHed">Cadastro de Departamento</span>
</td>
</tr>
<tr>
<th style="background-color:#F90;">Nome:</th>
<th>Nome:</th>
<td><input type="text" id="nome" name="nome" size="30" value="{$departamento}"></td>
</tr>
<tr>
@ -14,7 +17,7 @@
<input type="submit" id="fechar" name="fechar" value="Fechar" onClick="window.close();"></td>
</tr>
<tr>
<td colspan="2" style="color:#333333">{$mes}</td>
<td colspan="2">{$mes}</td>
</tr>
</table>
{/capture}

26
templates/cadastros/ServicosChamadas/servicosChamadas.tpl

@ -3,27 +3,37 @@
<input name="pgn" type="hidden" value="{$pgn}" />
<input name="bloco" type="hidden" value="{$bloco}" />
<input name="pg" type="hidden" value="{$pg}" />
<table width="99%" align="center" border="0" cellspacing="0" cellpadding="2" >
<table width="99%" align="center" class="filtro" border="0" cellspacing="0" cellpadding="2" >
<tr>
<td>
<table class="filtro" width="99%" border="0" cellpadding="2" cellspacing="0">
<table align="left" border="0" cellpadding="2" cellspacing="0">
<tr>
<td colspan="2">Palavra Chave</td>
<td>Palavra Chave</td>
<td>Filtro Status</td>
</tr>
<tr>
<td>
<td align="left" nowrap="nowrap">
<input name="paramPesquisa" type="text" id="paramPesquisa" size="20" value="{$paramPesquisa}"/>
<input name="btConsulta" type="submit" id="btConsulta" value="Consultar">
</td>
<td align="right" nowrap="nowrap">
{$imgNovo}
<td align="left" nowrap="nowrap">
<div class="geral" nowrap="nowrap">
<input name="status" class="clean" type="radio" value="A" {if $filtroStatus == 'A'} checked {/if} >Ativa
<input name="status" class="clean" type="radio" value="I" {if $filtroStatus == 'I'} checked {/if} >Desativada
<input name="status" class="clean" type="radio" value="T" {if $filtroStatus == 'T'} checked {/if} >Todos
</div>
</td>
<td>
<input name="btConsulta" type="submit" id="btConsulta" value="Consultar">
</td>
</tr>
</table>
</td>
<td align="right" nowrap="nowrap">
{$imgNovo}
</td>
</tr>
<tr>
<td>
<td colspan="2">
<table width="100%" class="grid" border="0" cellspacing="0" cellpadding="2">
<tr class="headColun">
<th align="left">Serviços</th>

21
templates/cadastros/classificaAtendimento/classificaItem.tpl

@ -4,27 +4,36 @@
<input name="bloco" type="hidden" value="{$bloco}" />
<input name="pg" type="hidden" value="{$pg}" />
<input name="desc" type="hidden" value="{$desc}" />
<table width="99%" align="center" border="0" cellspacing="0" cellpadding="2" >
<table width="99%" align="center" class="filtro" border="0" cellspacing="0" cellpadding="2" >
<tr>
<td>
<table class="filtro" width="99%" border="0" cellpadding="2" cellspacing="0">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
<td colspan="2">Palavra Chave</td>
</tr>
<tr>
<td>
<input name="paramPesquisa" type="text" id="paramPesquisa" size="20" value="{$paramPesquisa}"/>
<input name="btConsulta" type="submit" id="btConsulta" value="Consultar">
</td>
<td align="right" nowrap="nowrap">
{$imgClass}
<td align="left" nowrap="nowrap">
<div class="geral" nowrap="nowrap">
<input name="status" class="clean" type="radio" value="A" {if $filtroStatus == 'A'} checked {/if} >Ativa
<input name="status" class="clean" type="radio" value="I" {if $filtroStatus == 'I'} checked {/if} >Desativada
<input name="status" class="clean" type="radio" value="T" {if $filtroStatus == 'T'} checked {/if} >Todos
</div>
</td>
<td>
<input name="btConsulta" type="submit" id="btConsulta" value="Consultar">
</td>
</tr>
</table>
</td>
<td align="right" nowrap="nowrap">
{$imgClass}
</td>
</tr>
<tr>
<td>
<td colspan="2">
<table width="100%" class="grid" border="0" cellspacing="0" cellpadding="2">
<tr>
<th align="left" class="headColun">&nbsp;</th>

2
templates/configSuper.tpl

@ -42,7 +42,7 @@
</tr>
<tr>
<th align="left" nowrap="nowrap">Aviso LGPD no Monitoramnto</th>
<th align="left" nowrap="nowrap">Aviso LGPD no Monitoramento</th>
<td align="left"><label>
<input type="radio" name="prm_aviso_lgpd_monitoria" id="prm_aviso_lgpd_monitoriaSim" value="1" {if $prm_aviso_lgpd_monitoria}checked{/if} />Habilitar
</label>

4
templates/master.tpl

@ -9,10 +9,6 @@
{if $scriptPage}{$scriptPage}{/if}
{if $scriptBlok}{$scriptBlok}{/if}
{$cssBlock}
<script src="scriptApl/amCharts/core.js"></script>
<script src="scriptApl/amCharts/charts.js"></script>
<script src="scriptApl/amCharts/themes/animated.js"></script>
<script src="scriptApl/amCharts/extract.js"></script>
</head>
<body {$onLoad} {$infoBody}>
<form id="formGeral"

Loading…
Cancel
Save