You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
202 lines
6.8 KiB
202 lines
6.8 KiB
<!doctype html>
|
|
<html lang="en">
|
|
|
|
<!-- 主頁header -->
|
|
<?php
|
|
|
|
/*--- 處理session ----*/
|
|
include "include-session-security.php"; #確認session
|
|
#echo $token;
|
|
#$userid = "B000000001";
|
|
require_once "db/database.php"; # 載入db.php來連結資料庫
|
|
$data = array(); # 設置一個空陣列來放資料is
|
|
$sql = "SELECT * FROM pre_order where ((orderer_id = '$user_id') and (status='C'))"; # sql語法存在變數中
|
|
$data = mysqli_query($link,$sql); # 用mysqli_query方法執行(sql語法)將結果存在變數中
|
|
|
|
include "include-header.php";
|
|
?>
|
|
<!-- * 主頁header -->
|
|
|
|
<body>
|
|
|
|
<!-- loader -->
|
|
<div id="loader">
|
|
<div class="spinner-border text-primary" role="status"></div>
|
|
</div>
|
|
<!-- * loader -->
|
|
|
|
<!-- App Header -->
|
|
<div class="appHeader bg-primary text-light">
|
|
<div class="left">
|
|
<a href="javascript:;" class="headerButton goBack">
|
|
<ion-icon name="chevron-back-outline"></ion-icon>
|
|
</a>
|
|
</div>
|
|
<div class="right">
|
|
<a href="app-products.php?token=<?php echo $token; ?>" class="headerButton">
|
|
<ion-icon name="book-outline"></ion-icon>
|
|
</a>
|
|
</div>
|
|
<div class="pageTitle">購物車</div>
|
|
<!--
|
|
<div class="right">
|
|
</div>
|
|
-->
|
|
</div>
|
|
<!-- * App Header -->
|
|
|
|
<!-- Dialog Clear
|
|
<div class="modal fade dialogbox" id="DialogClear" data-backdrop="static" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">清空購物車</h5>
|
|
</div>
|
|
<div class="modal-body">
|
|
清除所有清單!
|
|
</div>
|
|
<div class="modal-footer">
|
|
<div class="btn-inline">
|
|
<a href="#" class="btn btn-text-secondary" data-dismiss="modal">關閉</a>
|
|
<a href="#" class="btn btn-text-primary" data-dismiss="modal">清除</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
Dialog Clear -->
|
|
|
|
<!-- App Capsule -->
|
|
<div id="appCapsule">
|
|
<form action="app-productscart-save.php" method="POST">
|
|
<div class="section mt-2">
|
|
<!-- item -->
|
|
<?php
|
|
$total_price_equipments = 0.0;
|
|
$j = 0;
|
|
$count = 0;
|
|
foreach($data as $data){
|
|
$j= $j + 1;
|
|
$count += $data['quantity'];
|
|
?>
|
|
<div class="card cart-item mb-2">
|
|
<div class="card-body">
|
|
<div class="in">
|
|
<!-- 要隱藏攜帶的數據 -->
|
|
<input type="hidden" name="order_id-<?php echo $j; ?>" value="<?php echo $data['order_id']; ?>">
|
|
<!-- 要隱藏攜帶的數據 -->
|
|
<img src="../wms/<?php echo $data['picture']; ?>" alt="product" class="imaged">
|
|
<div class="text">
|
|
<h3 class="title"><?php echo $data['equipment_name']; ?></h3>
|
|
<p class="detail"><a><?php echo $data['brand']; ?></a> <a><?php echo $data['spec']; ?><a/></p>
|
|
<!-- <p class="detail">
|
|
<a>單價: $ <?php echo number_format($data['price'],2,'.',','); ?><a/>
|
|
</p> -->
|
|
<!-- <p class="detail">
|
|
<a>數量(<?php echo $data['count_type']; ?>) : <?php echo $data['quantity']; ?><a/>
|
|
</p> -->
|
|
<!-- <strong class="price">
|
|
<a>小計: $ <?php echo number_format($data['total_price'],2,'.',','); ?><a/>
|
|
</strong> -->
|
|
<strong class="price">
|
|
<a>數量(<?php echo $data['count_type']; ?>) : <?php echo $data['quantity']; ?><a/>
|
|
</strong>
|
|
</div>
|
|
</div>
|
|
<div class="cart-item-footer">
|
|
<!--
|
|
<div class="stepper stepper-sm stepper-secondary">
|
|
<a href="#" class="stepper-button stepper-down">-</a>
|
|
<input type="text" class="form-control" value="4" disabled />
|
|
<a href="#" class="stepper-button stepper-up">+</a>
|
|
</div>
|
|
-->
|
|
<a href="app-productscart-delete.php?action=delete&order_id=<?php echo $data['order_id']; ?>&token=<?php echo $token; ?>" class="btn btn-outline-secondary btn-sm">清除</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
$total_price_equipments = $total_price_equipments + $data['total_price'];
|
|
}
|
|
?>
|
|
<!-- * item -->
|
|
</div>
|
|
|
|
<div class="section mt-2 mb-2">
|
|
<div class="card">
|
|
<ul class="listview flush transparent simple-listview">
|
|
<?php
|
|
$delivery_fee = $total_price_equipments * 0.05;
|
|
$tax_fee = $total_price_equipments * 0.1;
|
|
$summation = $total_price_equipments + $delivery_fee + $tax_fee;
|
|
?>
|
|
<!-- <li>小計 <span class="text-muted">$ <?php echo number_format($total_price_equipments,2,'.',','); ?></span></li>
|
|
<li>運費 (5%) <span class="text-muted">$ <?php echo number_format($delivery_fee,2,'.',','); ?></span></li>
|
|
<li>稅 (10%)<span class="text-muted">$ <?php echo number_format($tax_fee,2,'.',','); ?></span></li> -->
|
|
<!-- <li>Total<span class="text-primary font-weight-bold">$ <?php echo number_format($summation,2,'.',','); ?></span></li> -->
|
|
<li>Total<span class="text-primary font-weight-bold"> <strong> <?php echo $count; ?> </strong> 件</span></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 要隱藏攜帶的數據 -->
|
|
<input type="hidden" name="total_price_equipments" value="<?php echo $total_price_equipments; ?>">
|
|
<input type="hidden" name="delivery_fee" value="<?php echo $delivery_fee; ?>">
|
|
<input type="hidden" name="tax_fee" value="<?php echo $tax_fee; ?>">
|
|
<input type="hidden" name="summation" value="<?php echo $summation; ?>">
|
|
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
|
<!-- 要隱藏攜帶的數據 -->
|
|
|
|
<div class="section mt-2 mb-2">
|
|
<div class="card">
|
|
<input type="text" class="form-control" name="contact_person" placeholder="收件連絡人">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section mt-2 mb-2">
|
|
<div class="card">
|
|
<input type="text" class="form-control" name="tel" placeholder="連繫手機號">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section mt-2 mb-2">
|
|
<div class="card">
|
|
<input type="text" class="form-control" name="address" placeholder="收件地址">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section mt-2 mb-2">
|
|
<div class="card">
|
|
<button class="btn btn-primary btn-lg btn-block">
|
|
確定
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
<!-- * App Capsule -->
|
|
|
|
<!-- 主頁頁尾 -->
|
|
<?php
|
|
include "include-footer.php";
|
|
mysqli_close($link); #代表結束連線
|
|
?>
|
|
<!-- * 主頁頁尾 -->
|
|
|
|
<!-- 主頁頁尾按鈕 -->
|
|
<?php
|
|
# include "include-bottom-menu.php";
|
|
?>
|
|
<!-- * 主頁頁尾按鈕 -->
|
|
|
|
<!-- ///////////// Js Files //////////////////// -->
|
|
<!-- Jquery -->
|
|
<?php
|
|
include "include-jsfiles.php";
|
|
?>
|
|
|
|
</body>
|
|
|
|
</html>
|