<!doctype html>
<html lang="en">
  <head>

  </head>
  
  <body>
   
  <!-- cart -->
    <div id="wrapper2">
    	<div id='sidebar-wrapper2'>
        <div class='cart-header'>
           		Shopping Cart
       </div>
		<?php include ("cart.php");?>
        </div>
    </div>  
  <!-- end cart -->
  
  
  
  <!-- login check -->
  <?php 
  	if (@$_SESSION['username']){
		if (@$_SESSION['Tusername']){
		$sign_in="hidden";
		$sign_out="";
		$cart="";
		}else{
		$sign_in="";
		$sign_out="hidden";
		$cart="";
		}
	}else{
		$sign_in="hidden";
		$sign_out="";
		$cart="hidden";
	}
  ?>
  <!-- endlogin check -->
   <div id="wrapper3">
    	<div id='sidebar-wrapper3'>
       <ul class=" col-lg-12 col-md-12 col-sm-12 col-xs-12  sidebar-nav">
                <div class='<?php echo $sign_out; ?>'>
                <li class="sidebar-brand">
                
                    <a data-toggle="collapse" href="#collapsefour" style="color:#074641; padding-top:35px; padding-bottom:15px;">
                        <strong>Registered Customer</strong>
                    </a>
                    
                    <li class="sidebar-b rand collapse in" id="collapsefour">
                        
                            <div>
                                <a href="#sign-in" role="tab" data-toggle="tab">
                                    &nbsp;&nbsp;Login to Sayvour
                                </a>
                            </div>
                        
                            <div>
                                <a href="#forgot-password" role="tab" data-toggle="tab">
                                    &nbsp;&nbsp;Forgot Password
                                </a>
                            </div>
                        
                    </li>
                  </li>
                  <li class="sidebar-brand">      
                    <a data-toggle="collapse" href="#collapsefive" style="color:#074641; padding-top:35px;padding-bottom:15px;">
                        <strong>Register for New Customer</strong>
                    </a>
                    <li class="sidebar-b rand collapse in" id="collapsefive">
                        
                            <div>
                                <a href="#sign-up" role="tab" data-toggle="tab">
                                    &nbsp;&nbsp;Register for New Customer
                                </a>
                            </div>
                        
                    </li>
                    </li>
                   </div> 
                   
                  <div class='<?php echo $sign_in;?>'>
                  <li class="sidebar-brand">      
                    <a data-toggle="collapse" href="#collapsesix" style="color:#074641; padding-top:35px;padding-bottom:15px;">
                        <strong>Welcome <?php echo @$_SESSION['username']; ?></strong>
                    </a>
                    
                    <li class="sidebar-b rand collapse in" id="collapsesix">
                        
                            <div>
                                <a href="#Profile" role="tab" data-toggle="tab">
                                    &nbsp;&nbsp;PROFILE
                                </a>
                            </div>
                            
                        	<div>
                                <a href="includes/login.php?action=logout">
                                    &nbsp;&nbsp;LOG OUT
                                </a>
                            </div>
                        
                    </li>
                </li></div>
            </ul>
       </div>
    </div>  
  <!-- menu -->
    <div id="wrapper">
        <div id="sidebar-wrapper">
            <ul class=" col-lg-12 col-md-12 col-sm-12 col-xs-12  sidebar-nav">
				
                <li class="sidebar-brand" role="tablist">
                    <a href="#products" role="tab" data-toggle="tab">
                        HOME
                    </a>
                </li>
                
                <li class="sidebar-brand">
                    <a data-toggle="collapse" href="#collapsefour">
                        ACCOUNT
                    </a>
                    
                    <li class="sidebar-b rand collapse in" id="collapsefour">
                        <div class='<?php echo $sign_out; ?>'>
                            <div>
                                <a href="#sign-in" role="tab" data-toggle="tab">
                                    &nbsp;&nbsp;Login to Sayvour
                                </a>
                            </div>
                        
                            <div>
                                <a href="#sign-up" role="tab" data-toggle="tab">
                                    &nbsp;&nbsp;Register for New Customer
                                </a>
                            </div>
                        </div>
                        
                        <div class='<?php echo $sign_in;?>'>
                            <div>
                                <a href="#Profile" role="tab" data-toggle="tab">
                                    &nbsp;&nbsp;PROFILE
                                </a>
                            </div>
                            
                        	<div>
                                <a href="includes/login.php?action=logout">
                                    &nbsp;&nbsp;LOG OUT
                                </a>
                            </div>
                        </div>
                    </li>
                </li>
            
                <li class="hidden-lg hidden-md col-sm-12 col-xs-12">
                <a style="text-decoration:none" data-toggle="collapse" href="#collapsec">
                    <h1>
                        CHOCOLATES
                    </h1>
                </a>
                
                <div id="collapsec" class="collapse in">
                    <ul>
                        <?php
							$sql = "select * from ategories where belong='Chocolates'";
							$result = mysqli_query($conn,$sql);
							if ($result->num_rows > 0) {
							while($row = $result->fetch_assoc()) {
							echo '<a href="e-shop.php?ategory='.str_replace(' ','_',$row["ategory"]).'">';
							echo "<li>".$row['ategory']."</li>";
							echo '</a>';
							}}
						?>
                    </ul>
                </div>
            </li>  
                
                <li class="hidden-lg hidden-md col-sm-12 col-xs-12">
            	<a style="text-decoration:none" data-toggle="collapse" href="#collapsep">
                    <h1>
                        PASTRIES
                    </h1>
                </a>

                <div id="collapsep" class="collapse in">
                    <ul>
                         <?php
							$sql = "select * from ategories where belong='Pastries'";
							$result = mysqli_query($conn,$sql);
							if ($result->num_rows > 0) {
							while($row = $result->fetch_assoc()) {
							echo '<a href="e-shop.php?ategory='.str_replace(' ','_',$row["ategory"]).'">';
							echo "<li>".$row['ategory']."</li>";
							echo '</a>';
							}}
						?>
                    </ul>
                </div>
            </li>
                
                <li class="hidden-lg hidden-md col-sm-12 col-xs-12">
            	<a style="text-decoration:none" data-toggle="collapse" href="#collapseb">
                    <h1>
                        Bespoke Products
                    <h1 style="margin:0px 0px">
                        for Occasions
                    </h1>
                </a>
                
                <div id="collapseb" class="collapse in" >
                    <ul>
						<?php
							$sql = "select * from ategories where belong='Bespoke Products for Occasions'";
							$result = mysqli_query($conn,$sql);
							if ($result->num_rows > 0) {
							while($row = $result->fetch_assoc()) {
							echo '<a href="e-shop.php?ategory='.str_replace(' ','_',$row["ategory"]).'">';
							echo "<li>".$row['ategory']."</li>";
							echo '</a>';
							}}
						?>
                    </ul>
                </div>
            </li>
            </ul>
        </div>
    </div>
  <!-- end menu -->
  
  <!-- top menu -->
    <div>
        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 top-bar">
                <div class="col-lg-10 col-md-9 col-sm-12 col-xs-12 fixed-menu-container" >
                    <!--<select class="btn btn-default">
                        <option value="EN">
                            EN
                        </option>
                        
                        <option value="CN">
                            CN
                        </option>
                    </select>-->
                    

                    <a href="includes/translate.php?url=<?php echo $_SERVER['PHP_SELF']."?".$_SERVER["QUERY_STRING"]; ?>&page=<?php echo $page; ?>" class="btn btn-default" id="">
                        中文
                    </a>       
                    <a href="index.html" class="btn btn-default" id="">
                        ABOUT US
                    </a>     
                    
                    <a href="#message" class="btn btn-default" id="message" data-toggle="modal" data-target="#myModal">
                        CONTACT US
                    </a>
                    
                    <a href="#cart-toggle" class="<?php echo $cart;?>btn btn-default" id="cart-toggle" onClick="addcart()">
                        <div class="<?php echo $cart;?>">CART</div>
                    </a>
                    
                    <a href="#menu-toggle" class="col-sm-12 col-xs-12 hidden-lg hidden-md  btn btn-default" id="menu-toggle">
                        MENU
                    </a>   
                    
                    <a href="#account" class="col-lg-12 col-md-12 hidden-xs hidden-sm btn btn-default" id="account">
                        MY ACCOUNT
                    </a> 
                    <a href="e-shop.php" class="btn btn-default" id="">
                        HOME
                    </a>   
                    <a style="padding:0px" href="https://www.facebook.com/sayvour" class="btn btn-default" id="">
                        <img src="index-date/img/logo/icon-fb.png" style=" width:27px">
                    </a>    
                    <a style="padding:0px" href="https://www.instagram.com/sayvour_hk/" class="btn btn-default" id="">
                        <img src="index-date/img/logo/icon-ig.png" style=" width:27px" >
                    </a>       
                </div>
                
                
                <div class="col-lg-2 col-md-3 hidden-sm hidden-xs top-menu-bar">
                    <img src="../img/sayvour-logo.png"  style="width: 100%; padding-top: 5%; padding-right: auto; padding-bottom: 5%; padding-left: auto;"/>
                </div>
                
                <div class="hidden-lg hidden-md col-sm-12 hidden-xs top-menu-bar">
                    <img src="../img/sayvour-logo.png"  style="width: 50%; padding-top: 5%; padding-bottom: 5%; margin-left:25%; margin-right:25%; margin-bottom:10px; "/>
                </div>
                
                <div class="hidden-lg hidden-md hidden-sm col-xs-12 top-menu-bar">
                    <img src="../img/sayvour-logo.png"  style="width: 80%; padding-top: 5%; padding-bottom: 5%;  margin-left:10%; margin-right:10%; margin-bottom:10px; "/>
                </div>
                
                <div class="col-lg-10 col-md-9 col-sm-12 col-xs-12 our-product" >
                        
						<?php 
						if(!@$_SESSION["username"]){echo '<p class="our-product-text" style=" text-transform: capitalize">Welcome to Sayvour!';}elseif(@$_SESSION["Tusername"]){echo '<p class="our-product-text" style=" text-transform: capitalize">Welcome to Sayvour!';}
						else{echo '<p class="our-product-text" style=" text-transform: capitalize">Hello '.@$_SESSION["username"].'!';}
						?>
                    </p>
                </div>
            </div>
        </div>
    </div>
  <!-- end top menu -->
  
  <!-- modal -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    	<span aria-hidden="true">
                        	&times;
                        </span>
                    </button>
                    
                    <h4 class="modal-title" id="myModalLabel">
                        Contact Sayvour
                    </h4>
                </div>
                
                <form method="post" action="includes/add-message.php" >
                    <div class="modal-body">
                    	<div class="form-group">
                        	<input name="name" class="form-control" value="<?php echo @$_SESSION["username"]; ?>" placeholder="Enter your name" required>
                        </div>
                        
                    	<div class="form-group">
                        	<input name="email" value="<?php echo @$_SESSION["email"]; ?>" type="email" class="form-control" placeholder="Enter your email" required>
                        </div>
                        
                    	<div class="form-group">
                        	<input name="phone" value="<?php echo @$_SESSION["phone"]; ?>" class="form-control" placeholder="Enter your phone" pattern="[0-9]{8}" title="八位的電話號碼" required>
                        </div>
                        
                        <div class="form-group">
                        	<textarea name="message" class="form-control" rows="3" placeholder="Enter your message" required></textarea>
                        </div>
                    </div>
                    
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">
                            Close
                        </button>
                        
                        <input type="submit" name="submit" value="Send" class="btn btn-info" />
                    </div>
                </form>
            </div>
        </div>
    </div>
  <!-- end modal -->


</body>
</html>