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.
112 lines
2.7 KiB
112 lines
2.7 KiB
<!doctype html>
|
|
<html lang="en">
|
|
|
|
<!-- 主頁header -->
|
|
<?php
|
|
|
|
/*--- 處理session ----*/
|
|
include "include-session-security.php"; #確認session
|
|
/*
|
|
if(isset($_SESSION['user_id'])){
|
|
#echo $_SESSION['user_id'];
|
|
$userid = $_SESSION['user_id'];
|
|
}
|
|
*/
|
|
/*--- 處理session ----*/
|
|
|
|
#$userid = "B000000001";
|
|
$action = $_REQUEST["action"];
|
|
$order_id = $_REQUEST["order_id"];
|
|
|
|
require_once "db/database.php"; # 載入db.php來連結資料庫
|
|
|
|
# 刪除order資料
|
|
$sql = "delete from pre_order where order_id = '$order_id'";
|
|
mysqli_query($link,$sql);
|
|
|
|
$data = array(); # 設置一個空陣列來放資料is
|
|
$sql = "SELECT count(*) as count FROM pre_order where ((orderer_id = '$user_id') and (status = 'C'))"; # sql語法存在變數中
|
|
$data = mysqli_query($link,$sql); # 用mysqli_query方法執行(sql語法)將結果存在變數中
|
|
foreach($data as $data){
|
|
$count = $data['count'];
|
|
}
|
|
# echo $count;
|
|
|
|
# 如果per_order中還有status為'C'(carts (存入購物車))的資料,則跳回購物車
|
|
if ($count > 0){
|
|
#header("Location:" . "app-productscart.php?token='$token'");
|
|
header("Location:app-productscart.php?token=".$token);
|
|
exit();
|
|
}
|
|
|
|
|
|
include "include-header.php";
|
|
?>
|
|
<!-- * 主頁header -->
|
|
|
|
<body class="bg-white">
|
|
|
|
<!-- loader -->
|
|
<div id="loader">
|
|
<div class="spinner-border text-primary" role="status"></div>
|
|
</div>
|
|
<!-- * loader -->
|
|
|
|
<!-- App Header -->
|
|
<div class="appHeader no-border transparent position-absolute">
|
|
<!-- 已簽呈成功,不讓返回上一頁
|
|
<div class="left">
|
|
<a href="javascript:;" class="headerButton goBack">
|
|
<ion-icon name="chevron-back-outline"></ion-icon>
|
|
</a>
|
|
</div>
|
|
-->
|
|
<div class="pageTitle"></div>
|
|
<!--
|
|
<div class="right">
|
|
</div>
|
|
-->
|
|
</div>
|
|
<!-- * App Header -->
|
|
|
|
<!-- App Capsule -->
|
|
<div id="appCapsule">
|
|
<div class='alert alert-primary alert-dismissible fade show' role='alert'>
|
|
<h4 class="alert-title">購物車已清空!</h4>
|
|
<button type="button" class="close" data-dismiss="alert">
|
|
<ion-icon name="close-outline"></ion-icon>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="login-form">
|
|
<div class="section">
|
|
<h4></h4>
|
|
<a href="app-products.php?token=<?php echo $token; ?>"><button type="button" class="btn btn-success mr-1 mb-1">回到備品總類</button></a>
|
|
</div>
|
|
</div>
|
|
|
|
</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>
|