forked from SimplesIP/pabx-app
root
2 years ago
18 changed files with 400 additions and 826 deletions
@ -1,370 +1,126 @@
|
||||
<?php |
||||
|
||||
$tpLayout = 1; |
||||
|
||||
include_once 'util/relatoriosBase.php'; |
||||
|
||||
class AgenteAnota extends Relatorios { |
||||
|
||||
private $___consultar; |
||||
private $___validar; |
||||
private $___agenteAnota; |
||||
private $___agenteFone; |
||||
private $___listaAgente; |
||||
private $___matricula; |
||||
|
||||
public function __construct($idProg, $dbcon, $incDac) { |
||||
parent::__construct($idProg, $dbcon, $incDac); |
||||
$this->___consultar = isset($_POST["btPesquisa"]); |
||||
$this->___validar = isset($_POST["btAnota"]) && (trim($_POST["AnotaTexto"]) != ""); |
||||
$this->___agenteAnota = isset($_POST["AnotaTexto"]) ? $_POST["AnotaTexto"] : ""; |
||||
$this->___agenteFone = isset($_POST["AnotaFone"]) ? soNumero($_POST["AnotaFone"]) : (isset($_SESSION[RAMAL_DESTINO]) ? soNumero($_SESSION[RAMAL_DESTINO]) : ''); |
||||
$this->___listaAgente = isset($_POST["listaAgente"]) ? $_POST["listaAgente"] : GetMatricula(); |
||||
$this->___dataIni = IsPostBack() ? $_POST['dataIni'] : date('d/m/Y'); |
||||
$this->___dataFim = IsPostBack() ? $_POST['dataFim'] : date('d/m/Y'); |
||||
$this->___matricula = GetMatricula(); |
||||
} |
||||
|
||||
function ___ValidaForm() { |
||||
|
||||
if (!is_date($this->___dataIni) && empty($this->___agenteFone)) { |
||||
GeraExcept('A "Data Inicial" informada é inválida!'); |
||||
} |
||||
|
||||
if (!is_date($this->___dataFim) && empty($this->___agenteFone)) { |
||||
GeraExcept('A "Data Final" informada é inválida!'); |
||||
} |
||||
|
||||
if (!$this->___consultar && $this->___validar && empty($this->___agenteFone)) { |
||||
$msg = GetAnotacoesKey() ? "Informe o número do telefone!" : "Informe o número do protocolo!"; |
||||
GeraExcept($msg); |
||||
} |
||||
|
||||
if($this->___validar && !$this->___consultar){ |
||||
$this->___InserirAnotacao(); |
||||
} |
||||
} |
||||
|
||||
function ___FiltrosRelatorio() { |
||||
if ($this->___media != MEDIA_PRINT_GRID) { |
||||
/* |
||||
* Recupera os filtros da sess�o do usu�rio. |
||||
*/ |
||||
list($this->___dataIni, $this->___dataFim, $this->___agenteFone) = $_SESSION["SSstorageFiltros"]; |
||||
|
||||
if ($this->___media == MEDIA_PRINT_HTML) { |
||||
return sprintf("Data Inicial: %s Data Final: %s ", $this->___dataIni, $this->___dataFim); |
||||
} |
||||
|
||||
$fltCsv = array(); |
||||
$fltCsv[] = "Data Inicial: " . $this->___dataIni; |
||||
$fltCsv[] = "Data Final: " . $this->___dataFim; |
||||
$fltCsv[] = "Data Hora Emissao: " . date('d/m/Y H i s)'); |
||||
$fltCsv[] = "Emitido Por: " . GetLogin(); |
||||
return $fltCsv; |
||||
} |
||||
|
||||
$lkPrint = ""; |
||||
if ($this->___dataCount) { |
||||
$prt = '<a href="index.php?idProg=%s&media=%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', '%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, substr(LimpaString(GetDispProgSel($this->GetIdProg())), 0, 20), 'print.gif'); |
||||
$lkPrint .= sprintf($prt, $this->GetidProg(), MEDIA_PRINT_EXCEL, 'prt-xls.png'); |
||||
//$lkPrint .= sprintf($prt, $this->GetidProg(), MEDIA_PRINT_PDF, 'prt-pdf.png'); |
||||
//$lkPrint .= sprintf($prt, $this->GetidProg(), MEDIA_PRINT_CSV, 'prt-csv.png'); |
||||
} |
||||
|
||||
$filtro .= '<table border="0" align="center" cellpadding="8" cellspacing="0" style="border-top:0;font-size:12px;" > |
||||
<tr> |
||||
<td align="center"> |
||||
<span style="font-face:Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold;"> |
||||
<img src="imgSite/anotacoes.png" alt="Bloco de Anotações" align="absmiddle" width="32" height="32" border="0" title="Bloco de Anotações"> |
||||
Bloco de Anotações |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
</table>'; |
||||
/* |
||||
* Personalise esta função se necessitar de outras opções de filtro. |
||||
*/ |
||||
$filtro .= '<table class="filtro" align="center" border="0" cellspacing="1" cellpadding="1">'; |
||||
/* |
||||
* Rotulos. |
||||
*/ |
||||
$filtro .= '<tr>'; |
||||
$filtro .= IsSuper() ? '<td>Agentes</td>' : ''; |
||||
$filtro .= '<td>Agentes</td>'; |
||||
$filtro .= '<td>Data Inicial </td>'; |
||||
$filtro .= '<td>Data Final </td>'; |
||||
$filtro .= sprintf('<td>%s</td>', GetAnotacoesKey() ? 'Fone' : $_SESSION['prm_label_protoco_pesquisa']); |
||||
|
||||
/* |
||||
* Valores. |
||||
*/ |
||||
$filtro .= '<tr>'; |
||||
$filtro .= IsSuper() ? sprintf("<td><select name='listaAgente'>%s</select></td>", $this->GetAgentesAnotacoes($this->___listaAgente)) : ''; |
||||
$filtro .= sprintf("<td><select name='listaAgente'>%s</select></td>", $this->GetAgentesAnotacoes($this->___listaAgente)); |
||||
$filtro .= '<td><input name="dataIni" id="dataIni" type="text" size="15" maxlength="16" value="%s" onkeyup="formataDataHora(this)" title="dd/mm/aaaa"></td>'; |
||||
$filtro .= '<td><input name="dataFim" id="dataFim" type="text" size="15" maxlength="16" value="%s" onkeyup="formataDataHora(this)" title="dd/mm/aaaa"></td>'; |
||||
$filtro .= '<td><div> '; |
||||
$filtro .= sprintf('<input name="AnotaFone" size="20" type="text" id="AnotaFone" value="%s">' |
||||
. '<input name="btPesquisa" type="submit" id="btPesquisa" value="Pesquisar">' |
||||
. '<input name="btAnota" type="submit" id="btAnota" value="Salvar">', $this->___agenteFone); |
||||
$filtro .= '</div></td>'; |
||||
$filtro .= '<td>%s</td>'; |
||||
$filtro .= '</tr>'; |
||||
$filtro .= '</table>'; |
||||
|
||||
$filtro .= "<br>"; |
||||
|
||||
$filtro .= '<table class="grid" align="center" border="0" cellspacing="1" cellpadding="1">'; |
||||
$filtro .= "<tr><td class='destaque'>{$_SESSION['prm_label_protoco_texto']}</td></tr>"; |
||||
$filtro .= "<tr>"; |
||||
$filtro .= "<td><textarea name='AnotaTexto' cols='114' rows='8' id='AnotaTexto'></textarea></td>"; |
||||
$filtro .= "</tr>"; |
||||
$filtro .= "</table>"; |
||||
|
||||
|
||||
/* |
||||
* Guarda os filtros passados para recuperar na emiss�o dos relat?ios para impress�o. |
||||
*/ |
||||
$_SESSION["SSstorageFiltros"] = array($this->___dataIni, $this->___dataFim, $this->___agenteFone); |
||||
|
||||
return sprintf($filtro, $this->___dataIni, $this->___dataFim, $lkPrint); |
||||
} |
||||
|
||||
protected function ___GetDadosDb() { |
||||
$dataIni = FormatDtMssql($this->___dataIni); |
||||
$dataFim = FormatDtMssql($this->___dataFim); |
||||
|
||||
$query = sprintf("SELECT a.id_text, a.conteudo, a.matricula_agente, a.fone_cliente, a.data, b.apelido |
||||
FROM pbx_anotacoes a |
||||
INNER JOIN pbx_usuarios b ON b.matricula = a.matricula_agente::text |
||||
WHERE data::DATE >= '$dataIni' AND data::DATE <= '$dataFim'"); |
||||
|
||||
if(empty($this->___agenteFone)){ |
||||
$query .= $this->___listaAgente ? " AND a.matricula_agente::text = '$this->___listaAgente' " : ""; |
||||
} |
||||
|
||||
$query .= " AND fone_cliente LIKE '%$this->___agenteFone%'"; |
||||
$query .= " ORDER BY b.apelido, a.data DESC"; |
||||
|
||||
$result = $this->___GetQuery($query); |
||||
$row = pg_fetch_all($result); |
||||
|
||||
$this->SetData($row ? $row : array()); |
||||
} |
||||
|
||||
protected function ___PreparaCsv() { |
||||
|
||||
} |
||||
|
||||
protected function ___PreparaExcel() { |
||||
$dataRel = array(); |
||||
$dataAgrup = 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('ID','Data', RemoveAcentos($_SESSION['prm_label_protoco_pesquisa']), 'Mensagem','Autor'); |
||||
$dadosField = array('id_text', 'data', 'fone_cliente', 'conteudo', 'apelido'); |
||||
|
||||
/* |
||||
* Monta a linha de cabecalio. |
||||
*/ |
||||
$linha = array('LABEL'); |
||||
foreach ($dadosCabecalio as $value) { |
||||
$linha[] = $value; |
||||
} |
||||
$dataRel[] = $linha; |
||||
|
||||
$somaTempo = 0; |
||||
$somaQuantidade = 0; |
||||
/* |
||||
* Linhas de dados. |
||||
*/ |
||||
foreach ($this->GetData()[0] as $row) { |
||||
$row["data"] = date('d/m/Y', strtotime($row["data"])); |
||||
$row["conteudo"] = RemoveAcentos($row['conteudo']); |
||||
// Formata linha de dados. |
||||
$linha = array('DADOS'); |
||||
foreach ($dadosField as $key) { |
||||
$linha[] = $row["$key"]; |
||||
} |
||||
|
||||
$dataRel[] = $linha; |
||||
} |
||||
|
||||
$dataRel[] = $linha; |
||||
|
||||
$this->___dataRel[] = $dataRel; |
||||
} |
||||
|
||||
protected function ___PreparaGrid() { |
||||
$dadosCabecalio = array( |
||||
'ID' => 'align="center"', |
||||
'Data' => 'align="center"', |
||||
$_SESSION['prm_label_protoco_pesquisa'] => 'align="center"', |
||||
'Mensagem' => 'align="left"', |
||||
'Autor' => 'align="center"', |
||||
); |
||||
$dadosField = array( |
||||
'id_text' => 'align="center"', |
||||
'data' => 'align="center"', |
||||
'fone_cliente' => 'align="center"', |
||||
'conteudo' => 'align="left"', |
||||
'apelido' => 'align="center"', |
||||
); |
||||
/* |
||||
* Inicia o relat�rio. |
||||
*/ |
||||
$dataRel[] = '<table width="99%" 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; |
||||
} |
||||
|
||||
$somaQuantidade = 0; |
||||
/* |
||||
* Linhas de dados. |
||||
*/ |
||||
foreach ($this->GetData()[0] as $row) { |
||||
$row["data"] = date('d/m/Y', strtotime($row["data"])); |
||||
|
||||
// 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 colspan="2" align="left">Total</th><th align="left" colspan="2">Registros: %s</th><th align="left" colspan="6">Duração: %s</th></tr>'; |
||||
//$dataRel[] = sprintf($linha, $somaQuantidade, SecondToStrTime($somaTempo)); |
||||
|
||||
/* |
||||
* Fecha relatorio. |
||||
*/ |
||||
$dataRel[] = '</table>'; |
||||
$this->___dataRel[] = $dataRel; |
||||
} |
||||
|
||||
protected function ___PreparaHtml() { |
||||
|
||||
} |
||||
|
||||
protected function ___PreparaPdf() { |
||||
|
||||
} |
||||
|
||||
private function ___InserirAnotacao(){ |
||||
if ($this->___validar && empty($this->___agenteAnota)) { |
||||
GeraExcept("Insira uma anotação!"); |
||||
} |
||||
|
||||
$query = "SELECT * FROM pbx_anotacoes WHERE conteudo = '{$this->___agenteAnota}' AND fone_cliente = '{$this->___agenteFone}';"; |
||||
$res = $this->___GetQuery($query); |
||||
if(pg_fetch_assoc($res)){ |
||||
GeraExcept('Essas informações já foram registradas!'); |
||||
} |
||||
|
||||
$query = "INSERT INTO pbx_anotacoes (conteudo,matricula_agente,fone_cliente) VALUES('$this->___agenteAnota', '$this->___matricula', '$this->___agenteFone');"; |
||||
$result = $this->___GetQuery($query); |
||||
if(!$result){ |
||||
GeraExcept('Não foi possível inserir o registro'); |
||||
} |
||||
} |
||||
|
||||
private function GetAgentesAnotacoes($matricula) { |
||||
$query = "SELECT id, apelido, nome, matricula FROM pbx_usuarios WHERE delete_ = 0 AND apelido NOT IN('sinccontasenha') ORDER BY apelido"; //'admin', |
||||
$result = $this->___GetQuery($query); |
||||
$sel = $matricula == "0" ? ' Selected="selected" ' : ''; |
||||
$item = "<option value=\"0\"$sel>Todos</option>\n"; |
||||
|
||||
while ($dados = pg_fetch_array($result, null, PGSQL_ASSOC)) { |
||||
$mat = $dados['matricula']; |
||||
$apelido = $dados['apelido']; |
||||
$sel = $mat == $matricula ? ' Selected="selected" ' : ''; |
||||
$item .= "<option value=\"$mat\"$sel>$apelido-[$mat]</option>\n"; |
||||
} |
||||
return $item; |
||||
} |
||||
|
||||
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'); |
||||
/* |
||||
* To change this template, choose Tools | Templates |
||||
* and open the template in the editor. |
||||
*/ |
||||
$tpLayout = 1; |
||||
$matricula = GetMatricula(); |
||||
$consultar = isset($_POST["btPesquisa"]); |
||||
$valida = isset($_POST["btAnota"]) && (trim($_POST["AnotaTexto"]) != ""); |
||||
$agtAnota = isset($_POST["AnotaTexto"]) ? $_POST["AnotaTexto"] : ""; |
||||
$agtFone = isset($_POST["AnotaFone"]) ? soNumero($_POST["AnotaFone"]) : (isset($_SESSION[RAMAL_DESTINO]) ? soNumero($_SESSION[RAMAL_DESTINO]) : ''); |
||||
$btAnota = isset($_POST["btAnota"]) ? $_POST["btAnota"] : ""; |
||||
$listaAgente = isset($_POST["listaAgente"]) ? $_POST["listaAgente"] : GetMatricula(); |
||||
$dataIni = !isset($_POST["dataIni"]) ? date('d/m/Y') : $_POST["dataIni"]; |
||||
$dataFim = !isset($_POST["dataFim"]) ? date('d/m/Y') : $_POST["dataFim"]; |
||||
|
||||
$msg = ""; |
||||
$pesquisa = ""; |
||||
|
||||
if (isset($_GET["formAction"])) { |
||||
$idDel = $_GET["id"]; |
||||
$query = "delete from pbx_anotacoes where id_text = '$idDel'"; |
||||
@pg_query($dbcon, $query); |
||||
} |
||||
|
||||
if (!is_date($dataIni)) { |
||||
$jsStartup[] = "alert('Data inicial inválida!');"; |
||||
$msg = "Data inicial inválida!"; |
||||
$isValid = 0; |
||||
} else if (!is_date($dataFim)) { |
||||
$jsStartup[] = "alert('Data final inválida!');"; |
||||
$msg = "Data final inválida!"; |
||||
$isValid = 0; |
||||
} else if (!$consultar && $valida && empty($agtFone)) { |
||||
$msg = GetAnotacoesKey() ? "Informe o número do telefone!" : "Informe o número do protocolo!"; |
||||
} else if ($valida && empty($agtAnota)) { |
||||
$msg = "Insira uma anotação!"; |
||||
} else if (!$consultar && $valida) { |
||||
$query = "insert into pbx_anotacoes(conteudo, matricula_agente, fone_cliente) |
||||
values('$agtAnota', '$matricula', '$agtFone')"; |
||||
$result = pg_query($dbcon, $query); |
||||
if ($result) { |
||||
$agtAnota = ""; |
||||
$msg = "Operação realizada com sucesso!"; |
||||
} |
||||
} |
||||
|
||||
|
||||
$pesquisa = PesquisaFone($dbcon, $agtFone); |
||||
if (empty($pesquisa)) |
||||
$pesquisa = "<tr><td colspan=4>Nenhum registro encontrado!</td></tr>"; |
||||
|
||||
|
||||
$cor = !$msg || stripos($msg, 'sucesso') ? '#0000FF' : '#FF0000'; |
||||
$smarty->assign("AnotaFone", $agtFone); |
||||
$smarty->assign("AnotaTexto", $agtAnota); |
||||
$smarty->assign("corErro", $cor); |
||||
$smarty->assign("msg", $msg); |
||||
$smarty->assign("linhas", $pesquisa); |
||||
$smarty->assign("isFone", GetAnotacoesKey()); |
||||
$smarty->assign("isSuper", IsSuper()); |
||||
$smarty->assign("dataIni", $dataIni); |
||||
$smarty->assign("dataFim", $dataFim); |
||||
$smarty->assign("prm_label_protoco_pesquisa", $_SESSION['prm_label_protoco_pesquisa']); |
||||
$smarty->assign("prm_label_protoco_texto", $_SESSION['prm_label_protoco_texto']); |
||||
$smarty->assign("prm_label_protoco_grid", $_SESSION['prm_label_protoco_grid']); |
||||
if (IsSuper()) { |
||||
$agentes = GetAgentesAnotacoes($listaAgente); |
||||
$smarty->assign("listaAgente", $agentes); |
||||
} |
||||
DispLogin($smarty); |
||||
|
||||
function PesquisaFone($db, $num) { |
||||
global $listaAgente, $dataIni, $dataFim; |
||||
$mat = IsSuper() ? $listaAgente : GetMatricula(); |
||||
$query = "select a.id_text, a.conteudo, a.matricula_agente, a.fone_cliente, a.data, b.apelido from pbx_anotacoes a, pbx_usuarios b where b.matricula = a.matricula_agente::text "; |
||||
$query .= $mat ? " and a.matricula_agente::text = '$mat' " : ""; |
||||
$query .= sprintf(" and data::date >= %s and data::date <= %s ", FormatDtMssql($dataIni, true), FormatDtMssql($dataFim, true)); |
||||
$query .= " and fone_cliente like '%" . $num . "%'"; |
||||
$query .= " order by b.apelido, a.data desc"; |
||||
|
||||
$result = @pg_query($db, $query); |
||||
//if(IsAdmin()) echo $query; |
||||
while (($result) && ($row = pg_fetch_array($result))) { |
||||
$fone = GetAnotacoesKey() ? FormataFone($row["fone_cliente"]) : $row["fone_cliente"]; |
||||
$content = $row["conteudo"]; |
||||
$matAgt = $row["matricula_agente"] . '-' . $row["apelido"]; |
||||
$data = date('d/m/Y', strtotime($row["data"])); |
||||
$imgDel = GetLinkFormDelete($row["id_text"], 'DeletaAnotacao'); |
||||
$linha .= "<tr> |
||||
<td align=left>$data</td>"; |
||||
if (IsSuper()) { |
||||
$linha .= " <td align=left>$matAgt</td>"; |
||||
} |
||||
|
||||
$linha .= " <td align=left>$fone</td> |
||||
<td align=left>$content</td> |
||||
<td align=center>$imgDel</td> |
||||
</tr>"; |
||||
} |
||||
$colspan = IsSuper() ? 4 : 3; |
||||
if (empty($linha)) |
||||
$linha = "<tr><td colspan=\"$colspan\">Nenhum registro encontrado!</td></tr>"; |
||||
|
||||
return $linha; |
||||
} |
||||
|
||||
function DispLogin($smarty) { |
||||
$smarty->display('callcenter/agente/agenteAnota.tpl'); |
||||
} |
||||
|
||||
function GetAgentesAnotacoes($matricula) { |
||||
$query = "select id, apelido, nome, matricula from pbx_usuarios where delete_ = 0 and apelido not in('sinccontasenha' )"; //'admin', |
||||
$result = pg_query($query); |
||||
$sel = $matricula == "0" ? ' Selected="selected" ' : ''; |
||||
$item = "<option value=\"0\"$sel>Todos</option>\n"; |
||||
while ($dados = pg_fetch_array($result, null, PGSQL_ASSOC)) { |
||||
$mat = $dados['matricula']; |
||||
$apelido = $dados['apelido']; |
||||
$sel = $mat == $matricula ? ' Selected="selected" ' : ''; |
||||
$item .= "<option value=\"$mat\"$sel>$apelido-[$mat]</option>\n"; |
||||
} |
||||
return $item; |
||||
} |
||||
|
||||
$agenteAnota = new AgenteAnota($idProg, $dbcon, 0); |
||||
$agenteAnota->ExecutaRelatorio(); |
||||
?> |
||||
|
Loading…
Reference in new issue