E:
/
home
/
kbcomunicacao1
/
Web
/
innterage
/
includes
/
Upload File
HOME
<?php session_start(); $nomeuser = $_SESSION['NOME']; $sobrenomeuser = $_SESSION['SOBRENOME']; $user = $_SESSION['IDCLI']; $hora = date('H:i:s'); $data_hj = date("d/m/Y"); $data_atual = date("Y-m-d"); require 'conexao/funcao.inc.php'; require 'conexao/config.php'; require 'conexao/conn.php'; require 'conexao/function.php'; $id = $_GET['id']; $chave = $_GET['chave']; //nome da variavel pode ser qqr uma $cliente = array( //nome do campo da tabela que vai atualizar => o valor que vai receber 'status_flw' => 1 ); DBUpDate('flw', $cliente, "id_flw= $id"); $relaciona_fw = array( 'status_relaciona_flw' => 1 ); DBUpDate('relaciona_fw', $relaciona_fw, "fw_relaciona_fw= $id "); $query = "SELECT destino_ocorrencia, email_destino_ocorrencia FROM cw_ocorrencia WHERE email_destino_ocorrencia!='NULL' AND chave_ocorrencia='$chave'"; $link = DBConnect(); $result = @mysqli_query($link, $query) or die(mysqli_error($link)); $query2 = "SELECT assunto_flw, cliente_flw, status_flw, descricao_flw, prazo_flw FROM cw_flw WHERE id_flw='$id' LIMIT 1"; $result2 = DBExecute($query2); $res2 = mysqli_fetch_assoc($result2); $assunto_flw = $res2['assunto_flw']; $cliente_flw = $res2['cliente_flw']; $status_flw = $res2['status_flw']; $descricao_flw = $res2['descricao_flw']; $prazo_flw = $res2['prazo_flw']; $prazo = dbDateToDate2($prazo_flw); if($status_flw==0){ $btnstatus = "<span class='label label-primary'>Ativo</span>"; }else{ $btnstatus = "<span class='label label-default'>Encerrado</span>"; } $querycli = "SELECT razao_cliente FROM cw_cliente WHERE id_cliente='$cliente_flw'"; $resultcli = DBExecute($querycli); $rescli = mysqli_fetch_assoc($resultcli); $razao_cliente = $rescli['razao_cliente']; $queryp = "SELECT para_ocorrencia FROM cw_ocorrencia WHERE para_ocorrencia!='$user' AND chave_ocorrencia='$chave' GROUP BY para_ocorrencia"; $linkp = DBConnect(); $resultp = @mysqli_query($linkp, $queryp) or die(mysqli_error($linkp)); while($resp = mysqli_fetch_assoc($resultp)){ $timeline2 = array( //nome do campo da tabela que vai atualizar => o valor que vai receber 'user_timeline' => "$resp[para_ocorrencia]", 'data_timeline' => "$data_atual", 'hora_timeline' => "$hora", 'tipo_timeline' => "9", 'titulo_timeline' => "$btnstatus <br /> $nomeuser $sobrenomeuser encerrou a solicitação que você participa<br /> Cliente: $razao_cliente <br /> Assunto da solicitação: $assunto_flw <br /> Prazo: $prazo", 'descricao_timeline' => "$descricao_flw", 'link_timeline' => "./?pag=flw_detail&id=$id", 'icon_timeline' => "<i class='fa fa-check-square'></i>" ); $gravatimeline2 = DBCreate('timeline', $timeline2); } require 'conexao/PHPMailer/PHPMailerAutoload.php'; $mail = new PHPMailer; //$mail->SMTPDebug = 3; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp.grupocaom.com.br'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'sistema@grupocaom.com.br'; // SMTP username $mail->Password = 'grupocaom'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 587; // TCP port to connect to $mail->setFrom('sistema@grupocaom.com.br', 'Grupo Caom'); $titulo = utf8_decode("Sistema de solicitação - Grupo Caom"); $mensagem = utf8_decode("<!doctype html> <html> <head> <meta charset='utf-8'> </head> <body> <div style='float:left; width:886px'> <img src='http://grupocaom.com.br/sistema/midia/img/topo_email.jpg' title='Grupo Caom' /> <br /><br /> <strong font-variant:small-caps; font-size:20px; font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;'> </strong> <p style='font-size:14px; font-family:'Times New Roman', Times, serif;'>Prezado cliente, </p> <p style='font-size:14px; font-family:'Times New Roman', Times, serif;'>A sua solicitação <strong>$assunto_flw</strong> foi encerrada pelo nosso colaborador $nomeuser $sobrenomeuser em $data_hj às $hora. </p> <p style='font-size:14px; font-family:'Times New Roman', Times, serif;'>Caso ainda falte algum esclarecimento ou reste alguma dúvida, pedimos entrar em contato em contato com o Grupo Caom. </p> <img src='http://grupocaom.com.br/sistema/midia/img/bottom.jpg' title='Grupo Caom' /> <br /><br /> <p style='font-size:14px; font-family:'Times New Roman', Times, serif; text-align:center'>***** NÃO RESPONDER ESSE E-MAIL, ELE NÃO SERA LIDO *****</p> </div> </body> </html> "); $mail->isHTML(true); // Set email format to HTML $mail->Subject = "$titulo"; $mail->Body = "$mensagem"; while($res = mysqli_fetch_assoc($result)){ $nomedestino = $res['destino_ocorrencia']; $emaildestino = $res['email_destino_ocorrencia']; $mail->addAddress("$emaildestino", "$nomedestino"); } $mail->send(); ?> <script> window.location = "../" </script>