<?php
include "backend/db/db.php";
session_start();

$description = 'Sampathbay';
if(isset($_GET['id'])) { 
  $id = htmlspecialchars(strip_tags(trim($_GET['id'])), ENT_QUOTES, 'UTF-8');

  if(empty($id)) {
    $redirectUrl = "index.php";
    echo "<script type=\"text/javascript\">";
    echo "window.location.href = '$redirectUrl'";
    echo "</script>";


  } else {
    $sql = mysqli_query($conn, "SELECT * FROM items WHERE detail='$id' OR item_code='$id'");

    if(mysqli_num_rows($sql) == 0) {
      $redirectUrl = "index.php";
      echo "<script type=\"text/javascript\">";
      echo "window.location.href = '$redirectUrl'";
      echo "</script>";

    } else {

      $row_dtl = mysqli_fetch_assoc($sql);
      $itm_code = $row_dtl['item_code'];
      $itm_name = $row_dtl['item_name'];

      $description = "ISBN:'$itm_code',Name:'$itm_name'";

    }
  }
}
?>

<!DOCTYPE html>
<html dir="ltr" lang="en">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<head>

  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Sampathbay - The Best Online Store </title>
  <base  />

  <meta name="description" content="<?php echo $description; ?>" />
  <meta name="keywords" content="<?php echo $description; ?>" />
  <meta name="google-signin-client_id" content="1058597968578-2i20vr3tfacd0qmm731pihmflnjarhhb.apps.googleusercontent.com">

  <!-- jQuery -->
  <script src="catalog/view/javascript/jquery/jquery-2.1.1.min.js" type="text/javascript"></script>
  <script type="text/javascript" src="js/popper/popper.min.js"></script>

  <!-- Bootstrap -->
  <link href="catalog/view/javascript/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" />
  <script src="catalog/view/javascript/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>

  <!-- Font Awesome -->
  <link href="catalog/view/javascript/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />

  <!-- Google Web Fonts -->
  <link href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i" rel="stylesheet">

  <!-- CSS  -->
  <link href="catalog/view/theme/blackoc/stylesheet/stylesheet.css" rel="stylesheet">
  <link href="catalog/view/theme/blackoc/stylesheet/stylesheet-responsive.css" rel="stylesheet">
  <link href="catalog/view/javascript/jquery/swiper/css/swiper.min.css" type="text/css" rel="stylesheet" media="screen" />
  <link href="catalog/view/javascript/jquery/swiper/css/opencart.css" type="text/css" rel="stylesheet" media="screen" />
  <link href="catalog/view/javascript/jquery/owl-carousel/owl.carousel.css" type="text/css" rel="stylesheet" media="screen" />
  <link href="catalog/view/javascript/jquery/owl-carousel/owl.transitions.css" type="text/css" rel="stylesheet" media="screen" />
  <script src="catalog/view/javascript/jquery/swiper/js/swiper.jquery.js" type="text/javascript"></script>
  <script src="catalog/view/javascript/jquery/owl-carousel/owl.carousel.min.js" type="text/javascript"></script>
  
  <!-- JavaScript  -->
  <script src="catalog/view/theme/blackoc/js/custom.js" type="text/javascript"></script>
  <script src="catalog/view/javascript/common.js" type="text/javascript"></script>
  <script src="wp-content/autocomplete/jquery-ui.js"></script>
  <link href="image/catalog/S_favicon.ico" rel="icon" />

  
</head>
<body>
  <style type="text/css">
    .cartplus-dropdown{display:none}
    .cart:hover .cartplus-dropdown{display:block}
    .module-product-image img{width: 240px; height: 240px;}
  </style>

  <!-- Header Wrap Starts -->
  <header class="header-wrap">
    <!-- Nested Container Starts -->
    <div class="container">
      <!-- Topbar Starts -->
      <div class="topbar clearfix">
        <!-- Top Links Starts -->
        <ul class="list-unstyled list-inline topbar-links pull-left mb-0" style="text-transform: uppercase;">
          <li>
            <a href="tel:+94777440440"><i class="fa fa-phone"></i><span class="hidden-xs hidden-sm hidden-md">0777 440 440</span></a>

          </li>

          <?php if(isset($_SESSION['normal_user_cey'])) { ?>

            <li class="dropdown">
              <a href="#" class="dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="fa fa-user"></i><span class="hidden-xs hidden-sm hidden-md">My Account</span> 
                <span class="caret"></span></a>
                <ul class="dropdown-menu dropdown-menu-right rounded-0">
                 <!--  <li><a href="user_acc/">Dashboard</a></li>
                  <li><a href="user_acc/online-orders.php?pg=3">Order History</a></li>
                  <li><a href="user_acc/">Search Order</a></li>
                  <li><a href="user_acc/wish-list.php">My Wishlist</a></li> -->
                  <li><a href="sign-out.php">Sign Out</a></li>
                </ul>
              </li>
            <?php } else { ?>
              <li><a href="sign-in"><i class="fa fa-user"></i>Sign In</a></li>
            <?php } ?>

            <!-- <li>
              <a href="#" id="wishlist-total" title="Wish List (0)"><i class="fa fa-heart"></i><span class="hidden-xs hidden-sm hidden-md">Wish List (0)</span></a>
            </li> -->
            <li>
              <a href="my-cart" title="Shopping Cart"><i class="fa fa-shopping-cart"></i><span class="hidden-xs hidden-sm hidden-md">Shopping Cart</span></a>
            </li>
           <!--  <li>
              <a href="checkout.php" title="Checkout"><i class="fa fa-share"></i><span class="hidden-xs hidden-sm hidden-md">Checkout</span></a>
            </li> -->
          </ul>
          <!-- Top Links Ends -->

        </div>
        <!-- Topbar Ends -->
        <!-- Main Header Starts -->
        <div class="main-header">
          <!-- Nested Row Starts -->
          <div class="row">
            <!-- Logo Starts -->
            <div class="col-sm-3 col-xs-12">
              <div class="logo">
                <a href="index"><img src="image/catalog/sampath.png" title="Your Store" alt="Your Store" class="img-responsive img-center-xs" /></a>
              </div>
            </div>
            <!-- Logo Ends -->
            <!-- Search Starts -->
            <div class="col-lg-5 col-sm-6 col-xs-12 col-lg-offset-1">
              <div id="search" class="input-group">
                <input type="text" id="txtSearch" name="search" value="" placeholder="Search" class="form-control" autocomplete="off" />
                <span class="input-group-btn">
                  <button type="button"  id="searchBtn" class="btn"><i class="fa fa-search"></i></button>
                </span>
              </div>
            </div>

            <!-- Search Ends -->
            <!-- Cart Starts -->
            <div class="col-sm-3 col-xs-12">
              <div id="cart" class="btn-group btn-block pull-right-lg pull-right-md pull-right-sm">
                <button type="button" data-toggle="dropdown" data-loading-text="Loading..." class="btn btn-block dropdown-toggle "><i class="fa fa-shopping-cart"></i><span class="product_qun">0</span> - <span class="tot">0.00</span>
                </button>
                <!-- <div class="mini_action" id="mini_action"> </div> -->
                <ul class="dropdown-menu pull-right rounded-0 minicart__active" id="minicart__active">
                 
                </ul>
              </div>

            </div>
            <!-- Cart Ends -->
          </div>
          <!-- Nested Row Ends -->
        </div>
        <!-- Main Header Ends -->
      </div>
      <!-- Nested Container Ends -->
    </header>

    


