Untitled

 avatar
unknown
plain_text
3 years ago
13 kB
1
Indexable
<?php
 
  sleep(1);
  include_once 'PHP/autoloader.php';
  session_start();
 
  if(isset($_SESSION['customer'])){
    $customer = unserialize($_SESSION['customer']);
    $products = $customer->products_ordered;
  }
  else{
    header('Location: order?err=unvalidated');
    $_POST = array();
    exit();
  }
?>
 
<!DOCTYPE html>
<html>
 
<head>
  <title>Checkout | PS5 Market.com</title>
  <meta charset="utf-8">
  <link rel="shortcut icon" href="assets/images/logos/logo.ico" type="image/x-icon">
  <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
  <meta property="og:title" content="PS5 Market.com">
  <meta property="og:description" content="Limited Playstation 5 resale. Worldwide shipping. Competitive prices. Claim yours now.">
  <meta property="og:image" content="assets/images/logos/logo.png">
  <meta property="og:url" content="https://ps5-market.com/">
  <meta name="description" content="Limited Playstation 5 resale. Worldwide shipping. Competitive prices. Claim yours now.">
  <link rel="stylesheet" href="assets/css/bootstrap4.min.css">
  <link rel="stylesheet" href="assets/css/wireframe-theme.min.css">
  <link rel="stylesheet" href="assets/css/template1.css">
  <link rel="stylesheet" href="assets/css/main.css">
  <link rel="stylesheet" href="assets/css/checkout.css">
  <link rel="stylesheet" href="assets/css/form.css">
  <script class="picturefill" async="async" src="assets/js/picturefill.min.js"></script>
</head>
 
