Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.18 KB | None | 0 0
  1. <?php
  2.     require_once 'core/init.php';
  3.        
  4.     $full_name = ($_GET['full_name']);
  5.     $full_name2 = ($_GET['full_name2']);
  6.     $email = ($_GET['email']);
  7.     $phone = ($_GET['phone']);
  8.     $phone2 = ($_GET['phone2']);
  9.     $notation = ($_GET['notation']);
  10.     $description = ($_GET['description']);
  11.     $recipient = ($_GET['recipient']);
  12.     $delivery = ($_GET['delivery']);
  13.     $street = ($_GET['street']);
  14.     $pay_method = ($_GET['pay-method']);
  15.     $cart_id = ($_GET['cart_id']);
  16.     $sub_total = ($_GET['sub_total']);
  17.     $metadata = array(
  18.         "cart_id" => $cart_id,
  19.         "sub_total" => $sub_total,
  20.     );
  21.  
  22.     $db->query("UPDATE cart SET paid = 1 WHERE id = '{$cart_id}'");
  23.     $db->query("INSERT INTO transactions (cart_id, full_name, full_name2, email, phone, phone2, notation, recipient, pay_method, delivery, street, sub_total, description)
  24.     VALUES ('$cart_id', '$full_name', '$full_name2', '$email', '$phone', '$phone2', '$notation', '$recipient', '$pay_method', '$delivery', '$street', '$sub_total', '$description')");
  25.    
  26.     $domain = ($_SERVER['HTTP_HOST'] != 'localhost')? '.'.$_SERVER['HTTP_HOST']:false;
  27.     setcookie(CART_COOKIE,'',1,"/",$domain,false);
  28.    
  29.    
  30.     include 'includes/head.php';
  31.     include 'includes/navigation.php';
  32.     include 'includes/headerpartial.php';
  33.    
  34.    
  35.     //Отправка сообщения на почту.
  36.     $message = "На сайте новая заявка! Сумма заказа: ".number_format($sub_total)." рублей.";
  37.     $to = "kalagur.a@yandex.ru";
  38.     $from = "admin@florentis.ru";
  39.     $subject = "Заявка";
  40.     $headers = "From: $from\r\nReply-to: $from\r\nContent-type: text/plain; charset=utf-8\r\n";
  41.     mail($to, $subject, $message, $headers);   
  42.  
  43. ?>
  44.  
  45.    
  46.     <h1 class="text-center text_success">Спасибо за покупку!</h1>
  47.     <p>Стоимость вашего заказа составила <?=number_format($sub_total);?> рублей. </p>
  48.     <p>Номер вашего заказа: <strong><?=$cart_id;?></strong>.</p>
  49.     <p>В ближайшее время с вами свяжется по телефону наш менеджер для уточнения деталей доставки и времени доставки.</p>
  50.    
  51.  
  52.  
  53. <?php
  54.     include 'includes/footer.php';
  55.    
  56.  ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement