<!doctype html>
<html lang="en">
  <head>
  
  
  <style>
  
  
  
@media (min-width: 200px) {
		.form-control-quantity{
		width:100%;
		
		}

.checkout-container{
	padding:0px 0px;
} 	
}
@media (min-width: 600px) {
		.form-control-quantity{
		width:100%;
		
		}

	
	.checkout-products{
	padding-top:10px;
	padding-bottom:10px;
	border-top:1xp solid #99EEF8;
	
}

.checkout-container{
	padding:5% 5%;
} 	
}
@media (min-width: 990px) and (max-width: 1799px) {
	.form-control-quantity{
		width:84px;
		
		}
	
	
	.checkout-products{
	padding-top:10px;
	padding-bottom:10px;
	display:-webkit-inline-box;
	border-top:1xp solid #99EEF8;
	
}

	
.checkout-container{
	padding:0% 15%;
} 
}

@media (min-width: 1800px) {  
	.form-control-quantity{
		width:84px;
		
		}

	.checkout-products{
	padding-top:10px;
	padding-bottom:10px;
	display:-webkit-inline-box;
	border-top:1xp solid #99EEF8;
	
}
.checkout-container{
	padding:0px 25%;
} 
}
.checkout-tablebottom{
	border:1px solid #e0e0e0;
	padding:20px;
	padding-bottom:20px;

	}
.checkout-instructions {
	border:1px solid #e0e0e0;
	border-bottom:0px;
	padding:20px;
}
.checkout-li{
	border-bottom:1px solid #e0e0e0;
	padding-bottom:15px;
	display:list-item;
	list-style-type:none;
	padding-bottom:35px;
}

  
 .prod-thumbnail{
	 padding:0px;
	 width:100%;
	 
}

.row{
	margin-bottom:10px	
}

.prod-title-variation{
	padding-left:10px;
	}

.checkout-img-info{
	padding:0px;
	padding-left:15px;
	text-align: left;

}
.checkout-prod-info{
	padding:0px;
	text-align:center;

	}
.checkout-img{
	padding:0px;
	}
.form-control{
	padding:4px 40px;
	}
	
.checkout-Customer-Info .form-control{
	padding:4px 5px;
	margin-bottom:10px
	}
	
.checkout-prod-info-r{
	text-align:right;
	font-size:20px;
	padding:10px 0px;
	
	}

.sign-ro-login{
	padding:10px 10px;
	background:#99EEF8;
	border-radius: 5px;
	margin-bottom:10px;
}

.place-order{
	margin-top:20px;
	
	}

.btn-place-order{
	margin-top:10px;
	}


  
  </style>
  
  </head>
  
  <body>
  
  
  <!-- head -->
  <div class="checkout-container" id="verify-checkout-container">  <button style="display:block; float:right" onClick="print()">打印訂單</button>

  <h2><strong>請檢查您的訂單詳情，並選擇付款方式。</strong>  </h2>

  <!-- End head -->
  
   <!-- part1 -->
   <div class="checkout-instructions " style="height:70px;">
      <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
      	<h1 style=" margin:5px 5px;">訂單詳細信息</h1>
        </div>
        </div>
   <!-- End part1  -->  
   
   <!-- part2 subject-->
      
<div class="checkout-instructions col-lg-12 col-md-12 col-sm-12 col-xs-12">

<div class="checkout-tabletop checkout-cart-items">
<div class="checkout-li hidden-sm hidden-xs">
<div class="col-md-6">產品描述</div>
<div class="col-md-2 text-center">單價</div>
<div class="col-md-2 text-center">數量</div>
<div class="col-md-2 text-right">小計</div>
</div>
          
   <!--End part2 subject-->
   
    <!-- part3 cart-items-->
