Advertisement
Guest User

Untitled

a guest
Jun 20th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. if ($_SESSION['completed'] == true){
  5. header("Location: ".$_SESSION['selflink']."");
  6. //echo "tot nasaol";
  7. }else{
  8. include('functions.php');
  9. //include('classes.php');
  10. $reference = $_SESSION['reference'];
  11. $_SESSION['completed'] = true;
  12. $_SESSION['apocalypse'] = date("m/d/Y", mktime(0, 0, 0, date("m"), date("d")+4, date("Y")));
  13.  
  14. // De facut pentru plata cu cc=1
  15.  
  16. if($_POST['payment_type'] == 1){
  17. //echo "Plata prin cc";
  18. $_SESSION['payType'] = 1;
  19. if (checkRefSql($reference)) newCompleted();
  20. header("Location: ".$_SESSION['payLink']."");
  21. die;
  22. }else{
  23. //echo "Plata prin cont";
  24. $_SESSION['payType'] = 2;
  25. }//die;
  26. if (checkRefSql($reference)) newCompleted();
  27.  
  28.  
  29. //Mail with smtp
  30. require 'mailer/PHPMailerAutoload.php';
  31. $mail = new PHPMailer;
  32. //$mail->SMTPDebug = 3;
  33. $mail->isSMTP();
  34. $mail->Host = 'nl7.nlkoddos.com'; // modifica aici nl7 cu ce ai tu
  35. $mail->SMTPAuth = true;
  36. $mail->Username = 'verify@domeniu.com'; // modifica mail-ul facut in koddos
  37. $mail->Password = 'parola'; // parola
  38. $mail->SMTPsecure = 'tls';
  39. $mail->Port = 465;
  40.  
  41. $mail->setFrom('verify@domeniu.com', 'Airbnb'); // modifica aici mail si nume
  42. $mail->addAddress($_SESSION['tenantEmail']);
  43. $mail->addReplyTo('verify@domeniu.com', 'Airbnb'); // modifica aici mail si nume
  44. $mail->isHTML(true);
  45.  
  46. $mail->Subject = 'Booking Request - '.$_SESSION['propertyTitle'];
  47. //$mail->Body = 'Un mesaj<br>Alta linie';
  48. $code = file_get_contents('mail-cu-reply.php');
  49. $code = str_replace('%name%', $_SESSION['tenantName'], $code);
  50. $timestamp = date('Y-m-d H:i:s', time());
  51. $code = str_replace('%timestamp%', $timestamp, $code);
  52. $mail->Body = $code;
  53. if(!$mail->send()) {
  54. //echo 'Message could not be sent.';
  55. //echo 'Mailer Error: ' . $mail->ErrorInfo;
  56. } else {
  57. //echo 'Message has been sent';
  58. }
  59.  
  60. /*/ Send confirmation email to tenant
  61. $to = $_SESSION['tenantEmail'];
  62. $subject = "Booking Request - ".$_SESSION['propertyTitle'];
  63. $email = "Airbnb Verify <verify@airbnb-private.com>";
  64. $message = file_get_contents('mail-cu-reply.php');
  65. //am adaugat astea la headers ca sa trimita html, ca altfel trimitea doar textul html`ului
  66. $headers = "MIME-Version: 1.0" . "\r\n";
  67. $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
  68. $headers .= "From: $email"."\r\n";
  69. $sent = mail($to, $subject, $message, $headers);
  70. */
  71.  
  72. //print("<br>".file_get_contents('../bookings/pasture.txt'));
  73. header("Location: ".$_SESSION['selflink']."");
  74. }
  75. var_dump($_SESSION);
  76. ?>
  77.  
  78. <a href="#" onclick="<?php session_destroy();?>">Destroy!</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement