Skip to content

Commit

Permalink
feat: provided a view HistoricoClientes in cliente/perfil
Browse files Browse the repository at this point in the history
  • Loading branch information
elfiservice committed Apr 18, 2018
1 parent db9c9cc commit f5ddfcb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 9 deletions.
8 changes: 4 additions & 4 deletions classes/controller/ClienteCtrl.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ public function atualizarCliente(Array $dados, Array $dadosClienteAntigoObj) {
$stringDadosAlterados = $this->registrarAlteracao($arrayFilha, $dadosClienteAntigoObj);

if ($this->atualizarBD($arrayFilha[0][0])) {
$idColab = $dados['id'];
$alteracaoCliente = "<b><span>Alterado</span></b> no Sistema:<br>{$stringDadosAlterados}";
LogCtrl::inserirLog($dados['id_colab_logado'], "Cliente Cod <b>{$idColab}</b> {$alteracaoCliente}", "tec");
$idCliente = $dados['id'];
$alteracaoCliente = "<b><span>Alterado</span></b> pelo colaborador <b> {$dados['usuario']} </b> no Sistema:<br>{$stringDadosAlterados}";
LogCtrl::inserirLog($dados['id_colab_logado'], "Cliente Cod <b>{$idCliente}</b> {$alteracaoCliente}", "tec");

$this->historicoClienteCtrl->inserirBD(new HistoricoClientes("", $idColab, $alteracaoCliente, date('Y-m-d H:i:s')));
$this->historicoClienteCtrl->inserirBD(new HistoricoClientes("", $idCliente, $alteracaoCliente, date('Y-m-d H:i:s')));

$this->result = array("<b>OK!</b> Cliente <b>Atualizado</b> com sucesso.", WS_ACCEPT);
return TRUE;
Expand Down
39 changes: 34 additions & 5 deletions modulos/tecnico/cliente/perfil.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,6 @@
<th>Serviço</th>
<TH>Valor</TH>





</TR>
</thead>
<tbody>
Expand Down Expand Up @@ -240,7 +236,40 @@
</TABLE>
<?php echo "Valor Total dos Orçamentos Executados: <b>R$ " . number_format($valor_total, 2, ',', '.') . "</b>"; ?>
</fieldset>

<fieldset>
<legend><b>Histórico de Alterações </b></legend>

<table class="display" id="example2" >
<thead>
<TR>
<TH>Cod</TH>
<TH>Alteração</TH>
<th>Data</th>
</TR>
</thead>
<tbody>
<?php
$historicoClientesCtrl = new HistoricoClientesCtrl();
$historicoDoCliente = $historicoClientesCtrl->buscarBD("*", "WHERE id_cliente = '" . $clienteFinal->getId() . "' ORDER BY id Desc");

if ($historicoDoCliente) {
foreach ($historicoDoCliente as $historico) {
?>
<tr>
<td><?= $historico->getId() ?></td>
<td><?= $historico->getAlteracao() ?></td>
<td><?= Formatar::formatarDataComHora($historico->getData()) ?></td>
</tr>

<?php

}
}
?>

</tbody>
</table>
</fieldset>
</section>


Expand Down

0 comments on commit f5ddfcb

Please sign in to comment.