%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/vacivi36/sistemaparcerias/mf/
Upload File :
Create Path :
Current File : /home/vacivi36/sistemaparcerias/mf/cadastro.php

<?php
session_start();
include_once('../conexao.php');

if(!isset($_SESSION["usuarioId"]) || !isset($_SESSION["usuarioNome"]))
{
// Usuário não logado! Redireciona para a página de login
header("Location: ../index.php");
exit;
}


$nome = $_POST['nome'];
$cpf = $_POST['cpf'];
$datanasc = $_POST['datanasc'];
$endereco = $_POST['endereco'];
$bairro = $_POST['bairro'];
$cidade = $_POST['cidade'];
$estado = $_POST['estado'];
$email = $_POST['email'];
$celular = $_POST['celular'];
$databio = $_POST['databio'];
$dataane = $_POST['dataane'];
$tipo = $_POST['tipo'];
$tipoteste = $_POST['tipoteste'];
$usuario = $_SESSION['usuarioNome'];

$result_msg_contato = "INSERT INTO clientes(
cliente_nome,
cliente_cpf,
cliente_nasc,
cliente_endereco,
cliente_bairro,
cliente_cidade,
cliente_estado,
cliente_email,
cliente_celular,
cliente_biopsia,
cliente_anestesista,
cliente_tipoexame,
cliente_tipoteste,
cliente_datainsert,
cliente_insert
 ) VALUES (
'$nome',
'$cpf',
'$datanasc',
'$endereco',
'$bairro',
'$cidade',
'$estado',
'$email',
'$celular',
'$databio',
'$dataane',
'$tipo',
'$tipoteste',
NOW(),
'$usuario'
)";
$resultado_msg_contato= mysqli_query($conn, $result_msg_contato);

$cupom = mysqli_insert_id($conn);


$aneste = date('d/m/Y',strtotime($dataane));
$biopsia = date('d/m/Y',strtotime($databio));
//Import PHPMailer classes into the global namespace
//These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;

//Load Composer's autoloader
require 'email/vendor/autoload.php';

//Create an instance; passing `true` enables exceptions
$mail = new PHPMailer(true);

try {
    //Server settings
	$mail->CharSet = 'UTF-8';
    $mail->isSMTP();                                            //Send using SMTP
    $mail->Host       = 'mail.vacivitta.com.br';                     //Set the SMTP server to send through
    $mail->SMTPAuth   = true;                                   //Enable SMTP authentication
    $mail->Username   = 'notificacao@vacivitta.com.br';                     //SMTP username
    $mail->Password   = 'Vacivitta@123';                               //SMTP password
    $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;            //Enable implicit TLS encryption
	$mail->Port       = 465;                                    //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`

    //Recipients
    $mail->setFrom('notificacao@vacivitta.com.br', 'Cupom: MF_VACI'.$cupom);
	$mail->addAddress('agendamento.covid@vacivitta.com.br', 'Agendamento');   
	$mail->addAddress('ramiro.ortigoso@vacivitta.com.br', 'Ramiro Ortigoso');  
    $mail->addAddress('fabricio.amorim@vacivitta.com.br', 'Fabricio Amorim');     //Add a recipient
    //$mail->addReplyTo('oggimrm@gmail.com', 'Information');
   // $mail->addCC('cc@example.com');
   // $mail->addBCC('bcc@example.com');

    //Attachments
   // $mail->addAttachment('/var/tmp/file.tar.gz');         //Add attachments
    //$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    //Optional name

    //Content
    $mail->isHTML(true);                                  //Set email format to HTML
    $mail->Subject = 'Notificação de Cadastro';
    $mail->Body    = 'O cliente '.$nome. ' foi cadastrado no sistema! <br><br>' ;
	$mail->Body    .= 'Telefone: '.$celular.'<br>';
	$mail->Body    .= 'E-mail: '.$email.'<br>';
	$mail->Body    .= 'Endereço: '.$endereco.', '.$cidade.' - '.$estado.'<br>';
	$mail->Body    .= 'Data da Anestesista: '.$aneste.'<br>';
	$mail->Body    .= 'Data da Biopsia: '.$biopsia.'<br>';
	$mail->Body    .= 'Tipo de Exame: '.$tipo.'<br>';
	$mail->Body    .= 'Tipo de Teste: '.$tipoteste.'<br><br>';
	$mail->Body    .= 'Código do cupom: MF_VACI'.$cupom.'<br>';
	$mail->Body    .= 'Cadastrado por: '.$usuario.'<br><br>';
	$mail->Body    .= 'Esta solicitação pode ser consultada também através do link https://parcerias.vacivitta.com.br/   <br>';
	$mail->Body    .= 'Usuário: vacivitta <br>';
	$mail->Body    .= 'Senha: 0185';

    //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

    $mail->send();
   
} catch (Exception $e) {
    echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
 ?>

<html lang="pt-Br"><head>
	<title>Vacivitta || MF - Cupom</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="icon" type="image/png" href="../assets/img/favicon.png">
	<link rel="stylesheet" type="text/css" href="end/vendor/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="end/fonts/font-awesome-4.7.0/css/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="end/fonts/iconic/css/material-design-iconic-font.min.css">
	<link rel="stylesheet" type="text/css" href="end/vendor/animate/animate.css">
	<link rel="stylesheet" type="text/css" href="end/vendor/css-hamburgers/hamburgers.min.css">
	<link rel="stylesheet" type="text/css" href="end/vendor/animsition/css/animsition.min.css">
	<link rel="stylesheet" type="text/css" href="end/vendor/select2/select2.min.css">
	<link rel="stylesheet" type="text/css" href="end/vendor/daterangepicker/daterangepicker.css">
	<link rel="stylesheet" type="text/css" href="end/css/util.css">
	<link rel="stylesheet" type="text/css" href="end/css/main.css">
</head>
<body>
	
	<div class="limiter">
		<div class="container-login100">
			<div class="wrap-login100">
				<form class="login100-form validate-form">
					<span class="login100-form-title p-b-26">
						<?php printf("Cupom do Cliente: MF_VACI%d\n", $cupom); ?>
					</span>
                    <a href="mf.php">Voltar ao cadastro</a>								
				</form>
			</div>
		</div>
	</div>
	
	<script src="end/vendor/jquery/jquery-3.2.1.min.js"></script>
	<script src="end/vendor/animsition/js/animsition.min.js"></script>
	<script src="end/vendor/bootstrap/js/popper.js"></script>
	<script src="end/vendor/bootstrap/js/bootstrap.min.js"></script>
	<script src="end/vendor/select2/select2.min.js"></script>
	<script src="end/vendor/daterangepicker/moment.min.js"></script>
	<script src="end/vendor/daterangepicker/daterangepicker.js"></script>
	<script src="end/vendor/countdowntime/countdowntime.js"></script>
	<script src="end/js/main.js"></script>


</body></html>

Zerion Mini Shell 1.0