Beispiel #1
0
        <th>Código</th>
        <th>Descrição</th>
        <th>
            <button type="button" class="btn btn-info btn-xs" rel="tooltip" title="Novo Registro" onclick="abrirModalExtra('inserir', 0 , 'view/<?php 
echo $path;
?>
/form.php')">
                <i class="glyphicon glyphicon-plus"></i>
            </button>
        </th>
    </tr>
    </thead>
    <tbody>
    <?php 
$condicao = "A.idconta = B.id AND B.codconta = C.CODCONTA AND A.idgrupo = " . $idgrupo;
$dados = $consulta->PDOSelecionar("A.id, B.codconta, B.codigo, C.descricao", "ZPortareDremontagem A, ZPortarePlanocontas B, CCONTA C", $condicao, 0, 300, "B.codigo");
$d = new ArrayIterator($dados);
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->id . '">
                                <td>' . $m->codconta . '</td>
                                <td>' . $m->codigo . '</td>
                                <td>' . $m->descricao . '</td>
                                <td>
                                    <a href="javascript:void(0)" class="btn btn-primary btn-xs" rel="tooltip" title="Excluir" onclick="modalExcluir(\'view/' . $path . '/actions.php\', ' . $m->id . ')">
                                        <i class="glyphicon glyphicon-trash"></i>
                                    </a>
                                </td>
                              </tr>';
    $d->next();
}
Beispiel #2
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
include_once '../../dados/config.php';
require_once '../../dados/classes.php';
$consulta = new banco();
$linkurl = explode("/", $_SERVER['SCRIPT_NAME']);
$path = $linkurl[count($linkurl) - 2];
$acao = $_REQUEST['acao'];
$id = $_REQUEST['id'];
if ($id > 0) {
    $dados = $consulta->PDOSelecionar("*", "ZPortareDregrupo", "id = " . $id, 0, 1, "id");
    $d = new ArrayIterator($dados);
    $valor = $d->current();
}
?>
<input type="hidden" id="id" value="<?php 
echo $id;
?>
">
<input type="hidden" id="acao" value="<?php 
echo $acao;
?>
">

<div class="col-md-12">
    <div class="row">
        <div class="col-md-3">
            <label for="codigo">Código</label>
$end = $start + $total_reg;
$condicao = "1=1";
# Aqui virá os filtros
/*foreach ($_POST as $chave => $valor) {
      if(($chave<>'acao') and ($chave<>'tipo')){
          if($valor<>'') {
              if ((str_replace("_", ".", $chave)=='A.id') or (str_replace("_", ".", $chave)=='A.idservico') or (str_replace("_", ".", $chave)=='A.idcliente') or (str_replace("_", ".", $chave)=='A.idseguradora') or (str_replace("_", ".", $chave)=='A.status')) {
                  $condicao .= " and ". str_replace("_", ".", $chave). " = ".$valor;
              } else {
                  $condicao .= " and ". str_replace("_", ".", $chave). " like '%".$valor."%'";
              }
          }
      }
  }
  //echo $condicao;*/
$dados = $consulta->PDOSelecionar("CODCONTA, DESCRICAO", "(\r\n                        SELECT CODCONTA, DESCRICAO FROM CCONTA\r\n                        WHERE CODCONTA NOT IN (SELECT X.codconta FROM ZPortarePlanocontas X)\r\n                        AND ANALITICA = 1\r\n                        AND CODCONTA LIKE '3%'\r\n                        UNION\r\n                        SELECT CODCONTA, DESCRICAO FROM CCONTA\r\n                        WHERE CODCONTA NOT IN (SELECT X.codconta FROM ZPortarePlanocontas X)\r\n                        AND ANALITICA = 1\r\n                        AND CODCONTA LIKE '4%'\r\n                    ) AS TABELA", $condicao, $start + 1, $end, "CODCONTA");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("(\r\n                        SELECT CODCONTA, DESCRICAO FROM CCONTA\r\n                        WHERE CODCONTA NOT IN (SELECT X.codconta FROM ZPortarePlanocontas X)\r\n                        AND ANALITICA = 1\r\n                        AND CODCONTA LIKE '3%'\r\n                        UNION\r\n                        SELECT CODCONTA, DESCRICAO FROM CCONTA\r\n                        WHERE CODCONTA NOT IN (SELECT X.codconta FROM ZPortarePlanocontas X)\r\n                        AND ANALITICA = 1\r\n                        AND CODCONTA LIKE '4%'\r\n                    ) AS TABELA", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->id . '">
                                <td>' . $m->CODCONTA . '</td>
                                <td>' . $m->DESCRICAO . '</td>
                              </tr>';
    $d->next();
}
?>
            </tbody>
Beispiel #4
0
                    $condicao .= " AND A.dtsaidaempresa <= '" . $ano . "-" . $mes . "-" . $dia . "'";
                } elseif (str_replace("_", ".", $chave) == 'A.dtorcamentoInicial') {
                    list($dia, $mes, $ano) = explode("/", $valor);
                    $condicao .= " AND A.dtorcamento >= '" . $ano . "-" . $mes . "-" . $dia . "'";
                } elseif (str_replace("_", ".", $chave) == 'A.dtorcamentoFinal') {
                    list($dia, $mes, $ano) = explode("/", $valor);
                    $condicao .= " AND A.dtorcamento <= '" . $ano . "-" . $mes . "-" . $dia . "'";
                } else {
                    $condicao .= " and " . str_replace("_", ".", $chave) . " like '%" . $valor . "%'";
                }
            }
        }
    }
}
#echo $condicao;
$dados = $consulta->PDOSelecionar("A.id, B.nome, C.NOME motorista, A.idcaminhao, A.idmov, CONVERT(VARCHAR(20), A.dtsaidaempresa, 103) dtsaida,\r\n(CONVERT(VARCHAR(20), A.dtorcamento, 103)+' '+CONVERT(VARCHAR(20), A.dtorcamento, 108)) dataorcamento, A.dtorcamento,\r\ncase status\r\n   WHEN 0 THEN 'Montagem'\r\n   WHEN 1 THEN 'Aguardando Resposta'\r\n   WHEN 2 THEN 'Aprovado'\r\n   WHEN 3 THEN 'Em Viagem'\r\n   WHEN 4 THEN 'Concluído'\r\n   WHEN 5 THEN 'Cancelado'\r\n   WHEN 6 THEN 'Em Carregamento'\r\nEND AS situacao, A.status, A.kmsaida, A.kmchegada, A.kmpercorrido, A.observacao", "ZPortareKm A, ZPortareLogin B, PFUNC C", $condicao, $start + 1, $end, "A.dtorcamento DESC");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("ZPortareKm A, ZPortareLogin B, PFUNC C", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    include "linha.php";
}
?>
            </tbody>
        </table>

        <?php 