<body class="flex-row">
 
  <header class="container-grid container-9">
    <nav class="container-grid navbar container-lg" id="container-3">
      <h2 class="heading-6" id="heading-1">
        <a href="index" class="clearlink">PS5 Market.com</a>
      </h2>
      <div class="container-grid icon-container">
        <a class="glyph icon-link" href="index"><i class="coffeecup-icons-home2"></i></a>
        <a class="glyph icon-link" href="site-map"><i class="coffeecup-icons-question4"></i></a>
      </div>
    </nav>
  </header>
 
  <main class="container-grid container-10">
    <div class="container-grid container-lg content-container">
 
        <h1 style="margin-bottom: 0.5rem;">2. Place your order</h1>
        <p style="margin-bottom: 0.5rem;">
            Please check if your products are correct, enter the neccessary shipping information, choose your 
            preferred form of payment and continue to place your order. If you have any questions, 
            please <a href="contact">contact us</a>.
        </p>
        <hr>
 
        <h3>Your products:</h3>
        <table>
            <tbody>
                <?php
                  foreach($products as $product){
                    if($product->amount > 0){
                      $total_due += ($product->price * $product->amount);
 
                      echo '<tr>';
                      echo '<td>'. $product->name.'</td>';
                      echo '<td>'. $product->amount .'x</td>';
                      echo '<td>€ '. ($product->price * $product->amount) .',00</td>';
                      echo '<td><a class="glyph icon-link" href="order?ref=resetAll"><i class="coffeecup-icons-cancel-square2"></i></a></td>';
                      echo '</tr>';
                    }
                  }
                ?>
            </tbody>
        </table>
 
        <p class="extra-costs">
            <span id="shipping-costs">€ 11,00</span><br>
            <span id="total-costs"><?php echo '€ '.($total_due+11).',00';?></span>
        </p>
        <br>
 
        <form action="PHP/validators/checkout.validator.php" method="post" class="no-style">
 
          <h3 class="mb-0">Shipping information:</h3>
          <span style="font-size: 0.8rem; color: grey">
              * = required field. We need this information to successfully fulfill your order. 
              For more information, please refer to our <a href="privacy-policy">Privacy Policy</a>.
          </span><br><br>
 
          <p class="mb-0" style="color: #7b7b7b;">Personal information:</p>
          <div class="row">
            <div class="col-12 col-md-5 pl-0"><input type="text" required name="firstName" id="firstName" placeholder="First name *"></div>
            <div class="col-12 col-md-5 pl-0"><input type="text" required name="lastName" id="lastName" placeholder="Surname *"></div>
 
            <div class="col-6 col-md-3 pl-0">
              <div class="radio-outer">
                <input type="radio" id="gender_male" name="gender" value="male" required>
                <label for="gender_male">Male *</label>
              </div>
            </div>
 
            <div class="col-6 col-md-3 pl-0">
              <div class="radio-outer">
                <input type="radio" id="gender_female" name="gender" value="female" required>
                <label for="gender_female">Female *</label>
              </div>
            </div>
          </div>
 
          <div class="col-12 col-sm-10 my-2 pl-0"><hr></div>
          <p class="mb-0" style="color: #7b7b7b;">Shipping address:</p>
 
          <div class="row">
            <div class="col-12 col-md-10 pl-0"><input type="text" required name="addressLine1" id="addressLine1" placeholder="Address Line 1 *"></div>
            <div class="col-12 col-md-10 pl-0"><input type="text" name="addressLine2" id="addressLine2" placeholder="Address Line 2"></div>
            <div class="col-12 col-sm-6 col-md-5 pl-0"><input type="text" required name="postalCode" id="postalCode" placeholder="Postal code *"></div>
            <div class="col-12 col-sm-6 col-md-5 pl-0"><input type="text" required name="city" id="city" placeholder="City *"></div>
 
            <div class="col-12 col-md-5 pl-0">
              <select name="country" id="countrySelect" required>
                <option value="none" selected disabled>Select your country *</option>
              </select>
            </div>
            <div class="col-12 col-md-5 pl-0">
              <select name="state" id="stateSelect" class="hidden">
                <option value="none" selected disabled>Select your State</option>
              </select>
            </div>
          </div>
 
          <div class="col-12 col-sm-10 my-2 pl-0"><hr></div>
          <p class="mb-0" style="color: #7b7b7b;">Contact information:</p>
 
          <div class="row">
            <div class="col-12 col-md-5 pl-0"><input type="email" required name="emailAddress" id="emailAddress" placeholder="Email address *"></div>
            <div class="col-12 col-md-5 pl-0"><input type="tel" pattern="[\s*0-9().+-]{8,}" name="phoneNumber" id="phoneNumberSelect" placeholder="Phone number"></div>
          </div>
          <br>
          <h3 class="mb-0">Payment method:</h3>
          <span style="font-size: 0.8rem; color: grey">
            Crypto payments coming soon. To be notified first, please subscribe to our newsletter at the bottom of this page.
          </span><br><br>
 
          <div class="payment-type" style="border-top: solid 1px #ccc">
            <input type="radio" id="payment_sepa" name="payment" value="sepa" required>
            <span class="payment-info">
              <span class="payment-title">Bank transfer</span> <br>
              <span class="payment-desc">Pay using SEPA bank transfer.</i></span>
            </span>
            <div class="payment-rate">FREE</div>
          </div>
 
    <div class="payment-type">
            <input type="radio" id="payment_cc" name="payment" value="creditcard" required>
            <span class="payment-info">
              <span class="payment-title">Credit Card</span> <br>
              <span class="payment-desc">Pay using VISA, MasterCard, Amex or any other creditcard.</i></span>
            </span>
            <div class="payment-rate">1,9% + € 0,30</div>
          </div>
 
          <br><br>
          <h3 class="mb-0">Discount Code</h3>
          <span style="font-size: 0.8rem; color: grey">
            You can insert your discount code here for discounts or free products.
                </span>
          <input type="text" name="voucher" id="voucher" placeholder="Discount code">
          <br><br>
          <h3 class="mb-0">User agreements:</h3>
          <span style="font-size: 0.8rem; color: grey">By clicking continue you agree to the Terms and Conditions.</span>
          <br>
          <div class="agreement-check mt-2" style="border-top: solid 1px #ccc">
            <input type="checkbox" name="agreementToTerms" id="agreementToTerms" required>
            <div class="col-12 col-md-9 pb-0 pl-0">
              <b>I agree to the <a href="terms-and-conditions" target="_blank">Terms and Conditions</a> and our <a href="privacy-policy" target="_blank">Privacy Policy</a>.</b>
            </div>
          </div>
          <br><br>
          

          <button type="submit" class="continue-btn" name="submit-btn">Continue</button>
          <br><br>  
        </form>
 
 
 
    </div>
  </main>
 
  <div class="container-grid row container-8">
 
    <div class="container-grid col col-12 col-sm-6 col-md-6 col-lg-6 col-xl-6 container-5 small-align-left">
      <div class="container-grid container-6">
        <h5 class="heading-4">Subscribe now</h5>
        <p class="paragraph paragraph-2">
          To receive instant notifications about restocks, 
          discounts and other announcements from us.
        </p>
 
        <label class="label neutral-label-form-1">Your email:</label>
 
        <form class="form-container" action="PHP/scripts/email-subscribe.script.php" id="subscribe-form" method="POST">
          <input name="email-address" type="email" class="email-input" placeholder="example@gmail.com" pattern="[_.\w-]+@([\w][\w\-]+\.)+[a-zA-Z]{2,3}">
          <input type="hidden" name="page-referer" value="<?php echo $_SERVER['PHP_SELF'];?>">
          <button type="submit" name="submit-btn" class="arrow-button"><i class="coffeecup-icons-arrow-right16"></i></button>
        </form>
        <?php
          echo '<script>setTimeout(() => {$("#subscribe-alert").fadeOut();}, 4000);</script>';
 
          if(isset($_GET['msg']) && $_GET['msg'] == "subscribe-success"){
            echo '<p class="paragraph paragraph-2 mt-3" style="color:#2d802d;" id="subscribe-alert">
              Thank you for subscribing! You will now receive periodic updates from us.
            </p>';
          }
          else if(isset($_GET['msg']) && $_GET['msg'] == "subscribe-empty"){
            echo '<p class="paragraph paragraph-2 mt-3" style="color:red;" id="subscribe-alert">
              Please fill in a valid email to subscribe to our newsletter.
            </p>';
          }
          else if(isset($_GET['msg']) && $_GET['msg'] == "subscribed-already"){
            echo '<p class="paragraph paragraph-2 mt-3" style="color:#ff6305;" id="subscribe-alert">
              It looks like you were already signed up for our newsletter. No changes were made.
            </p>';
          }
        ?>
 
      </div>
    </div>
 
    <div class="container-grid col col-12 col-sm-6 col-md-6 col-lg-6 col-xl-6 container-7 small-align-right">
      <div class="container-grid container-6 align-right">
        <h5 class="heading-5 footer-link"><a href="terms-and-conditions">Terms and Conditions</a></h5>
        <div class="rule rule-1"><hr></div>
        <h5 class="heading-5 footer-link"><a href="privacy-policy">Privacy Policy</a></h5>
        <div class="rule rule-1"><hr></div>
        <h5 class="heading-5 footer-link"><a href="about">Who are we?</a></h5>
        <div class="rule rule-1"><hr></div>          
        <h5 class="heading-5 footer-link"><a href="contact">Contact Us</a></h5>
        <div class="rule rule-1"><hr></div>
        <h5 class="heading-5 footer-link"><a href="site-map">Site Map</a></h5>
      </div>
    </div>
  </div>
 
  <footer class="neutral-footer-section-2 container-grid">
    <div class="container-footer-wrapper container-grid mb-2">
      <a class="glyph icon-link" href="https://wa.me/message/3YKKJ7TXA522E1"><i class="coffeecup-icons-whatsapp"></i></a>
    </div>
    <p class="paragraph paragraph-3">©2022 PS5 Market.com. All Rights Reserved.</p>
  </footer>
 
  <script src="assets/js/jquery.min.js"></script>
  <script src="assets/js/outofview.js"></script>
  <script src="assets/js/bootstrap.min.js"></script>
  <script src="assets/js/checkout.js"></script>
 
</body>
</html>
Editor is loading...