Jump to content

gibagehrke

Members
  • Content count

    16
  • Joined

  • Last visited

Community Reputation

0 Comum

About gibagehrke

Informações Pessoais

  • Sexo
    Masculino
  1. gibagehrke

    Condicional em consulta PHP/Postgres

    Bom dia pessoal, tenho que adicionar um condicional em uma consulta do PostgreSQL de um sistema PHP, no caso essa consulta vasculha tudo e informa o resultado, porém eu preciso adicionar uma condição que exclua dos resultados os processos que tenham eventos na tabela "followup" preenchidos e que também possuam o "idevento=12". $sql_completo1 ="select distinct pro.nrprocesso as processo, pe.nmpessoa as cliente, pe_di.nmpessoa as exportador, pe_tr.nmpessoa as transporterodoviario, pro.nrrefauxiliar as referencia, pro.nrconhecimento as crt, pro.nrmanifesto as mic, array_to_string(array( select ref.nrreferenciacliente from referenciacliente ref where pro.idprocesso = ref.idprocesso ), ';') as refcliente, di.nrdeclaracaoimportacao as nrdi, pro.nrexportacao as nrdi2, dde.nrdeclaracaodespacho as dde, array_to_string(array( select ddere.nrregistroexportacao from processoddere ddere, processodde dde where pro.idprocesso = ddere.idprocesso and dde.idprocessodde = ddere.idprocessodde ), ';') as re, array_to_string(array( select pdid.nrdocinstrucaodespacho from processodocinstrucaodespacho pdid where pro.idprocesso = pdid.idprocesso and pdid.iddocinstrucaodespacho=1 ),' ') as fatura, CASE WHEN pro.tpcanal='1' THEN 'Amarelo' WHEN pro.tpcanal='2' THEN 'Cinza' WHEN pro.tpcanal='3' THEN 'Vermelho' WHEN pro.tpcanal='4' THEN 'Verde' WHEN pro.tpcanal='5' THEN 'SEM CANAL' WHEN pro.tpcanal='6' THEN 'Laranja' WHEN pro.tpcanal='0' THEN 'SEM CANAL' else 'LIXO' END as canal, ci1.nmcidade as localdesembaraco, tc.nmterminalcarga as localdesembarque, ";
  2. gibagehrke

    Ocultar Log após envio de e-mail

    feito, muito obrigado!
  3. gibagehrke

    Ocultar Log após envio de e-mail

    Bom dia galera, estou terminando um site, porém no formulário de contato que estou utilizando o PHP mail, após enviar o e-mail ele mostra todo o log do envio ao invés de mostrar apenas a mensagem de enviado com sucesso, value pela ajuda! <?php date_default_timezone_set('Etc/UTC'); require 'PHPMailerAutoload.php'; $erros = ""; //Create a new PHPMailer instance $mail = new PHPMailer; //Tell PHPMailer to use SMTP $mail->isSMTP(); //Enable SMTP debugging // 0 = off (for production use) // 1 = client messages // 2 = client and server messages $mail->SMTPDebug = 2; //Ask for HTML-friendly debug output $mail->Debugoutput = 'html'; //Set the hostname of the mail server $mail->Host = 'smtp.dualtec.com.br'; // use // $mail->Host = gethostbyname('smtp.gmail.com'); // if your network does not support SMTP over IPv6 //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission $mail->Port = 587; //Set the encryption system to use - ssl (deprecated) or tls $mail->SMTPSecure = 'tls'; //Whether to use SMTP authentication $mail->SMTPAuth = true; //Username to use for SMTP authentication - use full email address for gmail $mail->Username = 'usuario'; //Password to use for SMTP authentication $mail->Password = 'senha'; //Set who the message is to be sent from $mail->setFrom('remetente','CONTATO DO SITE'); //Set an alternative reply-to address //$mail->addReplyTo('replyto@example.com', 'First Last'); //Set who the message is to be sent to $mail->addAddress('destinatario'); //Set the subject line $mail->Subject = $_POST['assunto']; //Read an HTML message body from an external file, convert referenced images to embedded, //convert HTML into a basic plain-text alternative body $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); //Replace the plain text body with one created manually $mail->Body .= '<div style="margin:0 auto;padding:0;width:500px;">'; $mail->Body .= '<h1 style="float:left;color:#000;padding:8px 40px;">Contato pelo site</h1>'; $mail->Body .= '</div>'; $mail->Body .= '<div style="clear:both;background:#f7f7f7;border-radius:10px;box-shadow:-2px 2px 2px #B6B6B6 , -2px -2px 2px #B6B6B6 ,-2px 2px 2px #B6B6B6 ,2px -2px 2px #B6B6B6;">'; $mail->Body .= '<h2 style="padding:15px; font-size:16px; color:#07335F; background-color:#FFCE4A; -webkit-border-top-left-radius: 10px; -webkit-border-top-right-radius: 10px; -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;border-top-left-radius: 10px; border-top-right-radius: 10px;">Dados do formulario de contato</h2>'; $mail->Body .= '<h3 style="padding:5px 15px; font-size:16px;"><strong style="color:#07335F";font-weight:bold;>Nome:</strong>' .$_POST['nome'] .'</h3>'; $mail->Body .= '<h3 style="padding:5px 15px; font-size:16px;"><strong style="color:#07335F";font-weight:bold;>E-mail:</strong>' .$_POST['mail'] .'</h3>'; $mail->Body .= '<h3 style="padding:5px 15px; font-size:16px;"><strong style="color:#07335F";font-weight:bold;>Telefone:</strong>' .$_POST['fone'] .'</h3>'; $mail->Body .= '<h3 style="padding:5px 15px; font-size:16px;"><strong style="color:#07335F";font-weight:bold;>Empresa:</strong>' .$_POST['empresa'] .'</h3>'; $mail->Body .= '<h3 style="padding:5px 15px; font-size:16px;"><strong style="color:#07335F";font-weight:bold;>Assunto:</strong>' .$_POST['assunto'] . '</h3>'; $mail->Body .= '<h3 style="padding:5px 15px; font-size:16px;"><strong style="color:#07335F";font-weight:bold;>Mensagem:</h3>'; $mail->Body .= '<p style="text-align:justify;padding:5px 15px;color:#000;">'; $mail->Body .= $_POST['mensagem'] .'</p>'; $mail->Body .= '</div>'; $mail->Body .= '</div>'; ////$mail->Body = $_POST['mensagem']; //$mail->AltBody = $_POST['texto']; //Attach an image file //$mail->addAttachment('images/phpmailer_mini.png'); //send the message, check for errors $send = $mail->Send(); if($send){ echo '<div>'; echo '<p><h1>Sua Mensagem foi enviada com sucesso.</h1></p>'; echo '</div>'; }else{ echo '<div>'; echo '<p><h1>Não foi possível enviar a mensagem.<ha/h1>'; echo '</div>'; } ?>
  4. gibagehrke

    Ajuda para desenferrujar

    Veleu galera, consegui fazer aqui!
  5. gibagehrke

    Ajuda para desenferrujar

    Bom dia pessoal, não mexo com edição de imagens desde que terminei meu curso técnico em 2010, na época fiz o Wallpaper em anexo usando o Adobe Fireworks, no entanto eu gostaria de fazer o mesmo efeito na transição da imagem em um banner com duas fotos e não me lembro o nome desse efeito para cria-lo, atualmente estou usando o Photoshop CC.
  6. Boa tarde pessoal, estou iniciando no PHP (na programação de modo geral na pratica e fora da teoria da faculdade) e tenho que aprimorar um sistema já existente feito por outra pessoa, na qual ele coleta as informações e gera um relatório em Excel. Agora tenho que fazer com que ele além de gerar o Excel, também pegue parte desse relatório, criando uma versão resumida que será colocada no corpo de um e-mail que será disparado por ele junto do arquivo Excel anexado. Porém estou tentando encontrar uma forma, que após ele gerar o relatório (código abaixo) ele vá para outra página e continue a rotina, o sistema apenas gera o relatório e o navegador baixa o arquivo, parando por aí. <?php error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); date_default_timezone_set('Europe/London'); if (PHP_SAPI == 'cli') die('This example should only be run from a Web Browser'); /** Include PHPExcel */ require_once '../Classes/PHPExcel.php'; require_once 'sqlexpo.php'; $connection = pg_connect("host=localhost port=5432 dbname=base user=usuario password=senha") or die ("Nao consegui conectar ao PostGres --> " . pg_last_error($conn)); $qu = pg_query($connection, $sql); $arr = pg_fetch_array($qu, NULL, PGSQL_ASSOC); // Create new PHPExcel object $objPHPExcel = new PHPExcel(); // Set document properties $cordaborda = array( 'borders' => array( 'outline' => array( 'style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('argb' => 'ffffffff'), ), ), ); //linha da cor das responsabilidades $objPHPExcel->getActiveSheet()->getStyle('A4')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $objPHPExcel->getActiveSheet()->getStyle('A4')->getFill()->getStartColor()->setARGB('FF0000A0'); $objPHPExcel->getActiveSheet()->getStyle('B4:H4')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $objPHPExcel->getActiveSheet()->getStyle('B4:H4')->getFill()->getStartColor()->setARGB('FF0000A0'); $objPHPExcel->getActiveSheet()->getStyle('I4')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $objPHPExcel->getActiveSheet()->getStyle('I4')->getFill()->getStartColor()->setARGB('FF0000A0'); $objPHPExcel->getActiveSheet()->getStyle('J4:X4')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $objPHPExcel->getActiveSheet()->getStyle('J4:X4')->getFill()->getStartColor()->setARGB('FF0000A0'); $objPHPExcel->getActiveSheet()->getStyle('Y4:Z4')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $objPHPExcel->getActiveSheet()->getStyle('Y4:Z4')->getFill()->getStartColor()->setARGB('FF0000A0'); $objPHPExcel->getActiveSheet()->getStyle('AA4')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $objPHPExcel->getActiveSheet()->getStyle('AA4')->getFill()->getStartColor()->setARGB('FF0000A0'); //mesclando as linhas e colunas $objPHPExcel->getActiveSheet()->mergeCells('A1:AA3'); $objPHPExcel->getActiveSheet()->mergeCells('B4:H4'); $objPHPExcel->getActiveSheet()->mergeCells('J4:X4'); $objPHPExcel->getActiveSheet()->mergeCells('Y4:Z4'); //TITULO DAS RESPONSABILIDADES - MESCLADO $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A4', 'FRONTEIRA'); $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B4', 'EXPORTADOR'); $objPHPExcel->setActiveSheetIndex(0)->setCellValue('I4', 'TRANSPORTADOR'); $objPHPExcel->setActiveSheetIndex(0)->setCellValue('J4', 'Empresa'); $objPHPExcel->setActiveSheetIndex(0)->setCellValue('Y4', 'TRANSPORTADOR'); $objPHPExcel->setActiveSheetIndex(0)->setCellValue('AA4', 'STATUS'); // TITULOS DA LINHA 1 - e configurações $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', 'FOLLOWUP'); $objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setSize(28); $objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true); //colocando bordas nas células mescladas $objPHPExcel->getActiveSheet()->getStyle('A1:AA3')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('A1:AA3')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('A1:AA3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('A1:AA3')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); //cor de fundo azul $objPHPExcel->getActiveSheet()->getStyle('A1:AA1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $objPHPExcel->getActiveSheet()->getStyle('A1:AA1')->getFill()->getStartColor()->setARGB('FF0000A0'); //cor da borda branca $objPHPExcel->getActiveSheet()->getStyle('A1:AA3')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('A4')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('B4:H4')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('I4')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('J4:X4')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('Y4:Z4')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('AA4')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('A4:AA4')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('A4:AA4')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('A4:AA4')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('A4:AA4')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); //linha da cor dos títulos dos eventos $objPHPExcel->getActiveSheet()->getStyle('A5:AA5')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $objPHPExcel->getActiveSheet()->getStyle('A5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('B5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('C5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('D5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('E5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('F5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('G5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('H5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('I5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('J5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('K5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('L5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('M5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('N5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('O5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('P5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('Q5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('R5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('S5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('T5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('U5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('V5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('W5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('X5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('Y5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('Z5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('AA5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); // $objPHPExcel->getActiveSheet()->getStyle('A4')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('B4')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('I4')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('J4')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('Y4')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('A5:AA5')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN); $objPHPExcel->getActiveSheet()->getStyle('A5:AA5')->getFill()->getStartColor()->setARGB('FF0000A0'); //cor da borda branca $objPHPExcel->getActiveSheet()->getStyle('A5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('B5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('C5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('D5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('E5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('F5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('G5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('H5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('I5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('J5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('K5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('L5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('M5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('N5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('O5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('P5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('Q5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('R5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('S5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('T5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('U5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('V5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('W5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('X5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('Y5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('Z5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('AA5')->applyFromArray($cordaborda); $objPHPExcel->getActiveSheet()->getStyle('A5:P5')->applyFromArray($cordaborda); //FAZENDO AS COLUNAS TEREM TAMANHO AUTOMATICO $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('G')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('H')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('I')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('J')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('K')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('L')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('M')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('N')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('O')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('P')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('Q')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('R')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('S')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('T')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('U')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('V')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('W')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('X')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('Y')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('Z')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('AA')->setAutoSize(true); //ALINHANDO A ESQUERDA $objPHPExcel->getActiveSheet()->getStyle('A')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('B')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('C')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('D')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('E')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('F')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('G')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('H')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('I')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('J')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('K')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('L')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('M')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('N')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('O')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('P')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('Q')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('R')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('S')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('T')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('U')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('V')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('W')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('X')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('Y')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('Z')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objPHPExcel->getActiveSheet()->getStyle('AA')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); //ALINHANDO AO CENTRO AS COLUNAS MESCLADAS DAS RESPONSABILIDADES $objPHPExcel->getActiveSheet()->getStyle('A4:AA4')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); //formatando a fonte com cor branca $objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE); $objPHPExcel->getActiveSheet()->getStyle('A4:AA4')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE); $objPHPExcel->getActiveSheet()->getStyle('A5:AA5')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE); // TITULOS DA LINHA 1 $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A5', 'Local de Desembaraco') ->setCellValue('B5', 'Fatura') ->setCellValue('C5', 'Cliente') ->setCellValue('D5', 'Ref.Cliente') ->setCellValue('E5', 'Cnpj') ->setCellValue('F5', 'RE') ->setCellValue('G5', 'Data RE') ->setCellValue('H5', 'Processo') ->setCellValue('I5', 'Conhecimento') ->setCellValue('J5', 'DDE') ->setCellValue('K5', 'Data DDE') ->setCellValue('L5', 'Chegada em Fronteira') ->setCellValue('M5', 'Recepcao dos Documentos') ->setCellValue('N5', 'Tempo Entrega') ->setCellValue('O5', 'Ingresso Autorizado ') ->setCellValue('P5', 'Ingresso Recinto Alfand.') ->setCellValue('Q5', 'Tempo Ok e Ingr.') ->setCellValue('R5', 'Apresentacao RF') ->setCellValue('S5', 'Canal') ->setCellValue('T5', 'Courier') ->setCellValue('U5', 'Envio Originais') ->setCellValue('V5', 'Liberacao RF') ->setCellValue('W5', 'Tempo Liberacao') ->setCellValue('X5', 'RE Averbado') ->setCellValue('Y5', 'Seguiu Viagem') ->setCellValue('Z5', 'Cruze') ->setCellValue('AA5', 'Status'); $row = 0; // postgresql precisa de um contador de linha, outros dbs talvez n?o precisem $li = 6; //linhas dos dados while ($data = @pg_fetch_object($qu, $row)) { if(isset($data->ingressorecinto)){$data_recinto = $data->ingressorecinto;} else{$data_recinto = $data->ingressorecintof;} if (isset($data->data_re1)) {$datare = $data->data_re1;} else{$datare = $data->data_re2;} if(isset($data->ingressorecinto)){$ingressorecinto = $data->ingressorecinto;} else{$ingressorecinto = $data->ingressorecintof;} $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A'.$li, $data->localdesembaraco) ->setCellValue('B'.$li, $data->referencia) ->setCellValue('C'.$li, $data->cliente) ->setCellValue('D'.$li, $data->refcliente) ->setCellValue('E'.$li, $data->cnpj) ->setCellValue('F'.$li, $data->re) ->setCellValue('G'.$li, $datare) ->setCellValue('H'.$li, $data->processo) ->setCellValue('I'.$li, $data->crt) ->setCellValue('J'.$li, $data->dde) ->setCellValue('K'.$li, $data->datadde) ->setCellValue('L'.$li, $data->chegadaemfronteira) ->setCellValue('M'.$li, $data->recepdocs) ->setCellValue('N'.$li, $data->tempo1) ->setCellValue('O'.$li, $data->ingressoaut) ->setCellValue('P'.$li, $ingressorecinto) ->setCellValue('Q'.$li, $data->tempooking) ->setCellValue('R'.$li, $data->apresentacaorf) ->setCellValue('S'.$li, $data->canal) ->setCellValue('T'.$li, $data->observacaogeral) ->setCellValue('U'.$li, $data->envio_docs_originais) ->setCellValue('V'.$li, $data->liberacaorf) ->setCellValue('W'.$li, $data->tempoliberacao) ->setCellValue('X'.$li, $data->averbacao) ->setCellValue('Y'.$li, $data->seguiuviagem) ->setCellValue('Z'.$li, $data->cruze) ->setCellValue('AA'.$li, trim($data->obsfollow)); if (($row % 2) == 0) { $objPHPExcel->getActiveSheet()->getStyle('A'.$li.':AA'.$li)->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $objPHPExcel->getActiveSheet()->getStyle('A'.$li.':AA'.$li)->getFill()->getStartColor()->setARGB('E6E6E6FF'); } else{ $objPHPExcel->getActiveSheet()->getStyle('A'.$li.':AA'.$li)->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $objPHPExcel->getActiveSheet()->getStyle('A'.$li.':AA'.$li)->getFill()->getStartColor()->setARGB('FFFFFFFF'); } $teste = $li++; $row++; } // Rename worksheet $objPHPExcel->getActiveSheet()->setTitle('Follow Rodoviário de Exportação'); // $objPHPExcel->getActiveSheet()->getStyle('A'.$li.':AA'.$li)->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $objPHPExcel->getActiveSheet()->mergeCells('A'.$li. ':AA'.$li); $objPHPExcel->getActiveSheet()->getStyle('A'.$li)->getFill()->getStartColor()->setARGB('FF0000A0'); $objPHPExcel->getActiveSheet()->getStyle('A'.$li)->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE); $objPHPExcel->getActiveSheet()->getStyle('A'.$li)->getFont()->setSize(8); $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A'.$li, '* Informações Extraídas do sistema. Follow up desenvolvido internamente pela TI.'); // Set active sheet index to the first sheet, so Excel opens this as the first sheet $objPHPExcel->setActiveSheetIndex(0); // Set password for readonly activesheet $objPHPExcel->getSecurity()->setLockWindows(true); $objPHPExcel->getSecurity()->setLockStructure(true); $objPHPExcel->getSecurity()->setWorkbookPassword("senha da planilha"); // Set password for readonly data $objPHPExcel->getActiveSheet()->getProtection()->setSheet(true); $objPHPExcel->getActiveSheet()->getProtection()->setPassword("senha da planilha"); // Redirect output to a client’s web browser (Excel5) header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="FollowRodoviarioExpo.xls"'); header('Cache-Control: max-age=0'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); ?>
  7. gibagehrke

    PHP - Duas Actions em um Form

    No fim esse script do Google funcionou para o nosso Exchange! fez o login e disparou o e-mail :D
  8. gibagehrke

    PHP - Duas Actions em um Form

    é que ele funciona bem no Outlook, via autodiscover do Microsoft Exchange
  9. gibagehrke

    PHP - Duas Actions em um Form

    Pelo outlook também não faz o login, vou ter q encontrar outra forma, acho q vou ter q usar o gmail ou yahoo e encaminhar os emails q responderem para eles para os emails que utilizam. Valeu pela ajuda!
  10. gibagehrke

    PHP - Duas Actions em um Form

    Após achar o erro referente a linha quatro (sintaxe estava errada), apareceu um erro de falha de conexão com o servidor, será q o servidor está barrando a aplicação não reconhecida por eles? 2017-01-26 10:46:07 Connection: opening to smtp.dualtec.com.br:587, timeout=300, options=array ( ) 2017-01-26 10:46:18 Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Este host n�o � conhecido. 2017-01-26 10:46:18 Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to smtp.dualtec.com.br:587 (php_network_getaddresses: getaddrinfo failed: Este host n�o � conhecido. ) 2017-01-26 10:46:18 SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: Este host n�o � conhecido. (0) 2017-01-26 10:46:18 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  11. gibagehrke

    PHP - Duas Actions em um Form

    Informou esse erro na linha 4 (require phpmailer/PHPMailerAutoload.php; ): Notice: Use of undefined constant phpmailer - assumed 'phpmailer' in C:\Bitnami\wappstack-5.6.23-1\apache2\htdocs\email\enviar.php on line 4 Notice: Use of undefined constant PHPMailerAutoload - assumed 'PHPMailerAutoload' in C:\Bitnami\wappstack-5.6.23-1\apache2\htdocs\email\enviar.php on line 4 Warning: Division by zero in C:\Bitnami\wappstack-5.6.23-1\apache2\htdocs\email\enviar.php on line 4 Notice: Use of undefined constant php - assumed 'php' in C:\Bitnami\wappstack-5.6.23-1\apache2\htdocs\email\enviar.php on line 4 Warning: require(C:\Bitnami\wappstack-5.6.23-1\php\PEAR\php): failed to open stream: Permission denied in C:\Bitnami\wappstack-5.6.23-1\apache2\htdocs\email\enviar.php on line 4 Fatal error: require(): Failed opening required 'php' (include_path='.;C:/Bitnami/wappstack-5.6.23-1/php/PEAR;C:/Bitnami/wappstack-5.6.23-1/frameworks/smarty/libs') in C:\Bitnami\wappstack-5.6.23-1\apache2\htdocs\email\enviar.php on line 4
  12. gibagehrke

    PHP - Duas Actions em um Form

    estou tentando esse exemplo, porém ao executar o enviar.php ele não faz nada e não apresenta nenhuma mesnagem: <html> <head> </head> <body> <form method="post" action="enviar.php"> <label>remetente</label><input type="text" required name="remetente"/><br><br> <label>senha</label><input type="password" required name="senha"/><br><br> <label>destinatário</label><input type="text" required name="destinatario"/><br><br> <label>assunto</label><input type="text" required name="assunto"/><br><br> <label>texto</label><input type="text" required name="texto"/><br><br> <input type="submit" class="botao" name="enviar" value="Enviar" /><br> </form> </body> </html> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <?php require phpmailer/PHPMailerAutoload.php; $mail = new PHPMailer(); //$mail->SMTPDebug = 3; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'tls://smtp.meuprovedor.com.br'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = $_POST['remetente']; // SMTP username $mail->Password = $_POST['senha']; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 587; // TCP port to connect to $mail->setFrom($_POST['remetente'], 'Informatica'); $mail->addAddress($_POST['destinatario'], 'Vicente'); // Add a recipient //$mail->addReplyTo('info@example.com', 'Information'); //$mail->addCC('cc@example.com'); //$mail->addBCC('bcc@example.com'); //$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 = $_POST['assunto']; $mail->Body = $_POST['texto']; //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; if(!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent'; } ?> </body> </html>
  13. gibagehrke

    PHP - Duas Actions em um Form

    Fiz isso e me passaram os endereços e as portas, agora eu preciso descobrir como configurar o PHPMailer com TLS, o código que tenho funciona para SSL
  14. gibagehrke

    PHP - Duas Actions em um Form

    Concordo com você, o problema é que não consigo fazer a conexão com o meu serviço de e-mail, um Microsoft Exchange, quando solicitei os dados das portas e afins eles me informaram que eu teria que comprar um serviço de e-mail marketing. PS.: o serviço não é fornecido pela Microsoft e sim por um terceiro.
  15. gibagehrke

    PHP - Duas Actions em um Form

    e quais comandos eu teria que usar? sou bem iniciante no PHP e o pouco que vi na faculdade já era bem defasado. Preciso alterar um sistema já pronto que gera um arquivo excel, o que eu preciso é que após a geração do arquivo ele abra a janela de um novo e-mail no Thunderbird e colocar algumas informações que foram coletadas e inseridas no excel no corpo do e-mail, talves até já deixando o arquivo excel anexado. Já usei o PHP Mailer em outra situação, porém como nosso serviço de e-mail usa uma versão antiga do Microsoft Exchange não foi possível usar desta maneira.
×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.