$anterior = $pc - 1;
$proximo = $pc + 1;
Beispiel #5
0
$end = $start + $total_reg;
$condicao = "ATIVO = 1 AND CODCOLIGADA IN (0, " . $coligada . ")";
# Aqui virá os filtros
/*foreach ($_POST as $chave => $valor) {
      if(($chave<>'acao') and ($chave<>'tipo')){
          if($valor<>'') {
              if ((str_replace("_", ".", $chave)=='A.id') or (str_replace("_", ".", $chave)=='A.idservico') or (str_replace("_", ".", $chave)=='A.idcliente') or (str_replace("_", ".", $chave)=='A.idseguradora') or (str_replace("_", ".", $chave)=='A.status')) {
                  $condicao .= " and ". str_replace("_", ".", $chave). " = ".$valor;
              } else {
                  $condicao .= " and ". str_replace("_", ".", $chave). " like '%".$valor."%'";
              }
          }
      }
  }
  //echo $condicao;*/
$dados = $consulta->PDOSelecionar("CODCOLIGADA, CODCFO, NOMEFANTASIA, NOME, CGCCFO, ISNULL(VALOROP1, 0) VALOROP1, ISNULL(VALOROP2, 0) VALOROP2", "FCFO (NOLOCK)", $condicao, $start + 1, $end, "NOME");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("FCFO", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->CODCFO . '">
                                <td>' . $m->CODCFO . '</td>
                                <td>' . $m->NOMEFANTASIA . '</td>
                                <td>' . $m->NOME . '</td>
                                <td>' . $m->CGCCFO . '</td>
                                <td>' . $m->VALOROP1 . '</td>
                                <td>' . $m->VALOROP2 . '</td>
                                <td>
Beispiel #6
0
$end = $start + $total_reg;
$condicao = "1=1";
# Aqui virá os filtros
/*foreach ($_POST as $chave => $valor) {
      if(($chave<>'acao') and ($chave<>'tipo')){
          if($valor<>'') {
              if ((str_replace("_", ".", $chave)=='A.id') or (str_replace("_", ".", $chave)=='A.idservico') or (str_replace("_", ".", $chave)=='A.idcliente') or (str_replace("_", ".", $chave)=='A.idseguradora') or (str_replace("_", ".", $chave)=='A.status')) {
                  $condicao .= " and ". str_replace("_", ".", $chave). " = ".$valor;
              } else {
                  $condicao .= " and ". str_replace("_", ".", $chave). " like '%".$valor."%'";
              }
          }
      }
  }
  //echo $condicao;*/
$dados = $consulta->PDOSelecionar("*", "ZPortareDregrupo", $condicao, $start + 1, $end, "id");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("ZPortareDregrupo", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->id . '">
                                <td>' . $m->codigo . '</td>
                                <td>' . $m->descricao . '</td>
                                <td>
                                    <a href="javascript:void(0)" class="btn btn-danger btn-xs" rel="tooltip" title="Editar" onclick="abrirModal(\'editar\', ' . $m->id . ' , \'view/' . $path . '/form.php\')">
                                        <i class="glyphicon glyphicon-edit"></i>
                                    </a>
                                    <a href="javascript:void(0)" class="btn btn-default btn-xs" rel="tooltip" title="Contas" onclick="abrirModal(\'montagem\', ' . $m->id . ' , \'view/dremontagem/list.php\')">
Beispiel #7
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
include_once 'dados/config.php';
require_once 'dados/classes.php';
$consulta = new banco();
$email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL);
$senha = md5(filter_input(INPUT_POST, 'senha', FILTER_SANITIZE_STRING));
$conta = $consulta->PDOQtderegistro("ZPortareLogin", "email = '" . $email . "'");
if ($conta > 0) {
    $sql = $consulta->PDOSelecionar("*", "ZPortareLogin", "email = '" . $email . "'", 0, 10, "id");
    $d = new ArrayIterator($sql);
    $valor = $d->current();
    if ($valor->senha == $senha) {
        if ($valor->ativo == 0) {
            echo '<div class="alert alert-dismissable alert-danger"><button type="button" class="close" data-dismiss="alert">×</button>' . 'Usuário desativado</div> &nbsp;';
        } else {
            $_SESSION['nomelogin'] = $valor->nome;
            $_SESSION['idlogin'] = $valor->id;
            echo 'Por favor, aguarde enquanto é redirecionado!';
            echo "<script language='javascript'>location.href='logado.php';</script>";
            echo '&nbsp;';
        }
    } else {
        echo '<div class="alert alert-dismissable alert-danger"><button type="button" class="close" data-dismiss="alert">×</button>' . 'A senha digitada é errada</div> &nbsp;';
    }
} else {
    echo '<div class="alert alert-dismissable alert-danger"><button type="button" class="close" data-dismiss="alert">×</button>' . 'E-mail não cadastrado</div> &nbsp;';
}
Beispiel #8
0
if (!isset($_SESSION)) {
    session_start();
}
$linkurl = explode("/", $_SERVER['SCRIPT_NAME']);
$path = $linkurl[count($linkurl) - 2];
$acao = $_REQUEST['acao'];
$id = $_REQUEST['id'];
$tipo = $_REQUEST['tipo'];
if ($id > 0) {
    if (!isset($_SESSION)) {
        session_start();
    }
    include_once '../../dados/config.php';
    require_once '../../dados/classes.php';
    $consulta = new banco();
    $dados = $consulta->PDOSelecionar("*", "ZPortarePerfil", "id = " . $id, 0, 1, "nome");
    $d = new ArrayIterator($dados);
    $valor = $d->current();
}
?>
<script src="theme/default/js/functions.js"></script>

<input type="hidden" id="id" value="<?php 
echo $id;
?>
">
<input type="hidden" id="acao" value="<?php 
echo $acao;
?>
">
Beispiel #9
0
$end = $start + $total_reg;
$condicao = "A.CODSITUACAO <> 'D'\r\n                      AND A.CODCOLIGADA = B.CODCOLIGADA\r\n                      AND A.CODFUNCAO = B.CODIGO\r\n                      AND A.CODFUNCAO IN ('003', '018', '019', '099')\r\n                      AND A.CODCOLIGADA = " . $coligada;
# Aqui virá os filtros
/*foreach ($_POST as $chave => $valor) {
      if(($chave<>'acao') and ($chave<>'tipo')){
          if($valor<>'') {
              if ((str_replace("_", ".", $chave)=='A.id') or (str_replace("_", ".", $chave)=='A.idservico') or (str_replace("_", ".", $chave)=='A.idcliente') or (str_replace("_", ".", $chave)=='A.idseguradora') or (str_replace("_", ".", $chave)=='A.status')) {
                  $condicao .= " and ". str_replace("_", ".", $chave). " = ".$valor;
              } else {
                  $condicao .= " and ". str_replace("_", ".", $chave). " like '%".$valor."%'";
              }
          }
      }
  }
  //echo $condicao;*/
$dados = $consulta->PDOSelecionar("A.CHAPA, A.NOME, B.NOME FUNCAO", "PFUNC A, PFUNCAO B", $condicao, $start + 1, $end, "A.NOME");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("PFUNC A, PFUNCAO B", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->CHAPA . '">
                                <td>' . $m->CHAPA . '</td>
                                <td>' . $m->NOME . '</td>
                                <td>' . $m->FUNCAO . '</td>
                                <td>
                                    <a href="javascript:void(0)" class="btn btn-danger btn-xs" rel="tooltip" title="Ver Detalhes">
                                        <i class="glyphicon glyphicon-edit"></i>
                                    </a>
Beispiel #10
0
if (!isset($_SESSION)) {
    session_start();
}
$linkurl = explode("/", $_SERVER['SCRIPT_NAME']);
$path = $linkurl[count($linkurl) - 2];
$acao = $_REQUEST['acao'];
$id = $_REQUEST['id'];
$tipo = $_REQUEST['tipo'];
if ($id > 0) {
    if (!isset($_SESSION)) {
        session_start();
    }
    include_once '../../dados/config.php';
    require_once '../../dados/classes.php';
    $consulta = new banco();
    $dados = $consulta->PDOSelecionar("*", "ZPortareDespesas", "id = " . $id, 0, 1, "descricao");
    $d = new ArrayIterator($dados);
    $valor = $d->current();
}
?>
<script src="theme/default/js/functions.js"></script>

<input type="hidden" id="id" value="<?php 
echo $id;
?>
">
<input type="hidden" id="acao" value="<?php 
echo $acao;
?>
">
<input type="hidden" id="tipo" value="<?php 
Beispiel #11
0
$end = $start + $total_reg;
$condicao = "A.idperfil = B.id";
# Aqui virá os filtros
/*foreach ($_POST as $chave => $valor) {
      if(($chave<>'acao') and ($chave<>'tipo')){
          if($valor<>'') {
              if ((str_replace("_", ".", $chave)=='A.id') or (str_replace("_", ".", $chave)=='A.idservico') or (str_replace("_", ".", $chave)=='A.idcliente') or (str_replace("_", ".", $chave)=='A.idseguradora') or (str_replace("_", ".", $chave)=='A.status')) {
                  $condicao .= " and ". str_replace("_", ".", $chave). " = ".$valor;
              } else {
                  $condicao .= " and ". str_replace("_", ".", $chave). " like '%".$valor."%'";
              }
          }
      }
  }
  //echo $condicao;*/
$dados = $consulta->PDOSelecionar("A.id, A.nome, A.email, B.nome perfil, CASE A.ativo WHEN 1 THEN 'Ativo' ELSE 'Inativo' END status", "ZPortareLogin A, ZPortarePerfil B", $condicao, $start + 1, $end, "A.nome");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("ZPortareLogin A, ZPortarePerfil B", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->id . '">
                                <td>' . $m->id . '</td>
                                <td>' . $m->nome . '</td>
                                <td>' . $m->email . '</td>
                                <td>' . $m->perfil . '</td>
                                <td>' . $m->status . '</td>
                                <td>
                                    <a href="javascript:void(0)" class="btn btn-danger btn-xs" rel="tooltip" title="Editar" onclick="abrirModal(\'editar\', ' . $m->id . ' , \'view/' . $path . '/form.php\')">
Beispiel #12
0
    # A parte onde faz a inserção das despesas se encontram na trigger
    echo '<script language="javascript">
                carregaPagina(\'view/' . $path . '/list.php\');
                $("#modalCadastro").modal("hide");
              </script>';
} elseif ($acao == 'editar') {
    $consulta->PDOEditar("ZPortareKm", "idmotorista='" . $idmotorista . "', idcaminhao='" . $idcaminhao . "', observacao='" . $observacao . "', valorcombustivel='" . $valorcombustivel . "', dtretornoempresa='" . $dtretornoempresa . "', dtsaidaempresa = '" . $dtsaidaempresa . "'", "id = " . $id);
    $consulta->PDOEditar("ZPortareCheckList", "idmotorista='" . $idmotorista . "'", "idkm = " . $id);
    echo '<script language="javascript">
                $("#modalCadastro").modal("hide");
                carregaLinha("km/linha.php", ' . $id . ');
              </script>';
} elseif ($acao == 'excluir') {
    $id = $_POST['id'];
    #Checando se ele já tem movimento gerado
    $temmov = $consulta->PDOSelecionar("isnull(idmov, 0) idmov, id", "ZPortareKm", "id=" . $id, 0, 100, "id");
    $d = new ArrayIterator($temmov);
    $valor = $d->current();
    if ($valor->idmov != 0) {
        echo '<div class="alert alert-dismissable alert-danger">
                  <button type="button" class="close" data-dismiss="alert">×</button>' . '
                  Este movimento não pode ser excluído por ter vínculo ao RM Nucleus!
              </div> &nbsp;';
    } else {
        $consulta->PDOExcluir("ZPortareKmClientes", "idkm = " . $id);
        $consulta->PDOExcluir("ZPortareKmDespesas", "idkm = " . $id);
        $consulta->PDOExcluir("ZPortareCheckList", "idkm = " . $id);
        $consulta->PDOExcluir("ZPortareKmAbastecimentos", "idkm = " . $id);
        $consulta->PDOExcluir("ZPortareKm", "id = " . $id);
        echo '<script language="javascript">
            $("#' . $path . $id . '").remove();
Beispiel #13
0
$end = $start + $total_reg;
$condicao = "A.codconta = B.CODCONTA AND B.CODCOLIGADA IN (0, 5)";
# Aqui virá os filtros
/*foreach ($_POST as $chave => $valor) {
      if(($chave<>'acao') and ($chave<>'tipo')){
          if($valor<>'') {
              if ((str_replace("_", ".", $chave)=='A.id') or (str_replace("_", ".", $chave)=='A.idservico') or (str_replace("_", ".", $chave)=='A.idcliente') or (str_replace("_", ".", $chave)=='A.idseguradora') or (str_replace("_", ".", $chave)=='A.status')) {
                  $condicao .= " and ". str_replace("_", ".", $chave). " = ".$valor;
              } else {
                  $condicao .= " and ". str_replace("_", ".", $chave). " like '%".$valor."%'";
              }
          }
      }
  }
  //echo $condicao;*/
$dados = $consulta->PDOSelecionar("A.id, A.codconta, A.codigo, B.descricao,\r\n             CASE A.considerar WHEN 'D' THEN 'Tabela DRE' WHEN 'F' THEN 'Tabela Fixa' WHEN 'P' THEN 'Folha de Pagamento' END considerar,\r\n             CASE A.tipodespesa WHEN 'D' THEN 'Direta' WHEN 'I' THEN 'Indireta' END tipo", "ZPortarePlanocontas A, CCONTA B", $condicao, $start + 1, $end, "codigo");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("ZPortarePlanocontas A, CCONTA B", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->id . '">
                                <td>' . $m->id . '</td>
                                <td>' . $m->considerar . '</td>
                                <td>' . $m->tipo . '</td>
                                <td>' . $m->codconta . '</td>
                                <td>' . $m->codigo . '</td>
                                <td>' . $m->descricao . '</td>
                                <td>
$end = $start + $total_reg;
$condicao = "A.id NOT IN (SELECT X.id FROM ZPortareDremontagem X WITH (NOLOCK))";
# Aqui virá os filtros
/*foreach ($_POST as $chave => $valor) {
      if(($chave<>'acao') and ($chave<>'tipo')){
          if($valor<>'') {
              if ((str_replace("_", ".", $chave)=='A.id') or (str_replace("_", ".", $chave)=='A.idservico') or (str_replace("_", ".", $chave)=='A.idcliente') or (str_replace("_", ".", $chave)=='A.idseguradora') or (str_replace("_", ".", $chave)=='A.status')) {
                  $condicao .= " and ". str_replace("_", ".", $chave). " = ".$valor;
              } else {
                  $condicao .= " and ". str_replace("_", ".", $chave). " like '%".$valor."%'";
              }
          }
      }
  }
  //echo $condicao;*/
$dados = $consulta->PDOSelecionar("A.codconta, A.codigo, B.DESCRICAO", "ZPortarePlanocontas A WITH (NOLOCK) JOIN CCONTA B ON A.codconta = B.CODCONTA", $condicao, $start + 1, $end, "codigo");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("ZPortarePlanocontas A WITH (NOLOCK) JOIN CCONTA B ON A.codconta = B.CODCONTA", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->id . '">
                                <td>' . $m->codconta . '</td>
                                <td>' . $m->codigo . '</td>
                                <td>' . $m->DESCRICAO . '</td>
                              </tr>';
    $d->next();
}
?>
Beispiel #15
0
        <th>Combustível</th>
        <th>Volume</th>-->
        <th>
            <button type="button" class="btn btn-info btn-xs" rel="tooltip" title="Novo Registro" onclick="abrirModalExtra('inserir', 0 , 'view/<?php 
echo $path;
?>
/formclientes.php')">
                <i class="glyphicon glyphicon-plus"></i>
            </button>
        </th>
    </tr>
    </thead>
    <tbody>
    <?php 
$condicao = "A.idcliente = B.CODCFO AND A.idcombustivel = C.id AND B.CODCOLIGADA IN (0,5) AND A.idkm = " . $idkm;
$dados = $consulta->PDOSelecionar("A.id, A.idcliente, B.CODCFO, B.nome, (A.kmasfalto+A.kmchao) totalkm, CONVERT(VARCHAR(15), A.datasaida, 103) datasaida, C.descricao combustivel, A.volume", "ZPortareKmClientes A, FCFO B, ZPortareCombustivel C", $condicao, 0, 100, "B.nome");
$d = new ArrayIterator($dados);
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->id . '">
                                <td>' . $m->CODCFO . ' - ' . $m->nome . '</td>
                                <!--<td>' . number_format($m->totalkm, 0, ',', '.') . '</td>
                                <td>' . $m->datasaida . '</td>
                                <td>' . $m->combustivel . '</td>
                                <td>' . number_format($m->volume, 2, ',', '.') . '</td>-->
                                <td>
                                    <a href="javascript:void(0)" class="btn btn-success btn-xs" rel="tooltip" title="Editar" onclick="abrirModalExtra(\'editar\', ' . $m->id . ' , \'view/' . $path . '/formclientes.php\')">
                                        <i class="glyphicon glyphicon-edit"></i>
                                    </a>
                                    <a href="javascript:void(0)" class="btn btn-warning btn-xs" rel="tooltip" title="Despesas" onclick="CarregarDespesasCliente(' . $idkm . ' , \'' . $m->idcliente . '\')">
                                        <i class="glyphicon glyphicon-usd"></i>
<table class="table table-hover table-condensed">
    <thead>
    <tr>
        <th colspan="5"><h3>Caminhões e Agregados</h3></th>
    </tr>
    <tr>
        <th>Caminhão</th>
        <th>Despesa</th>
        <th>Período</th>
        <th>Valor</th>
        <th>Calculado</th>
    </tr>
    </thead>
    <tbody>
    <?php 
$dados = $consulta->PDOSelecionar("A.id,\r\n                                        CASE WHEN A.agregado = 0 THEN A.idcaminhao ELSE '**'+A.idcaminhao END idcaminhao,\r\n                                        B.descricao, CASE A.periododiario\r\n                                         when 365 then 'Anual'\r\n                                         when 180 then 'Semestral'\r\n                                         when 90 then 'Trimestral'\r\n                                         when 60 then 'Bimestral'\r\n                                         when 30 then 'Mensal'\r\n                                         when 1 then 'Diário'\r\n                                         end periodo, A.valor, A.calculado", "ZPortareKmDespesas A, ZPortareDespesas B", "A.iddespesa = B.id AND A.idkm = " . $idkm . " AND A.agregado in (0,1)", 0, 600, "idcaminhao DESC");
$d = new ArrayIterator($dados);
$totalagregado = 0;
while ($d->valid()) {
    $m = $d->current();
    echo '<tr>
                                <td>' . $m->idcaminhao . '</td>
                                <td>' . $m->descricao . '</td>
                                <td>' . $m->periodo . '</td>
                                <td>' . number_format($m->valor, 2, ',', '.') . '</td>
                                <td>' . number_format($m->calculado, 2, ',', '.') . '</td>
                              </tr>';
    $totalagregado = $totalagregado + $m->calculado;
    $d->next();
}
?>
Beispiel #17
0
if (!isset($_SESSION)) {
    session_start();
}
$linkurl = explode("/", $_SERVER['SCRIPT_NAME']);
$path = $linkurl[count($linkurl) - 2];
$acao = $_REQUEST['acao'];
$id = $_REQUEST['id'];
$tipo = $_REQUEST['tipo'];
if ($id > 0) {
    if (!isset($_SESSION)) {
        session_start();
    }
    include_once '../../dados/config.php';
    require_once '../../dados/classes.php';
    $consulta = new banco();
    $dados = $consulta->PDOSelecionar("*", "ZPortareCombustivel", "id = " . $id, 0, 1, "descricao");
    $d = new ArrayIterator($dados);
    $valor = $d->current();
}
?>
<script src="theme/default/js/functions.js"></script>

<input type="hidden" id="id" value="<?php 
echo $id;
?>
">
<input type="hidden" id="acao" value="<?php 
echo $acao;
?>
">
Beispiel #18
0
$end = $start + $total_reg;
$condicao = "A.id = B.iddespesa AND B.placa = '" . $placa . "'";
# Aqui virá os filtros
/*foreach ($_POST as $chave => $valor) {
      if(($chave<>'acao') and ($chave<>'tipo')){
          if($valor<>'') {
              if ((str_replace("_", ".", $chave)=='A.id') or (str_replace("_", ".", $chave)=='A.idservico') or (str_replace("_", ".", $chave)=='A.idcliente') or (str_replace("_", ".", $chave)=='A.idseguradora') or (str_replace("_", ".", $chave)=='A.status')) {
                  $condicao .= " and ". str_replace("_", ".", $chave). " = ".$valor;
              } else {
                  $condicao .= " and ". str_replace("_", ".", $chave). " like '%".$valor."%'";
              }
          }
      }
  }
  //echo $condicao;*/
$dados = $consulta->PDOSelecionar("B.id, A.descricao, B.valor, CASE B.periododiario\r\n\tWHEN 365 THEN 'Anual'\r\n\tWHEN 180 THEN 'Semestral'\r\n\tWHEN 90 THEN 'Trimestral'\r\n\tWHEN 60 THEN 'Bimestral'\r\n\tWHEN 30 THEN 'Mensal'\r\n\tWHEN 1 THEN 'Diária'\r\nEND AS tipodiaria", "ZPortareDespesas A, ZPortareCaminhoesdespesas B", $condicao, $start + 1, $end, "A.descricao");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("ZPortareDespesas A, ZPortareCaminhoesdespesas B", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->id . '">
                                <td>' . $m->descricao . '</td>
                                <td>' . $m->tipodiaria . '</td>
                                <td>' . number_format($m->valor, 2, ',', '.') . '</td>
                                <td>
                                    <a href="javascript:void(0)" class="btn btn-danger btn-xs" rel="tooltip" title="Editar" onclick="abrirModal(\'editar\', ' . $m->id . ' , \'view/' . $path . '/form.php\')">
                                        <i class="glyphicon glyphicon-edit"></i>
                                    </a>
Beispiel #19
0
if (!isset($_SESSION)) {
    session_start();
}
include_once '../../dados/config.php';
require_once '../../dados/classes.php';
$consulta = new banco();
$query = strtolower($_REQUEST["term"]);
$quem = $_REQUEST['quem'];
$codfilial = $_REQUEST['codfilial'];
/*if ($quem=="idmotorista"){
    $sql = $consulta->PDOSelecionar("chapa id, nome, (chapa+' - '+nome) text", "pfunc", "codcoligada = 5 and (nome LIKE '".$query."%' or chapa like '".$query."%')", 0, 100,"nome"); 

} else*/
if ($quem == "codconta") {
    $sql = $consulta->PDOSelecionar("CODCONTA id, CODCONTA+' - '+DESCRICAO text, CODCONTA, DESCRICAO", "CCONTA", "CODCOLIGADA IN (0, 5) AND INATIVA = 0 AND (DESCRICAO like '" . $query . "%' OR CODCONTA like '" . $query . "%')", 0, 100, "CODCONTA");
} elseif ($quem == "iddespesa") {
    $sql = $consulta->PDOSelecionar("id, descricao text, descricao", "ZPortareDespesas", "tipo = 'v' and descricao like '" . $query . "%'", 0, 100, "descricao");
} elseif ($quem == "idcaminhao") {
    $sql = $consulta->PDOSelecionar("PLACA id, PLACA text, PLACA", "ZPortalCAMINHOES", "PLACA like '" . $query . "%'", 0, 100, "PLACA");
} elseif ($quem == "idmotorista") {
    $sql = $consulta->PDOSelecionar("CHAPA id, (CHAPA+' - '+NOME) text, NOME", "PFUNC", "CODFUNCAO IN ('003', '018', '019', '099') AND CODSITUACAO <> 'D' AND CODCOLIGADA = 5 AND\r\n         (CHAPA like '" . $query . "%' OR NOME LIKE '" . $query . "%')", 0, 100, "NOME");
} elseif ($quem == "idcliente") {
    $sql = $consulta->PDOSelecionar("CODCFO id, (NOME+' - '+CGCCFO) text, ISNULL(VALOROP1, 0) ASFALTO, ISNULL(VALOROP2, 0) CHAO, NOME", "FCFO", "CODCOLIGADA in (0,5) AND ATIVO=1 AND (CGCCFO like '" . $query . "%' OR NOME LIKE '" . $query . "%')", 0, 100, "NOME");
} elseif ($quem == "idcombustivel") {
    $sql = $consulta->PDOSelecionar("id, descricao text, descricao", "ZPortareCombustivel", "descricao like '" . $query . "%'", 0, 100, "descricao");
} elseif ($quem == "idconta") {
    $sql = $consulta->PDOSelecionar("A.id, (A.codigo+' - '+B.descricao) text, A.codigo", "ZPortarePlanocontas A, CCONTA B", "A.codconta = B.codconta and (B.descricao like '" . $query . "%' or A.codigo like '" . $query . "%')", 0, 100, "A.codigo");
} elseif ($quem == "codccusto") {
    $sql = $consulta->PDOSelecionarPadrao("CODCCUSTO id, (CODCCUSTO+' - '+NOME) text", "GCCUSTO", "CODCOLIGADA=5 AND ATIVO='T' AND (CODCCUSTO LIKE '" . $query . "%' OR NOME LIKE '" . $query . "%')");
} elseif ($quem == "codtmv") {
Beispiel #20
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
include_once '../../dados/config.php';
require_once '../../dados/classes.php';
$consulta = new banco();
$linkurl = explode("/", $_SERVER['SCRIPT_NAME']);
$path = $linkurl[count($linkurl) - 2];
$acao = $_REQUEST['acao'];
$id = $_REQUEST['id'];
$dados = $consulta->PDOSelecionar("*", "ZPortareLogin", "id = " . $id, 0, 1, "id");
$d = new ArrayIterator($dados);
$valor = $d->current();
?>

<input type="hidden" id="id" value="<?php 
echo $id;
?>
">
<input type="hidden" id="acao" value="<?php 
echo $acao;
?>
">


<div class="col-md-12">
    <label for="nome">Nome</label>
    <input type="text" id="nome" class="form-control" placeholder="Nome de Usuário" value="<?php 
echo $valor->nome;
Beispiel #21
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
include_once '../../dados/config.php';
require_once '../../dados/classes.php';
$consulta = new banco();
$tipo = $_REQUEST['tipo'];
$placa = $_REQUEST['placa'];
$sql = $consulta->PDOSelecionar("IDOBJOFPAI,\r\n\t\t\tCONVERT(VARCHAR(30), DATAENTRADA, 103) + ' - ' +CONVERT(VARCHAR(30), DATAENTRADA, 108) DTHRENTRADA,\r\n\t\t\tCONVERT(VARCHAR(30), DATASAIDA, 103) + ' - ' +CONVERT(VARCHAR(30), DATASAIDA, 108) DTHRSAIDA,\r\n\t\t\tRECMODIFIEDBY, DATASAIDA", "OFHISTOBJFILHO (NOLOCK)", "IDOBJOF = '" . $placa . "'", 0, 500, "DATASAIDA ASC");
$d = new ArrayIterator($sql);
echo '<table class="table table-hover table-condensed">
				<thead>
				<tr>
					<th>Placa</th>
					<th>Dt/Hr Entrada</th>
					<th>Dt/Hr Saída</th>
					<th>Usuário RM</th>
				</tr>
				</thead>';
while ($d->valid()) {
    $valor = $d->current();
    echo '<tr>
				<td>' . $valor->IDOBJOFPAI . '</td>
				<td>' . $valor->DTHRENTRADA . '</td>
				<td>' . $valor->DTHRSAIDA . '</td>
				<td>' . $valor->RECMODIFIEDBY . '</td>
			  </tr>';
    $d->next();
}
Beispiel #22
0
$end = $start + $total_reg;
$condicao = "tipo = '" . $tipo . "'";
# Aqui virá os filtros
/*foreach ($_POST as $chave => $valor) {
      if(($chave<>'acao') and ($chave<>'tipo')){
          if($valor<>'') {
              if ((str_replace("_", ".", $chave)=='A.id') or (str_replace("_", ".", $chave)=='A.idservico') or (str_replace("_", ".", $chave)=='A.idcliente') or (str_replace("_", ".", $chave)=='A.idseguradora') or (str_replace("_", ".", $chave)=='A.status')) {
                  $condicao .= " and ". str_replace("_", ".", $chave). " = ".$valor;
              } else {
                  $condicao .= " and ". str_replace("_", ".", $chave). " like '%".$valor."%'";
              }
          }
      }
  }
  //echo $condicao;*/
$dados = $consulta->PDOSelecionar("*", "ZPortareDespesas", $condicao, $start + 1, $end, "descricao");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("ZPortareDespesas", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->id . '">
                                <td>' . $m->id . '</td>
                                <td>' . $m->descricao . '</td>
                                <td>' . number_format($m->valor, 2, ',', '.') . '</td>
                                <td>
                                    <a href="javascript:void(0)" class="btn btn-danger btn-xs" rel="tooltip" title="Editar" onclick="abrirModal(\'editar\', ' . $m->id . ' , \'view/' . $path . '/form.php?tipo=' . $tipo . '\')">
                                        <i class="glyphicon glyphicon-edit"></i>
                                    </a>
Beispiel #23
0
$end = $start + $total_reg;
$condicao = "1 = 1";
# Aqui virá os filtros
/*foreach ($_POST as $chave => $valor) {
      if(($chave<>'acao') and ($chave<>'tipo')){
          if($valor<>'') {
              if ((str_replace("_", ".", $chave)=='A.id') or (str_replace("_", ".", $chave)=='A.idservico') or (str_replace("_", ".", $chave)=='A.idcliente') or (str_replace("_", ".", $chave)=='A.idseguradora') or (str_replace("_", ".", $chave)=='A.status')) {
                  $condicao .= " and ". str_replace("_", ".", $chave). " = ".$valor;
              } else {
                  $condicao .= " and ". str_replace("_", ".", $chave). " like '%".$valor."%'";
              }
          }
      }
  }
  //echo $condicao;*/
$dados = $consulta->PDOSelecionar("*", "ZPortarePerfil", $condicao, $start + 1, $end, "nome");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("ZPortarePerfil", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->id . '">
                                <td>' . $m->id . '</td>
                                <td>' . $m->nome . '</td>
                                <td>
                                    <a href="javascript:void(0)" class="btn btn-danger btn-xs" rel="tooltip" title="Editar" onclick="abrirModal(\'editar\', ' . $m->id . ' , \'view/' . $path . '/form.php\')">
                                        <i class="glyphicon glyphicon-edit"></i>
                                    </a>
                                    <a href="javascript:void(0)" class="btn btn-primary btn-xs" rel="tooltip" title="Excluir" onclick="modalExcluir(\'view/' . $path . '/actions.php\', ' . $m->id . ')">
Beispiel #24
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
$nomelogin = $_SESSION['nomelogin'];
$idlogin = $_SESSION['idlogin'];
include_once '../../dados/config.php';
require_once '../../dados/classes.php';
$consulta = new banco();
$linkurl = explode("/", $_SERVER['SCRIPT_NAME']);
$path = $linkurl[count($linkurl) - 2];
$id = $_REQUEST['id'];
$dados = $consulta->PDOSelecionar("status, id", "ZPortareKm", "id = " . $id, 0, 1, "id");
$d = new ArrayIterator($dados);
$valor = $d->current();
?>
<script src="theme/default/js/functions.js"></script>

<input type="hidden" id="id" value="<?php 
echo $id;
?>
">

<label for="status">Selecionar novo Status</label>
<select id="status" class="form-control">
    <option value="0" <?php 
if ($valor->status == 0) {
    echo "selected";
}
?>
Beispiel #25
0
        ?>
/form.php?agregado=<?php 
        echo $agregado;
        ?>
')">
                <i class="glyphicon glyphicon-plus"></i>
            </button>
            <?php 
    }
    ?>
        </th>
    </tr>
    </thead>
    <tbody>
    <?php 
    $dados = $consulta->PDOSelecionar("A.id,\r\n                                        CASE WHEN A.agregado = 0 THEN A.idcaminhao ELSE '**'+A.idcaminhao END idcaminhao,\r\n                                        B.descricao, A.calculado", "ZPortareKmDespesas A, ZPortareDespesas B", "A.iddespesa = B.id AND A.idkm = " . $idkm . " AND A.agregado in (" . $agregado . ")", 0, 600, "idcaminhao DESC");
    $d = new ArrayIterator($dados);
    while ($d->valid()) {
        $m = $d->current();
        echo '<tr id="' . $path . $m->id . '">
                                <td>' . $m->descricao . '</td>
                                <td>' . number_format($m->calculado, 2, ',', '.') . '</td>
                                <td>
                                    <a href="javascript:void(0)" class="btn btn-danger btn-xs" rel="tooltip" title="Editar" onclick="abrirModalExtra(\'editar\', ' . $m->id . ' , \'view/' . $path . '/form.php\')">
                                        <i class="glyphicon glyphicon-edit"></i>
                                    </a>
                                    <a href="javascript:void(0)" class="btn btn-primary btn-xs" rel="tooltip" title="Excluir" onclick="modalExcluir(\'view/' . $path . '/actions.php\', ' . $m->id . ')">
                                        <i class="glyphicon glyphicon-trash"></i>
                                    </a>
                                </td>
                              </tr>';
Beispiel #26
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
include_once '../../dados/config.php';
require_once '../../dados/classes.php';
$consulta = new banco();
$tipo = $_REQUEST['tipo'];
$placa = $_REQUEST['placa'];
if ($tipo == 'caminhoes') {
    $sql = $consulta->PDOSelecionar("IDOBJOF, CONVERT(VARCHAR(30), DATAENTRADA, 103) + ' - ' +CONVERT(VARCHAR(30), DATAENTRADA, 108) DTHRENTRADA, RECMODIFIEDBY", "OFHISTOBJFILHO (NOLOCK)", "DATASAIDA IS NULL AND IDOBJOFPAI = '" . $placa . "'", 0, 500, "IDOBJOF");
    $d = new ArrayIterator($sql);
    echo '<table class="table table-hover table-condensed">
				<thead>
				<tr>
					<th>Placa</th>
					<th>Dt Entrada</th>
					<th>Usuário RM</th>
				</tr>
				</thead>';
    while ($d->valid()) {
        $valor = $d->current();
        echo '<tr>
				<td>' . $valor->IDOBJOF . '</td>
				<td>' . $valor->DTHRENTRADA . '</td>
				<td>' . $valor->RECMODIFIEDBY . '</td>
			  </tr>';
        $d->next();
    }
    echo '</table>';
Beispiel #27
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
include_once '../../dados/config.php';
require_once '../../dados/classes.php';
$consulta = new banco();
$linkurl = explode("/", $_SERVER['SCRIPT_NAME']);
$path = $linkurl[count($linkurl) - 2];
$acao = $_REQUEST['acao'];
$id = $_REQUEST['id'];
if ($id > 0) {
    $dados = $consulta->PDOSelecionar("B.*, A.descricao", "ZPortareDespesas A, ZPortareCaminhoesdespesas B", "A.id = B.iddespesa AND B.id = " . $id, 0, 1, "B.id");
    $d = new ArrayIterator($dados);
    $valor = $d->current();
}
?>
<link href="theme/default/css/select2.css" rel="stylesheet">

<style>
    .select2-container .select2-choice {
        padding: 0px;
        height: 34px;
        padding: 2px 0px 0px 8px;

    }
    .override {
        padding: 0px;
    }
</style>
Beispiel #28
0
if (!isset($_SESSION)) {
    session_start();
}
$linkurl = explode("/", $_SERVER['SCRIPT_NAME']);
$path = $linkurl[count($linkurl) - 2];
$acao = $_REQUEST['acao'];
$id = $_REQUEST['id'];
$tipo = $_REQUEST['tipo'];
if ($id > 0) {
    if (!isset($_SESSION)) {
        session_start();
    }
    include_once '../../dados/config.php';
    require_once '../../dados/classes.php';
    $consulta = new banco();
    $dados = $consulta->PDOSelecionar("A.id, A.idmotorista, (A.idmotorista+' - '+B.NOME) motorista, A.operadora, A.numero", "ZPortareTelefones A, PFUNC B", "A.idmotorista = B.CHAPA AND B.CODCOLIGADA = 5 AND A.id = " . $id, 0, 1, "A.operadora");
    $d = new ArrayIterator($dados);
    $valor = $d->current();
}
?>
<link href="theme/default/css/select2.css" rel="stylesheet">

<style>
    .select2-container .select2-choice {
        padding: 0px;
        height: 34px;
        padding: 2px 0px 0px 8px;

    }
    .override {
        padding: 0px;
Beispiel #29
0
$end = $start + $total_reg;
$condicao = "IDTIPOOBJ = 7";
# Aqui virá os filtros
/*foreach ($_POST as $chave => $valor) {
      if(($chave<>'acao') and ($chave<>'tipo')){
          if($valor<>'') {
              if ((str_replace("_", ".", $chave)=='A.id') or (str_replace("_", ".", $chave)=='A.idservico') or (str_replace("_", ".", $chave)=='A.idcliente') or (str_replace("_", ".", $chave)=='A.idseguradora') or (str_replace("_", ".", $chave)=='A.status')) {
                  $condicao .= " and ". str_replace("_", ".", $chave). " = ".$valor;
              } else {
                  $condicao .= " and ". str_replace("_", ".", $chave). " like '%".$valor."%'";
              }
          }
      }
  }
  //echo $condicao;*/
$dados = $consulta->PDOSelecionar("*", "ZPortalCAMINHOES", $condicao, $start + 1, $end, "MODELO");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("ZPortalCAMINHOES", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->PLACA . '">
                                <td>' . $m->PLACA . '</td>
                                <td>' . $m->MODELO . '</td>
                                <td>' . $m->VENCIPVA . '</td>
                                <td>
                                    <a href="javascript:void(0)" onclick="CarregarDespesas(\'' . $m->PLACA . '\')" class="btn btn-info btn-xs" rel="tooltip" title="Ver Despesas">
                                        <i class="glyphicon glyphicon-folder-open"></i>
                                    </a>
Beispiel #30
0
$end = $start + $total_reg;
$condicao = "A.idmotorista = B.CHAPA AND B.CODCOLIGADA = 5";
# Aqui virá os filtros
/*foreach ($_POST as $chave => $valor) {
      if(($chave<>'acao') and ($chave<>'tipo')){
          if($valor<>'') {
              if ((str_replace("_", ".", $chave)=='A.id') or (str_replace("_", ".", $chave)=='A.idservico') or (str_replace("_", ".", $chave)=='A.idcliente') or (str_replace("_", ".", $chave)=='A.idseguradora') or (str_replace("_", ".", $chave)=='A.status')) {
                  $condicao .= " and ". str_replace("_", ".", $chave). " = ".$valor;
              } else {
                  $condicao .= " and ". str_replace("_", ".", $chave). " like '%".$valor."%'";
              }
          }
      }
  }
  //echo $condicao;*/
$dados = $consulta->PDOSelecionar("A.id, (A.idmotorista+' - '+B.NOME) NOME, A.operadora, A.numero", "ZPortareTelefones A, PFUNC B", $condicao, $start + 1, $end, "B.NOME");
$d = new ArrayIterator($dados);
$tr = $consulta->PDOQtderegistro("ZPortareTelefones A, PFUNC B", $condicao);
// Total de registros
$tp = ceil($tr / $total_reg);
// Total de registros na página
while ($d->valid()) {
    $m = $d->current();
    echo '<tr id="' . $path . $m->id . '">
                                <td>' . $m->id . '</td>
                                <td>' . $m->NOME . '</td>
                                <td>' . $m->operadora . '</td>
                                <td>' . $m->numero . '</td>
                                <td>
                                    <a href="javascript:void(0)" class="btn btn-danger btn-xs" rel="tooltip" title="Editar" onclick="abrirModal(\'editar\', ' . $m->id . ' , \'view/' . $path . '/form.php\')">
                                        <i class="glyphicon glyphicon-edit"></i>