<?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">Order</h2>
                
              </div>
            </div>
          </div>

        </div>
        <div class="row" id="lightgalleryXXXXXXXX">  
       
       

<?php

/**********************************************
 *       order-form.php
 *       Skriptet hanterar en GET-request
 *       och visar ett beställningsformulär
 **********************************************/

// Infoga DB-Skript
require_once 'db.php';

// Sök en poster i databasen med hjälp av dess id
$id = $_GET['id'];

// SQL-fråga för att hämta data
$sql = "SELECT * FROM posters WHERE id='$id'";

// Utför frågan
$result = $db->query($sql);

// Hämta resultatet som en associativ array
$posters = $result->fetch_assoc();

// print_r($film); die;

$article_number = $posters['article_number'];
$product_name = $posters['product_name'];
$price = $posters['price'];
$image = $posters['file_name'];
$description = $posters['description'];
$image = $posters['file_name'];

?>

<div class="row" >
<div class="col">

<form action="order-process.php" method="post" class="text-center">

<input type="name" name="name" 
    required class="w-50 form-control my-2 d-inline " 
    placeholder="Your name" required>

    <input type="mobile" name="mobile" 
    required class="w-50 form-control my-2 d-inline " 
    placeholder="Your mobile number" required>

    <input type="email" name="email" 
    required class="w-50 form-control my-2 d-inline " 
    placeholder="Your email" required>

    <div class="text-end" >
    <input type="submit" name="submit" class="btn btn-link"
        class="w-50 form-control my-2 btn btn-outline-success" 
        value="Order">
        
    </div>

    <!-- <input type="submit" name="submit"
    class="w-50 form-control my-2 btn btn-outline-success" 
    value="Order"> -->

    <input type="hidden" name="product_id" value="<?php echo $id ?>">
    <input type="hidden" name="product_name" value="<?php echo $product_name ?>">


  </form>

</div>

<div class="col">
<div class="text-left my-0">
    <h3>Your order includes : <?php echo $product_name ;?></h3>
   
    <p class="fw-bold"><?php echo $description; ?></p>
    <p>Article number: <span class="fw-semibold"><?php echo $id; ?></span></p>
    <p>Price: <span class="fw-semibold"><?php echo $price; ?> kr</span></p>
</div>
<br>

<!--
<h3 class="text">
    Your order includes: 
    <br>
    <?php echo $product_name; ?> 
    <br>
    Article number: 
    <?php echo $id; ?>  
    <br>
    Price: 
    <?php echo $price; ?>kr
</h3>
-->
<br>
</div>

<?php

?>






        </div>
      </div>
    </div>

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