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.
151 lines
4.2 KiB
151 lines
4.2 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 ----*/
|
|
|
|
|
|
#產生deliver_no, 存入prelog, 將相關金額數據存入delivery_info, delivery_log(總倉;發運確認中)
|
|
#$userid = "B000000001";
|
|
#$order_id = $_POST["order_id"];
|
|
|
|
#echo "user_id: " . $user_id;
|
|
#echo "token_code:" . $token_code;
|
|
#echo "token_message:" . $token_message;
|
|
|
|
require_once "db/database.php"; # 載入db.php來連結資料庫
|
|
|
|
# 產生deliver_no
|
|
$data = array();
|
|
$sql = "select max(id) from delivery_info";
|
|
$data = mysqli_query($link,$sql);
|
|
foreach($data as $data){
|
|
$id = $data['max(id)'];
|
|
}
|
|
$deliver_no = "DE_" . date("Y-m-d") . "-" . strval(intval(strval($id)) + 1);
|
|
|
|
#將deliver_no存入pre_order
|
|
$status = "P";
|
|
foreach ($_POST as $key => $value){
|
|
if(strpos(htmlspecialchars($key),"order_id") !== false){
|
|
#echo "包含" . "<br>";
|
|
#echo "key:" . htmlspecialchars($key) . "vale:" . htmlspecialchars($value). "<br>";
|
|
#echo $deliver_no . "<br>";
|
|
#echo $status . "<br>";
|
|
#echo htmlspecialchars($value) . "<br>";
|
|
$order_id = htmlspecialchars($value);
|
|
$sql = "UPDATE pre_order set deliver_no = '$deliver_no', status = '$status' WHERE order_id = '$order_id'";
|
|
#echo $sql . "<br>";
|
|
mysqli_query($link, $sql);
|
|
}
|
|
}
|
|
|
|
#將相關金額數據存入delivery_info
|
|
$data = array();
|
|
$sql = "select name from account where accountid = '$user_id'";
|
|
$data = mysqli_query($link,$sql);
|
|
foreach($data as $data){
|
|
$orderer_name = $data['name'];
|
|
#$echo $orderer_name;
|
|
}
|
|
$total_price_equipments = $_POST["total_price_equipments"];
|
|
$delivery_fee = $_POST["delivery_fee"];
|
|
$tax_fee = $_POST["tax_fee"];
|
|
$summation = $_POST["summation"];
|
|
$contact_person = $_POST["contact_person"];
|
|
$tel = $_POST["tel"];
|
|
$address = $_POST["address"];
|
|
$create_at = date("Y-m-d H:i:s");
|
|
|
|
$sql = "INSERT INTO delivery_info (deliver_no, orderer_id, orderer_name, contact_person, tel, address, total_price_equipments, delivery_fee, tax_fee, summation, create_at) values " .
|
|
"('$deliver_no', '$user_id', '$orderer_name', '$contact_person', '$tel', '$address', '$total_price_equipments', '$delivery_fee', '$tax_fee', '$summation', '$create_at')";
|
|
mysqli_query($link,$sql);
|
|
|
|
#將相關金額數據存入delivery_log
|
|
$location = "總倉";
|
|
$memo = "總倉確認中";
|
|
$creater = "system";
|
|
$issue_time = date("Y-m-d H:i:s");
|
|
$sql = "INSERT INTO delivery_log (deliver_no, issue_time, location, memo, creater) values " .
|
|
"('$deliver_no', '$issue_time', '$location', '$memo', '$creater')";
|
|
mysqli_query($link,$sql);
|
|
|
|
|
|
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"><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>
|