<script>
function amount1(id,value,price)
{
var xmlhttp1;
xmlhttp1=new XMLHttpRequest();
xmlhttp1.onreadystatechange=function()
  {
	if (xmlhttp1.readyState==4 && xmlhttp1.status==200)
    {
      if(xmlhttp1.responseText>0)
	  {
		  document.getElementsByName("pv5"+id)[0].value=xmlhttp1.responseText;
		  
		  var newamount=xmlhttp1.responseText-parseFloat(document.getElementById("pv6"+id).innerHTML);

		  document.getElementById("pv6"+id).innerHTML=xmlhttp1.responseText;
		  document.getElementById("pv7"+id).innerHTML=xmlhttp1.responseText*price;
		  
<?php
if($_POST["discount_rate"]==1)
{
  echo '
    document.getElementById("total2").innerHTML=(parseFloat(document.getElementById("total2").innerHTML)+newamount*price);
  ';
}
else
{
  echo '
    document.getElementById("original_subtotal").innerHTML = parseFloat(document.getElementById("original_subtotal").innerHTML + newamount * price;
    document.getElementById("total2").innerHTML=
    Math.round(
    (
    parseFloat(document.getElementById("original_subtotal").innerHTML)*parseFloat('.$_POST["discount_rate"].')
    )
    *10)/10;

    document.getElementById("discounted_amount1").innerHTML=
    Math.round(
    (
    parseFloat(document.getElementById("original_subtotal").innerHTML) - (parseFloat(document.getElementById("total2").innerHTML))
    )
    *10)/10;
  ';
}
?>

		  
		  if("<?php echo $_POST["delivery_methods"] ?>"=="順豐冷凍送遞服務")
		  {
			  if(parseFloat(document.getElementById("total2").innerHTML)<=800)
			  {
				  document.getElementById("subtotal2").innerHTML=parseFloat(document.getElementById("total2").innerHTML)+48;
				  document.getElementById("deliveryfee1").innerHTML=48;
			  }
			  else
			  {
				  document.getElementById("subtotal2").innerHTML=parseFloat(document.getElementById("total2").innerHTML)+0;
				  document.getElementById("deliveryfee1").innerHTML=0;
			  }
		  }
	  	  else
		  {
		  	  document.getElementById("subtotal2").innerHTML=parseFloat(document.getElementById("total2").innerHTML)+39;
		  }
		  
		  document.getElementsByName("total")[0].value=document.getElementById("subtotal2").innerHTML;
      }
else
{
		  alert("非法输入.");
	  }
    }  
  }
xmlhttp1.open("GET","includes/amount.php?id="+id+"&value="+value+"&username=<?php echo $_SESSION["username"] ?>",true);
xmlhttp1.send();
}
</script>

    <div class='cart-products'>
<?php 
$first_time = 0;
$subtotal = 0;
$bought_items = "";
$_SESSION["subtotal"]=0;
$_SESSION["bought_items"]="";

if($_POST["discount_rate"]==1){
	$query = "select * from cart where username='".mysqlSecurity($conn, $_SESSION['username'])."'";
	$result = mysqli_query($conn,$query);
	if (mysqli_num_rows($result) > 0) {
		echo "<div>";
		
		while($row = mysqli_fetch_assoc($result)) {
			echo "<div class='checkout-products'>";
			echo "<div class='checkout-prod-info prod-meta col-md-6' ng-class=".'"'."{ 'col-md-4': showPromotions, 'col-md-6': !showPromotions }".'"'.">";
			echo "<a href='' target='_blank' class='product-link'>";
			echo "<div class='checkout-img col-lg-2 col-md-2 col-sm-12 col-xs-12'>";
			echo "<img class='prod-thumbnail' src='".$row["image"]."'>";
			echo "</div>";
			echo "</a>";
			echo "<div class='checkout-img-info col-lg-10 col-md-10 col-sm-12 col-xs-12'>";         
			echo $row['product_name'];
			echo "<div ng-repeat='field in item.variation.fields' class='ng-scope'>";
			echo "<span class='variation ng-binding' id='pv6".$row["id"]."'>".$row["amount"]."</span><span class='variation ng-binding'>XHK$".$row["price"]." </spam>";
			echo "</div>";
			echo "</div>";
			echo "</div>";
			echo "<div style=' padding-top:10px; font-size:20px;' class='checkout-prod-info col-md-2 text-center-md  hidden-sm hidden-xs'>HK$".$row["price"]."</div>";
			
			echo "<!-- button -->";
			echo "<div class='checkout-prod-info col-md-2 text-center' style='padding-top:5px'>";      
			echo "<div class='info-input-group'>";
			echo "<div class='input-group-btn'>";
			echo "<input type='submit' value='-' class='btn btn-default btn-checkout' onClick='amount1(\"".$row["id"]."\",\"-\",".$row["price"].")' />";
			echo "</div>";
			echo "<input name='pv5".$row["id"]."' type='number' step='1' min='1' class='form-inline form-control-quantity ' value='".$row["amount"]."' onChange='amount1(".$row["id"].",this.value,".$row["price"].")'>";
			echo "<div class='input-group-btn'>";
			echo "<input type='submit' value='+' class='btn btn-default btn-checkout' onClick='amount1(".$row["id"].",\"%2b\",".$row["price"].")' />";
			echo "</div>";
			echo "</div>";
			echo "</div>";
			echo "<!--End  button -->";
			
			$price = $row["price"]*$row["amount"];
			
			echo "
			<div class='checkout-prod-info-r col-md-2 text-right'>
			HK$
			<span id='pv7".$row["id"]."'>".$price."</span>
			<br>
			<a style='font-size:15px' href='includes/add_cart.php?check=delete&name=".$row["product_name"]."&from=checkout'>移除&nbsp;&nbsp;</a>
			</div>";
			echo "</div>";
			$_SESSION["subtotal"] += $price;
			if($first_time==0)
			{
				$item_name = str_replace('<div class="Dark">','D.',$row['product_name']);
				$item_name = str_replace('<div class="White">','W.',$item_name);
				$item_name = str_replace('<div class="Pink">','P.',$item_name);
				$item_name = str_replace('<div class="Brown">','B.',$item_name);
				$item_name = str_replace('</div>','_',$item_name);
    			$item_name = htmlentities($item_name,ENT_QUOTES,"UTF-8");

				$bought_items = $item_name."*".$row["amount"];
				$first_time++;
			}
			else
			{
				$item_name = str_replace('<div class="Dark">','D.',$row['product_name']);
				$item_name = str_replace('<div class="White">','W.',$item_name);
				$item_name = str_replace('<div class="Pink">','P.',$item_name);
				$item_name = str_replace('<div class="Brown">','B.',$item_name);
				$item_name = str_replace('</div>','_',$item_name);
    			$item_name = htmlentities($item_name,ENT_QUOTES,"UTF-8");

				$bought_items = ",".$item_name."*".$row["amount"];
			}
			$_SESSION["bought_items"] .= $bought_items;
		}
		$_SESSION["Tsubtotal"]=round($_SESSION["subtotal"],1);
		if($_POST["delivery_methods"]=="順豐冷凍送遞服務"){
			if($_SESSION["Tsubtotal"]<=800){
				$_SESSION["subtotal"]=round($_SESSION["Tsubtotal"]+48,1);	
				$_SESSION["bought_items"] .= ",運費";
			}
		}
		else
		{
			$_SESSION["subtotal"]=round($_SESSION["Tsubtotal"]+39,1);
			$_SESSION["bought_items"] .= ",膠袋費";
		}
		echo "</div>";
	}
else
{
		echo "none";
	}
}
else
{
	$query = "select * from cart where username='".mysqlSecurity($conn, $_SESSION['username'])."'";
	$result = mysqli_query($conn,$query);
	if (mysqli_num_rows($result) > 0) {
		echo "<div>";
		
		while($row = mysqli_fetch_assoc($result)) {
			echo "<div class='checkout-products'>";
			echo "<div class='checkout-prod-info prod-meta col-md-6' ng-class=".'"'."{ 'col-md-4': showPromotions, 'col-md-6': !showPromotions }".'"'.">";
			echo "<a href='' target='_blank' class='product-link'>";
			echo "<div class='checkout-img col-lg-2 col-md-2 col-sm-12 col-xs-12'>";
			echo "<img class='prod-thumbnail' src='".$row["image"]."'>";
			echo "</div>";
			echo "</a>";
			echo "<div class='checkout-img-info col-lg-10 col-md-10 col-sm-12 col-xs-12'>";         
			echo $row['product_name'];
			echo "<div ng-repeat='field in item.variation.fields' class='ng-scope'>";
			echo "<span class='variation ng-binding' id='pv6".$row["id"]."'>".$row["amount"]."</span><span class='variation ng-binding'>XHK$".$row["original_price"]." </spam>";
			echo "</div>";
			echo "</div>";
			echo "</div>";
			echo "<div style=' padding-top:10px; font-size:20px;' class='checkout-prod-info col-md-2 text-center-md  hidden-sm hidden-xs'>HK$".$row["original_price"]."</div>";
			
			echo "<!-- button -->";
			echo "<div class='checkout-prod-info col-md-2 text-center' style='padding-top:5px'>";
			echo "<div class='info-input-group'>";
			echo "<div class='input-group-btn'>";
			echo "<input type='submit' value='-' class='btn btn-default btn-checkout' onClick='amount1(\"".$row["id"]."\",\"-\",".$row["original_price"].")' />";
			echo "</div>";
			echo "<input name='pv5".$row["id"]."' type='number' step='1' min='1' class='form-inline form-control-quantity ' value='".$row["amount"]."' onChange='amount1(".$row["id"].",this.value,".$row["original_price"].")'>";
			echo "<div class='input-group-btn'>";
			echo "<input type='submit' value='+' class='btn btn-default btn-checkout' onClick='amount1(".$row["id"].",\"%2b\",".$row["original_price"].")' />";
			echo "</div>";
			echo "</div>";
			echo "</div>";
			echo "<!--End  button -->";
			
			$price = $row["original_price"]*$row["amount"];
			
			echo "
			<div class='checkout-prod-info-r col-md-2 text-right'>
			HK$
			<span id='pv7".$row["id"]."'>".$price."</span>
			<br>
			<a style='font-size:15px' href='includes/add_cart.php?check=delete&name=".$row["product_name"]."&from=checkout'>移除&nbsp;&nbsp;</a>
			</div>";
			echo "</div>";
			$_SESSION["subtotal"] += $price;
			if($first_time==0)
			{
				$item_name = str_replace('<div class="Dark">','D.',$row['product_name']);
				$item_name = str_replace('<div class="White">','W.',$item_name);
				$item_name = str_replace('<div class="Pink">','P.',$item_name);
				$item_name = str_replace('<div class="Brown">','B.',$item_name);
				$item_name = str_replace('</div>','_',$item_name);
    			$item_name = htmlentities($item_name,ENT_QUOTES,"UTF-8");

				$bought_items = $item_name."*".$row["amount"];
				$first_time++;
			}
			else
			{
				$item_name = str_replace('<div class="Dark">','D.',$row['product_name']);
				$item_name = str_replace('<div class="White">','W.',$item_name);
				$item_name = str_replace('<div class="Pink">','P.',$item_name);
				$item_name = str_replace('<div class="Brown">','B.',$item_name);
				$item_name = str_replace('</div>','_',$item_name);
    			$item_name = htmlentities($item_name,ENT_QUOTES,"UTF-8");

				$bought_items = ",".$item_name."*".$row["amount"];
			}
			$_SESSION["bought_items"] .= $bought_items;
		}
		$_SESSION["original_subtotal"]=round($_SESSION["subtotal"],1);
		$_SESSION["Tsubtotal"]=round($_SESSION["subtotal"]*$_POST["discount_rate"],1);
		if($_POST["delivery_methods"]=="順豐冷凍送遞服務"){
			if($_SESSION["Tsubtotal"]<=800){
				$_SESSION["subtotal"]=round($_SESSION["Tsubtotal"]+48,1);	
				$_SESSION["bought_items"] .= ",運費";
			}
			else
			{
				$_SESSION["subtotal"]=round($_SESSION["subtotal"]*$_POST["discount_rate"],1);
			}
		}
		else
		{
			$_SESSION["subtotal"]=round($_SESSION["Tsubtotal"]+39,1);
			$_SESSION["bought_items"] .= ",膠袋費";
		}
		echo "</div>";
	}
	else
	{
		echo "空的購物車";
	}
}
?>
</div>
</div>      
</div>
      
      <!-- End part3 cart-items-->
      
      <!-- part4 Coupon Customer Info Place Order-->
      <div class="checkout-tablebottom col-lg-12 col-md-12 col-sm-12 col-xs-12" >
      <!-- part4.1 Coupon-->
      
         <!-- Nav tabs -->
      <!-- End part4.1 Coupon-->

  <!-- Tab panes -->
    
<form method="post" action="includes/paypal_checkout.php?Payment_Type=<?php if($_POST["payment_method"]=="bank"){echo "Bank_Transfer";}
else
{echo "paypal";} ?>">
    <div class="place-order col-lg-6 col-md-6 col-sm-12 col-xs-12" style="margin-top:0;    padding-left: 15px;padding-top: 5px;"> 

<?php 
if($_POST["discount_rate"]<1)
{
	echo '
	  <h2>贈卷代碼:</h2>
	  <input name="code" type="text" class="form-control" value="'.$_POST["code"].'" readonly="readonly" />
	';
} 
echo "
  <input name=\"discount_rate\" style=\"display:none\" value=\"".$_POST["discount_rate"]."\" />
  <input name=\"bought_items\" style=\"display:none\" value=\"".$_SESSION["bought_items"]."\" />
  <input name=\"total\" style=\"display:none\" value='".$_SESSION["subtotal"]."' />
  <input name=\"time\" style=\"display:none\" value='".date("Y-m-d H:i:s")."' />
";

echo "<input name='token' id='verify-token' type='hidden' value={$_POST['token']} >";

?>

<h2>訂單詳細信息：</h2>
			<strong>客戶名字</strong>
            <input class="form-control" placeholder="" type="text" name="customer_Fname" value="<?php echo $_POST["customer_Fname"];?>" required>
			
			<strong>客戶姓氏</strong>
            <input class="form-control" placeholder="" type="text" name="customer_Lname" value="<?php echo $_POST["customer_Lname"];?>" required>
            
            
            <strong>客戶電郵地址</strong> 
            <input class="form-control" style="text-align: center;" placeholder="" type="email" name="customer_email" value="<?php echo $_POST["customer_email"];?>" required>
            
            <strong>客戶電話號碼</strong> 
            <input class="form-control" placeholder="" type="text" name="customer_phone" value="<?php echo $_POST["customer_phone"];?>" required>
            
            <strong>帳單地址</strong>
            <textarea class="form-control" rows="2" name="customer_address" wrap='physical' required><?php 
			
			$address=preg_replace("<br>", '/\r\n/',($_POST["customer_address"]));
			echo $address; ?></textarea>
                 
            
            <strong>公司名稱</strong> 
            <input class="form-control" placeholder="" type="text" name="company_name" value="<?php echo $_POST["company_name"];?>" required>
            
            <h2>運送詳細信息：</h2> 
            
			<strong>收件人名字</strong>
            <input class="form-control" placeholder="" type="text" name="recipient_Fname" value="<?php echo $_POST["recipient_Fname"];?>"  required>
            
			<strong>收件人姓氏</strong>
            <input class="form-control" placeholder="" type="text" name="recipient_Lname" value="<?php echo $_POST["recipient_Lname"];?>" required>
			
            <strong>收件人電郵地址</strong>
            <input class="form-control" style="text-align: center;" placeholder="" name="email" value="<?php echo $_POST["email"];?>"  required>
            
            <strong>收件人電話號碼</strong>
            <input class="form-control" placeholder="" type="text" name="phone" value="<?php echo $_POST["phone"];?>" required>
            
<?php 
	if($_POST["delivery_time"]=="09:00 - 15:00")
	{
		$time_slot1="selected='selected'";
		$time_slot2="";
	}
	else
	{
		$time_slot1="";
		$time_slot2="selected='selected'";
	}
	
	if($_POST["delivery_methods"]=="順豐冷凍送遞服務")
	{
    	echo '
            <strong>取貨方式</strong>
			<br>
			<img src="../img/delivery_tc2.jpg" width="210px" height="50px" />
            <input style="display:none" type="text" name="delivery_methods" value="順豐冷凍送遞服務" required>
			
            <br>
			<strong>郵寄地址</strong>
            <textarea class="form-control" rows="2" name="address" wrap="physical" required>'.$_POST["address"].'</textarea>
                 
            <strong>收貨日期</strong>
            
			<input class="form-control" placeholder="請選擇運送日期" type="text" name="delivery_date" id="datepicker1"   value="'.$_POST["delivery_date"].'" required></input>  
            
            <strong>收貨時間</strong>
            
			<select class="form-control" name="delivery_time">
            <option value="09:00 - 15:00" '.$time_slot1.'>9:00AM - 3:00PM</option>
            <option value="13:00 - 19:00" '.$time_slot2.'>1:00PM - 7:00PM</option>
            </select>  
		';
	}
else
{
    	echo '
            <strong>取貨方式</strong>
			<br>
			<img src="../img/Selfpickup_tc2.jpg" width="210px" height="50px" />            
			<input style="display:none" type="text" name="delivery_methods" value="Self pick up" required>
			
            <textarea class="form-control" style="display:none" rows="2" name="address" wrap="physical" required>self pick up</textarea>
            
			<br>
            <strong>取貨日期</strong>
            
			<input class="form-control" placeholder="請選擇取貨日期" type="text" name="delivery_date" id="datepicker1"  value="'.$_POST["delivery_date"].'" required></input>  
            
			<input style="display:none" name="delivery_time" value="">
		';
	}
?>
            
            <strong>備註</strong>
            <textarea class="form-control" rows="4" name="remarks" placeholder="請輸入您的信息" wrap='physical'><?php echo $_POST["remarks"];?></textarea>
            </div>
            
            
            
     
    <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12" style="margin-top:0;padding-right:15px;padding-top: 5px;"><h2 align="right">訂單摘要</h2>
<?php 
if($_POST["discount_rate"]==1)
{
	echo '
      	<div class="row">
        	<div class="col-xs-4 col-sm-7" style="text-align:right"> 
   				 <div class="">小計:</div>
  			</div>
        	<div class="col-xs-8 col-sm-5" style="text-align:right">
   				 <span>HK$</span><span id="total2" class="" >';echo $_SESSION["Tsubtotal"];echo '</span>
 			</div>
        </div>
	';
				 
	if($_POST["delivery_methods"]=="順豐冷凍送遞服務")
	{
		if($_SESSION["Tsubtotal"]<=800)
		{
			echo'
				<div class="row">
					<div class="col-xs-4 col-sm-7" style="text-align:right"> 
						 <div>運費:</div>
					</div>
					<div class="col-xs-8 col-sm-5" style="text-align:right">
						 <span>HK$48</span>
					</div>
				</div>
			';
		}
		else
		{
			echo'
				<div class="row">
					<div class="col-xs-4 col-sm-7" style="text-align:right"> 
						 <div>運費:</div>
					</div>
					<div class="col-xs-8 col-sm-5" style="text-align:right">
						 <span>HK$0</span>
					</div>
				</div>
			';
		}
	}
	else
	{
		echo'
			<div class="row">
				<div class="col-xs-4 col-sm-7" style="text-align:right"> 
					 <div>膠袋費:</div>
				</div>
				<div class="col-xs-8 col-sm-5" style="text-align:right">
					 <span>HK$1</span>
				</div>
			</div>
		';
	}
	
	echo '
      	<div class="row">
        	<div class="col-xs-4 col-sm-7" style="text-align:right"> 
   				 <div class=""><strong>總計:</strong></div>
  			</div>
        	<div class="col-xs-8 col-sm-5" style="text-align:right">
   				 <span>HK$</span><strong><span id="subtotal2">';echo $_SESSION["subtotal"];echo '</span></strong>
 			</div>
        </div> 
	';
}
else
{
	echo '
      	<div class="row">
        	<div class="col-xs-4 col-sm-7" style="text-align:right"> 
   				 <div class="">原價小計:</div>
  			</div>
        	<div class="col-xs-8 col-sm-5" style="text-align:right">
   				 <span>HK$</span><span id="original_subtotal">';echo $_SESSION["original_subtotal"];echo '</span>
 			</div>
        </div>
        
      	<div class="row">
        	<div class="col-xs-4 col-sm-7" style="text-align:right"> 
   				 <div>折扣(%):</div>
  			</div>
        	<div class="col-xs-8 col-sm-5" style="text-align:right">
   				 <div>';echo 100-$_POST["discount_rate"]*100; echo '%</div>
 			</div>
        </div>   
        
        <div class="row">
        	<div class="col-xs-4 col-sm-7" style="text-align:right"> 
   				 <div>折扣價格:</div>
  			</div>
        	<div class="col-xs-8 col-sm-5" style="text-align:right">
   				 <span>HK$</span><span id="discounted_amount1" class="" >';echo $_SESSION["original_subtotal"]-$_SESSION["Tsubtotal"];echo '</span>
 			</div>
        </div>   
        
        <div class="row">
        	<div class="col-xs-4 col-sm-7" style="text-align:right"> 
   				 <div>折後小計:</div>
  			</div>
        	<div class="col-xs-8 col-sm-5" style="text-align:right">
   				 <span>HK$</span><span id="total2" class="" >';echo $_SESSION["Tsubtotal"];echo '</span>
 			</div>
        </div>   
	';
				 
	if($_POST["delivery_methods"]=="順豐冷凍送遞服務")
	{
		if($_SESSION["Tsubtotal"]<=800)
		{
			echo'
				<div class="row">
					<div class="col-xs-4 col-sm-7" style="text-align:right"> 
						 <div>運費:</div>
					</div>
					<div class="col-xs-8 col-sm-5" style="text-align:right">
						 <span>HK$48</span>
					</div>
				</div>
			';
		}
		else
		{
			echo'
				<div class="row">
					<div class="col-xs-4 col-sm-7" style="text-align:right"> 
						 <div>運費:</div>
					</div>
					<div class="col-xs-8 col-sm-5" style="text-align:right">
						 <span>HK$0</span>
					</div>
				</div>
			';
		}
	}
	else
	{
		echo'
			<div class="row">
				<div class="col-xs-4 col-sm-7" style="text-align:right"> 
					 <div>膠袋費:</div>
				</div>
				<div class="col-xs-8 col-sm-5" style="text-align:right">
					 <span>HK$1</span>
				</div>
			</div>
		';
	}
	
	echo '
      	<div class="row">
        	<div class="col-xs-4 col-sm-7" style="text-align:right"> 
   				 <div class=""><strong>總計:</strong></div>
  			</div>
        	<div class="col-xs-8 col-sm-5" style="text-align:right">
   				 <span>HK$</span><strong><span id="subtotal2">';echo $_SESSION["subtotal"];echo '</span></strong>
 			</div>
        </div> 
	';
}
?>

<h2 align="middle">付款方式</h2>
<?php
if($_POST["payment_method"]=="bank"){
echo '<img src="../img/pic2a.jpg" width="260px" height="60px">
<p style="color:rgba(107,180,211,1.00)">若閣下以銀行入數，請把款項存入下面的銀行帳號</p>
<p style="color:rgba(107,180,211,1.00)">(只適用於港幣) </p>
<p style="color:rgba(230,149,148,1.00)">帳戶名稱：Patisserie Sayvour Limited</p>
<p style="color:rgba(230,149,148,1.00)">銀行名稱：香港上海匯豐銀行</p>
<p style="color:rgba(230,149,148,1.00)">帳戶號碼：023-462187-838</p>
<p style="color:rgba(230,149,148,1.00)">銀行國際代碼：HSBCHKHHHKH</p>
<p style="color:rgba(230,149,148,1.00)">銀行地址：香港中區皇后大道中1號</p>
<br>
<div class="controls input-group">
	<div class="g-recaptcha" data-sitekey="6LenKhYUAAAAAIwseMuOsziCxRQ5bxg5-gals1Cv"></div>
</div>
<input class="btn btn-place-order" type="submit" name="submit" value="Confirm Order">';
}
else
{
echo '<img src="../img/pic4a.jpg" width="260px" height="60px">
<p style="color:rgba(107,180,211,1.00)">一般買家用信用卡付款。</p>
<p style="color:rgba(107,180,211,1.00)">擁有PayPal帳戶，可以帳戶支付。</p>
<div class="controls input-group">
	<div class="g-recaptcha" data-sitekey="6LenKhYUAAAAAIwseMuOsziCxRQ5bxg5-gals1Cv"></div>
</div>
	<br>
	<input class="btn btn-place-order" type="submit" name="submit" value="確認訂單">';
}
?>
</div>
</form> 
</div>
</div>


<!-- End part4 Coupon Customer Info Place Order-->

<script>
(function passingTokenCheck(){
	var passingToken = document.querySelector('#verify-token').value,
	container = document.querySelector('#verify-checkout-container'),
	header = document.createElement('h2');
	header.innerText = '購物車驗證內容遺失，請返回結帳頁面重新確認本次購物。';

	if(passingToken === ''){
		container.innerHTML = '';
		container.appendChild(header);
	}
})();
</script>
     
  </body>
</html>