Ir para conteúdo
Fórum Script Brasil

7master

Membros
  • Total de itens

    5
  • Registro em

  • Última visita

Sobre 7master

Últimos Visitantes

O bloco dos últimos visitantes está desativado e não está sendo visualizado por outros usuários.

7master's Achievements

0

Reputação

  1. Olá pessoal, tudo em paz? Estou com uma dúvida, estou precisando alocar os resultados anual das lojas mês a mês: exemplo: LOJA JAN FEV MAR ABR MAI JUN JUL AGO SET OUT NOV DEZ Tenho um select que me retorna os seguintes dados: Se observar a loja que JOY teve resultados até novembro, porém o resultado de janeiro da loja 01 está sendo alocado no mês de dezembro da loja que JOY, o correto seria a coluna DEZ da loja que JOY ficar 0,00. Resultado PHP está em anexo. minha pagina php <?php header("Content-Type: text/html; charset=utf-8",true); $servidor = 'localhost:E:\Premises\LinhaCruzada\bk\PREMISES.FDB'; //conexão com o banco, se der erro mostrara uma mensagem. if (!($dbh=ibase_connect($servidor, 'SYSDBA', 'masterkey'))) die('Erro ao conectar: ' . ibase_errmsg()); $loja = 0; $ano = 2018; $sql = "select ordem, mes, loj_nome, qtde, total, custo, custo_total, lucro from sp_dash_evolutivo_lojas($ano) order by loj_nome, ordem"; $query= ibase_query ($dbh, $sql); $sql_lojas = "SELECT LOJ_ID , loj_nome FROM LOJAS order by LOJ_id"; $meses = array(); $valor_mes = array(); $lojas = array(); $indice_lojas = 0; $indice_mes = 0; $total = 0; //Executa a instrução SQL $qry_lojas = ibase_query ($dbh, $sql_lojas); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous"> <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <style type="text/css"> .table td, .table th { padding: .4rem; font-size:12px } </style> </head> <body> <div class="row col-md-12 "> <div class="col-md-12 "> <table class="table table-striped table-bordered table-hover"> <thead> <tr class="text-center" style="background-color: #F5F5F5; "> <th colspan="2">Ano 2017</th> </tr> <tr> <th scope="col">LOJAS</th> <th scope="col" class="text-center">JAN</th> <th scope="col" class="text-center">FEV</th> <th scope="col" class="text-center">MAR</th> <th scope="col" class="text-center">ABR</th> <th scope="col" class="text-center">MAI</th> <th scope="col" class="text-center">JUN</th> <th scope="col" class="text-center">JUL</th> <th scope="col" class="text-center">AGO</th> <th scope="col" class="text-center">SET</th> <th scope="col" class="text-center">OUT</th> <th scope="col" class="text-center">NOV</th> <th scope="col" class="text-center">DEZ</th> </tr> </thead> <tbody> <?php $total_mes = 0; $total_jan = 0; $total_fev = 0; $total_mar = 0; $total_abr = 0; $total_mai = 0; $total_jun = 0; $total_jul = 0; $total_ago = 0; $total_set = 0; $total_out = 0; $total_nov = 0; $total_dez = 0; while ($row = ibase_fetch_object($qry_lojas)){ //gravando os nomes no array $lojas[$indice_lojas] = $row->LOJ_NOME;//indice 0 $indice_lojas = $indice_lojas + 1; } while ($row = ibase_fetch_object($query)) { //guardar os valores no array $valor_mes[$indice_mes] = $row->LUCRO ?? 0; $indice_mes = $indice_mes + 1; } //zerar os índices $indice_lojas = 0; $indice_mes = 0; foreach($lojas as $nome){ //fazer echo com array echo '<tr>'; echo '<td>' . $lojas[$indice_lojas] . '</td>'; $indice_lojas = $indice_lojas + 1; //OBS: todos as formas de pagamento deverão ter OBRIGATÓRIAMENTE os 12 meses preenchidos for($i = 1; $i < 13; $i++){ echo '<td>' . number_format($valor_mes[$indice_mes] ?? 0, 2, ',', '.') . '</td>'; $indice_mes = $indice_mes + 1; } echo '</tr>'; } //Libera a memoria usada ibase_free_result($query); //fecha conexão com o firebird ibase_close($dbh); ?> </html> O correto seria preencher com zero os meses que não resultado, porém não estou conseguindo.
  2. Olá pessoal, estou precisando da ajuda de vocês. É o seguinte, estou precisando fazer um agrumamento dos dados em uma table, tipo um relatório, porém estou com dúvida no posicionamento dos laços. Estou seguindo a seguinte logica, mas não esta dando certo. 1º - Faço o select para pegar o registro que sera feito o agrupamento, e faço um laço para exibir o registro mas não fecho o laço ainda; 2º - Implemento o html do cabeçalho da tabela dando um echo no registro agrupado; 3º - Faço o select dos itens com a clausula where do registro agrupado, faço um laço para exibir o registro e implemento o html dos itens e fecho o laço do select dos itens; 4º - Fecho o laço do primeiro select; Anexei duas imagens, uma chamada resultado final que seria o resultado que estou tentando fazer, e a imagem agrupamento php é a que está atualmente. Segue o código: <?php session_start(); header("Content-Type: text/html; charset=utf8", true); include_once("conmysql.php"); $sql= 'SET NAMES utf8'; mysqli_query($con, $sql); $sql = 'SET character_set_connection=utf8'; mysqli_query($con, $sql); $sql ='SET character_set_client=utf8'; mysqli_query($con, $sql); $sql ='SET character_set_results=utf8'; mysqli_query($con, $sql); $fatura = $_GET['fatura']; ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <link rel="stylesheet" href="css/font-awesome.min.css"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link href="css/passagens.css" rel="stylesheet" type="text/css"/> </head> <body> <a href="painel.php?link=6&NumFatura=<?php echo $fatura;?>" style="text-decoration: none; font-size: 12px; font-family: 'Arial'; background-color: #428BCA; color: #fff; padding: 5px" ><i class="fa fa-reply-all" aria-hidden="true"></i> Voltar</a> <a href="#" style="text-decoration: none; font-size: 12px; font-family: 'Arial'; background-color: #DDDDDD; color: #333; padding: 5px" onclick="window.print(); return false;"><i class="fa fa-print" aria-hidden="true"></i> Imprimir</a> <br><br> <table class="table table-bordered table-striped table-responsive"> <div class="panel panel-default"> <!-- Default panel contents --> <div class="panel-heading text-center"><h4>TITULO</h4></div> <div class="panel-body text-center"> <h4><strong>OFÍCIO Nº: <?php echo $OFICIO_FORMATADO; ?></strong></h4> </div> <?php $sqlOficio = "SELECT S.OFICIO, concat(`s`.`SOL_ID`, concat('-', lpad(`s`.`NUMERO`, length(`s`.`NUMERO`), '0'), '/'), date_format(`s`.`DATA_CAD`, '%Y')) AS OFICIO_FORMATADO FROM SOLICITACOES S WHERE S.FAT_id = ".$fatura." ORDER BY S.OFICIO "; // if ($resultado = mysqli_query($con, $sqlOficio)) { $qtdeOficios = mysqli_num_rows($resultado); while ($dados_oficio = mysqli_fetch_assoc($resultado)) { ?> <thead> <tr> <th colspan="9"> Número do Ofício: <?php echo $dados_oficio['OFICIO_FORMATADO']?> </th> </tr> <tr style="background: #999"> <th> Data do Ofício </th> <th> Nome do Passageiro </th> <th> Trecho </th> <th> Data Hora </th> <th> Empresa </th> <th class="thdireita"> Valor Unitário </th> <th class="thdireita"> Taxa Adm </th> <th class="thdireita"> Taxa Emb </th> <th class="thdireita"> Valor Total </th> </tr> </thead> <tbody> <?php $sql = "SELECT S.OFICIO, STATUS.STATUS, concat(`s`.`SOL_ID`, concat('-', lpad(`s`.`NUMERO`, length(`s`.`NUMERO`), '0'), '/'), date_format(`s`.`DATA_CAD`, '%Y')) AS OFICIO_FORMATADO, date_format(passagens.DATA_CAD, '%d/%m/%Y') AS DATA_CAD, passagens.PASSAGEIRO, PASSAGENS.CPF, PASSAGENS.RG, PASSAGENS.CARTAO_FIDELIDADE, PASSAGENS.DATA_EMBARQUE, PASSAGENS.HORA_EMBARQUE, E.EMP_FANTASIA, CONCAT(date_format(passagens.DATA_EMBARQUE, '%d/%m/%Y'),' às ', PASSAGENS.HORA_EMBARQUE) AS DTHR_EMBARQUE, PASSAGENS.ORIGEM, PASSAGENS.DESTINO, CONCAT(PASSAGENS.ORIGEM,' <-> ',PASSAGENS.DESTINO) as TRECHO, PASSAGENS.BILHETE, if(passagens.STATUS = 7, passagens.vr_unitario * 5/100, passagens.vr_unitario) as VR_UNITARIO, if(passagens.STATUS = 7,0, passagens.taxa_embarque) as TAXA_EMBARQUE, PASSAGENS.TAXA_ADMIN, (SELECT USU_NOME FROM USUARIOS WHERE USU_ID = PASSAGENS.SOLICITANTE_ID) AS SOLICITANTE, if(passagens.STATUS = 7, passagens.taxa_admin + (passagens.vr_unitario * 5/100), passagens.vr_total) as VR_TOTAL, ORGAOS.ORG_RAZAO, usuarios.USU_NOME FROM PASSAGENS INNER JOIN SOLICITACOES S ON (PASSAGENS.SOL_ID = S.SOL_ID) INNER JOIN EMPRESAS E ON (S.EMP_ID = E.EMP_ID) INNER JOIN ORGAOS ON (PASSAGENS.ORG_ID = ORGAOS.ORG_ID) INNER JOIN USUARIOS ON (PASSAGENS.USU_ID = usuarios.USU_ID) INNER JOIN STATUS ON(PASSAGENS.STATUS = STATUS.STATUS_ID) WHERE S.OFICIO = ".$dados_oficio['OFICIO']." GROUP BY S.OFICIO ORDER BY S.OFICIO,PASSAGENS.ID "; // ?> <?php if ($result = mysqli_query($con, $sql)) { while ($dados = mysqli_fetch_assoc($result)) { $QtdePassagens = $result->num_rows; $TotalVrUnitario += $dados['VR_UNITARIO']; $TotalTaxaEmbarque += $dados['TAXA_EMBARQUE']; $TotalTaxaAdm += $dados['TAXA_ADMIN']; $TotalValorTotal += $dados['VR_TOTAL']; ?> <tr> <td> <?php echo $dados['DATA_CAD'] ?> </td> <td> <?php echo $dados['PASSAGEIRO']; ?> </td> <td> <?php echo $dados['TRECHO']; ?> </td> <td> <?php echo $dados['DTHR_EMBARQUE']; ?> </td> <td> <?php echo $dados['EMP_FANTASIA']; ?> </td> <td class="thdireita"> <?php echo number_format($dados['VR_UNITARIO'], 2, ',', '.'); ?>&nbsp; </td> <td class="thdireita"> <?php echo number_format($dados['TAXA_ADMIN'], 2, ',', '.'); ?>&nbsp; </td> <td class="thdireita"> <?php echo number_format($dados['TAXA_EMBARQUE'], 2, ',', '.'); ?>&nbsp; </td> <td class="thdireita"> <?php echo number_format($dados['VR_TOTAL'], 2, ',', '.'); ?>&nbsp; </td> </tr> <?php } } ?> </tbody> <tr style="background: #DFDFDF"> <td> <strong>Qtde de Passagens: <?php echo $QtdePassagens; ?> </strong> </td> <td> </td> <td> </td> <td> </td> <td class="thdireita"> </td> <td class="thdireita fundoTotais"> <?php echo number_format($TotalVrUnitario, 2, ',', '.'); ?>&nbsp; </td> <td class="thdireita fundoTotais"> <?php echo number_format($TotalTaxaEmbarque, 2, ',', '.'); ?>&nbsp; </td> <td class="thdireita fundoTotais"> <?php echo number_format($TotalTaxaAdm, 2, ',', '.'); ?>&nbsp; </td> <td class="thdireita fundoTotais"> <?php echo number_format($TotalValorTotal, 2, ',', '.'); ?>&nbsp; </td> </tr> <?php } } ?> </table> <br><br> </div> </body> </html>
  3. Olá pessoal, estou tentando imprimir usando o código: <body onLoad="javascript: printPage();"> Porém, quando visualizo a pagina para impressão ele não carrega a formatação atual da página, existe alguma forma de carregar? Código da Página <?php header("Content-Type: text/html; charset=utf8", true); include_once("conmysql.php"); session_start(); // include_once("seguranca.php"); include_once("funcoes.php"); setlocale(LC_ALL, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese'); date_default_timezone_set('America/Sao_Paulo'); function after ($this, $inthat) { if (!is_bool(strpos($inthat, $this))) return substr($inthat, strpos($inthat,$this)+strlen($this)); }; function before ($this, $inthat) { return substr($inthat, 0, strpos($inthat, $this)); }; function GetDadosPassagem($ID=0){ $EditPAS_ID = $ID; // print_r($ID); // var_dump($ID); } $id = $_GET['id']; $id_print = $_GET['id']; $id_ida = before (',',$id ); $id_volta = after (',',$id ); $parte = explode(",", $id); $Qtde_Oficio = count(array_keys($parte)) ; $Qtde_Oficio = $Qtde_Oficio -1; $qry_master = "SELECT S.SOL_ID, S.OFICIO, concat(S.SOL_ID,concat('-', lpad(S.NUMERO, 3, '0'),'/'),DATE_FORMAT(S.DATA_CAD,'%Y')) AS OFICIO_FORMATADO , P.ORIGEM, P.DESTINO, S.NUMERO, DATE_FORMAT(S.DATA_CAD,'%d/%m/%Y') as DATA_CAD, U.ORG_ID, O.ORG_RAZAO, U.USU_NOME, U.USU_EMAIL, U.USU_TELEFONE, U.PERF_ID, CASE S.TIPO_SERVICO WHEN 'C' THEN 'CONVECIONAL' WHEN 'E' THEN 'EXECUTIVO' WHEN 'L' THEN 'LEITO' END AS TIPO_SERVICO, E.EMP_FANTASIA, O.ORG_LOG, S.STATUS, S.OBS, (SELECT COUNT(PASSAGENS.SOL_ID) FROM PASSAGENS WHERE PASSAGENS.SOL_ID = S.SOL_ID) AS QTDE_PASSAGEM FROM SOLICITACOES S INNER JOIN PASSAGENS P ON (S.SOL_ID = P.SOL_ID) INNER JOIN ORGAOS O ON (S.ORG_ID = O.ORG_ID) INNER JOIN USUARIOS U ON (S.USU_ID = U.USU_ID) INNER JOIN EMPRESAS E ON (S.EMP_ID = E.EMP_ID) WHERE S.SOL_ID in( ".$id.") ORDER BY S.SOL_ID DESC "; if ($resultado = mysqli_query($con,$qry_master)){ $QTDE_TOTAL_PASSAGEM = mysqli_num_rows($resultado); while ($registro = $resultado->fetch_object()) { $SOL_ID = $registro->SOL_ID; $USU_NOME = $registro->USU_NOME; $USU_EMAIL = $registro->USU_EMAIL; $USU_TELEFONE = $registro->USU_TELEFONE; $NUMERO = $registro->NUMERO; $OFICIO = $registro->OFICIO_FORMATADO; $ORG_ID = $registro->ORG_ID; $ORG_RAZAO = $registro->ORG_RAZAO; $PERF_ID = $registro->PERF_ID; $STATUS = $registro->STATUS; $EMP_FANTASIA = $registro->EMP_FANTASIA; // $QTDE_PASSAGEM = $registro->QTDE_PASSAGEM; $ORIGEM = $registro->ORIGEM; $ORG_LOG = $registro->ORG_LOG; $OBS = $registro->OBS; } } // pegando os gestores do orgão e adicionando os $SQL_Gestor = "SELECT USUARIOS.USU_ID, USUARIOS.USU_NOME, USUARIOS.USU_EMAIL, USUARIOS.USU_TELEFONE FROM USUARIOS INNER JOIN PERFIL ON (USUARIOS.PERF_ID = PERFIL.PERF_ID) WHERE USUARIOS.PERF_ID = 3 AND USUARIOS.ORG_ID = ".$ORG_ID; if ($resul_gestor=mysqli_query($con,$SQL_Gestor)){ while ($lin=mysqli_fetch_assoc($resul_gestor)){ $GESTOR_NOME = utf8_decode($lin['USU_NOME']); $GESTOR_TELEFONE = utf8_decode($lin['USU_TELEFONE']); $GESTOR_EMAIL = utf8_decode($lin['USU_EMAIL']); } } ?> <!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title></title> <link rel="shortcut icon" type="image/png" href="img/favicon.ico"/> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" > <link href="http://fonts.googleapis.com/css?family=Lato:300,400,700" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="css/font-awesome.min.css" > <link href="css/solicitacoes.css" rel="stylesheet" > <link href="css/painel.css" rel="stylesheet" > <style type="text/css"> body{ margin: 0; padding: 0; font-size: small !important; background: #FFF; } h3{font-size:16px; font-weight: bold;} </style> </head> <body onLoad="javascript: printPage();"> <div class="topo text-right" style="font-size:10px; margin-right:5px; color:666;"> <?php date_default_timezone_set('America/Sao_Paulo'); $date = date('d/m/Y H:i'); echo 'Data da Impressão: '. $date.' - Usuário: '. $_SESSION['usuario_nome']; ?> </div> </div> <!-- <div class="rodape">RODAPE</div> --> <div class="panel-body" > <div class="col-xs-12" > <div class="row"> <div class="pull-left"> <img width="160" height="70" src="<?php echo "/logo-orgaos/".$ORG_LOG; ?>" alt=""> </div> <div class="pull-right"> <h3><?php echo utf8_encode($ORG_RAZAO); ?></h3> </div> <div class="row"> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> </div> <div class="row-fluid"> <div class="pull-left"> <strong>Ofício nº <?php echo $OFICIO; ?></strong> </div> <div class="pull-right"> <p><?php echo utf8_encode($USU_NOME); ?>, <?php echo utf8_encode(strftime('%A, %d de %B de %Y', strtotime('today'))); ?></p> </div> </div> <p>&nbsp;</p> <div class="row-fluid text-left"> <p>A Maracanãs Viagens e Turismo:</p> <p>Solicitamos a compra de passagens rodoviárias em favor de nossos servidores, conforme relacionado abaixo:</p> </div> <p>&nbsp;</p> <?php $qtde_trecho = sizeof($parte) - 1; for ($i=0; $i < $qtde_trecho; $i++){ $id = $parte[$i]; $qry = "SELECT S.SOL_ID, S.OFICIO, S.NUMERO, DATE_FORMAT(P.DATA_EMBARQUE,'%d/%m/%Y' ) as DATA_EMBARQUE, DATE_FORMAT(P.HORA_EMBARQUE,'%Hh%i') AS HORA_EMBARQUE, P.ORIGEM, P.DESTINO, DATE_FORMAT(S.DATA_CAD,'%d/%m/%Y') as DATA_CAD, U.ORG_ID, O.ORG_RAZAO, U.USU_NOME, U.USU_EMAIL, U.USU_TELEFONE, U.PERF_ID, CASE S.TIPO_SERVICO WHEN 'C' THEN 'CONVECIONAL' WHEN 'E' THEN 'EXECUTIVO' WHEN 'L' THEN 'LEITO' END AS TIPO_SERVICO, E.EMP_FANTASIA, S.STATUS, S.OBS, (SELECT COUNT(PASSAGENS.SOL_ID) FROM PASSAGENS WHERE PASSAGENS.SOL_ID = S.SOL_ID) AS QTDE_PASSAGEM FROM SOLICITACOES S INNER JOIN PASSAGENS P ON (S.SOL_ID = P.SOL_ID) INNER JOIN ORGAOS O ON (S.ORG_ID = O.ORG_ID) INNER JOIN USUARIOS U ON (S.USU_ID = U.USU_ID) INNER JOIN EMPRESAS E ON (S.EMP_ID = E.EMP_ID) WHERE S.SOL_ID IN( ".$id.") ORDER BY S.SOL_ID "; if ($query=mysqli_query($con,$qry)){ while ($master=mysqli_fetch_assoc($query)){ $STATUS_SOLIC = $master['STATUS']; $USUARIO_SOLIC = $master['USU_NOME']; $USUARIO_EMAIL = $master['USU_EMAIL']; $ORIGEM = $master['ORIGEM']; $DESTINO = $master['DESTINO']; $DATA_EMBARQUE = $master['DATA_EMBARQUE']; $HORA_EMBARQUE = $master['HORA_EMBARQUE']; $EMP_FANTASIA = $master['EMP_FANTASIA']; $TIPO_SERVICO = $master['TIPO_SERVICO']; $ID_SOLICITACAO = $master['SOL_ID']; } } ?> <div class="row-fluid text-left"> <div class="table-responsive " style="display:inline;"> <table class="display table table-hover table-striped" > <thead> <div class="row-fluid"> <div class="row" > <tr > <th width="30%">Origem</th> <th width="30%">Destino</th> <th width="15%">Dt de Embarque</th> <th width="5%">Horário</th> <th width="15%">Tipo de Serviço</th> <th width="30%">Empresa</th> </tr> <tr style="color: #000; background-color: #fff; " > <th width='30%' > <?php echo utf8_encode($ORIGEM) ?> </th> <th width='15%'> <?php echo utf8_encode($DESTINO) ?> </th> <th width='10%'> <?php echo $DATA_EMBARQUE ?> </th> <th width='5%'> <?php echo $HORA_EMBARQUE ?> </th> <th width='15%'> <?php echo $TIPO_SERVICO ?> </th> <th width='30%' > <?php echo $EMP_FANTASIA ?> </th> </tr> </div> <div class="pull-left"> <strong><i class="fa fa-map-marker" aria-hidden="true"></i> De: <?php echo utf8_encode($ORIGEM).' para '.utf8_encode($DESTINO); ?></strong> </div> <div class="pull-right"> <p><strong>Dia <?php echo $DATA_EMBARQUE.' às '.$HORA_EMBARQUE; ?></strong> </p> </div> </div> <tr style="color: #FFF; background-color:#286090;"> <th width="40%" colspan="3">Nome do Passageiro</th> <th width="15%">CPF</th> <th width="10%">RG</th> <th width="20%">Cartão</th> </tr> </thead> <tbody> <?php $qrypassagem = "SELECT concat('status_', lcase(upper_retira_acento(st.STATUS))) AS STATUS_COR, ST.STATUS, CASE S.TIPO_SERVICO WHEN 'C' THEN 'CONVECIONAL' WHEN 'E' THEN 'EXECUTIVO' WHEN 'L' THEN 'LEITO' END AS TIPO_SERVICO, P.ID AS PAS_ID, P.PASSAGEIRO, P.CPF, P.RG, P.CARTAO_FIDELIDADE, P.ORIGEM, P.DESTINO, DATE_FORMAT(P.DATA_EMBARQUE,'%d/%m/%Y' ) as DATA_EMBARQUE, DATE_FORMAT(P.HORA_EMBARQUE,'%Hh%i') AS HORA_EMBARQUE, P.BILHETE, (SELECT EMP_FANTASIA FROM EMPRESAS WHERE EMP_ID = S.EMP_ID LIMIT 1 ) AS EMP_FANTASIA, P.VR_UNITARIO, P.TAXA_EMBARQUE, P.TAXA_ADMIN, P.VR_TOTAL, P.DATA_CAD FROM SOLICITACOES S INNER JOIN PASSAGENS P ON (S.SOL_ID = P.SOL_ID) INNER JOIN STATUS ST ON (S.STATUS = ST.STATUS_ID) WHERE S.SOL_ID =".$ID_SOLICITACAO." ORDER BY S.SOL_ID "; if ($resul_passagem=mysqli_query($con,$qrypassagem)){ $QTDE_PASSAGEM = mysqli_num_rows($resul_passagem); while ($linha=mysqli_fetch_assoc($resul_passagem)){ $DATA_EMBARQUE = $linha['DATA_EMBARQUE']; $HORA_EMBARQUE = $linha['HORA_EMBARQUE']; ?> <tr> <th width="40%" colspan="3"><?php echo utf8_encode($linha['PASSAGEIRO']); ?></th> <th width="15%"><?php echo mask($linha['CPF'],'###.###.###-##'); ?></th> <th width="10%"><?php echo $linha['RG']; ?></th> <th width="20%"><?php echo $linha['CARTAO_FIDELIDADE']; ?> </th> </tr> <?php } } } ?> </tbody> </table> </div> <div class="row"> <p class="text-left">&nbsp;&nbsp;&nbsp;&nbsp;Qtde de Passagens: <?php echo $QTDE_PASSAGEM; ?></p> </div> </div> <div class="row-fluid"> <p class="text-left"><strong>Qtde Total de Passagens: <?php echo $QTDE_TOTAL_PASSAGEM; ?></strong></p> </div> <p>&nbsp;</p> <?php if(!empty($OBS)) echo ' <div class="panel panel-default"> <div class="panel-heading"><strong>Observações</strong></div> <div class="panel-body"> '.$OBS.' </div> </div>'; ?> <p>&nbsp;</p> <div class="row-fluid text-left"> <p>Atenciosamente,</p> <span><strong><?php echo utf8_encode($GESTOR_NOME); ?></strong></span><br> <span>Gestor do Contrato</span> <p>Telefone: </p> <span><?php echo utf8_encode($GESTOR_TELEFONE); ?></span> </div> </div> <?php #verifica se a solicitação esta com o status 3 autorização e se o usuario é um gestor // } ?> </div> <!-- these js files are used for making PDF --> </div> <!-- </div> --> <!-- </div> --> <script type="text/javascript"> function printPage() { window.print(); } </script> <?php mysqli_free_result($resultado); if(!empty($resul_passagem)){ mysqli_free_result($resul_passagem); } mysqli_close($con); ?> <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/js/bootstrap.min.js"></script> </body> </html>
  4. Bom dia Galera, tudo em paz? Pessoal eu o seguinte input em um form modal, e criei uma função para set uma data que vem como string, porém essa data só é setada no input se eu alterar o type para "text". <input id="txtDtEmbarqueOficio" name="txtDtEmbarqueOficio" type="date" class="form-control input-md"> Função <script type="text/javascript"> function setaDadosModalOficio(id,origem,destino,data,horario,tipo,empresa) { document.getElementById('txtIDSolicitacaoOficio').value = id; document.getElementById('txtIDOculto').value = id; document.getElementById('txtOrigem').value = origem; document.getElementById('txtDestino').value = destino; document.getElementById('txtDtEmbarqueOficio').value = data; document.getElementById('txtHorarioOficio').value = horario.replace("h", ":"); document.getElementById('txtTipo').value = tipo.substring(0,1); document.getElementById('txtempresa').value = empresa; } </script>
  5. Galera tenho um Form e estou pegando os dados via POST, porem quando tenho mais de 97 inputs ele não traz todos no POST, para os 97. Alguém pode me ajudar. Código do Formulário:Código do FormulárioResultado Var_dump Resultado var_dump
×
×
  • Criar Novo...