<?php require_once("header.php");?>

    <div class="site-section"  data-aos="fade">
      <div class="container-fluid">

        <div class="row justify-content-center">

          <div class="col-md-7">
            <div class="row mb-5">
              <div class="col-12 ">
                <h2 class="site-section-heading text-center">Confirmation</h2>
                
              </div>
            </div>
          </div>

        </div>
      
       
     
        <div class="w-50 mx-auto">
<?php

/**********************************************
 *       order-process.php
 *       Skriptet hanterar formulärdata från
 *       order.php
 *     
 **********************************************/

//require_once 'header.php';


if(isset($_POST['submit'])){

    $product_id = $_POST['product_id'];
    $product_name = $_POST['product_name'];
    $name = $_POST["name"];
    $mobile = $_POST["mobile"];
    $email   = $_POST['email'];

    
    echo  "<h2>Your order from PamArts : </h2> ";
    echo  "<h2>Product: <span class='text-green' style='color:#20c997'>$product_name</span></h2> ";
    echo  "<h2>Your digital poster will soon be sent to: 
    <br>
    <span class='text-green' style='color:#20c997'>$email</span></h2>";
   
}


// Logga in localt i Databasen (skickas till confirm-request.php) 
 //$db = new mysqli('localhost', 'mar2404_newcontacts', 'oCRLTo4RBDov', '2404_newcontacts');
 $db = new mysqli('localhost', 'root', 'root', 'pamartsposters');

// Övning
// Spara beställningen i databasen

//require_once 'footer.php';
$sql = "INSERT INTO set_order(product_id, name, mobile, email)
        VALUES ('$product_id', '$name', '$mobile', '$email')";

// Kör SQL-satsen!

$db->query($sql);

?>
</div>


        
      </div>
    </div>
    <?php require_once("footer.php");?> 