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.
38 lines
1.3 KiB
38 lines
1.3 KiB
<?php
|
|
$deliver_no= "";
|
|
$issue_time= "";
|
|
$location= "";
|
|
$memo= "";
|
|
$creater= "";
|
|
$create_at= "";
|
|
|
|
$deliver_no_error= "";
|
|
$issue_time_error= "";
|
|
$location_error= "";
|
|
$memo_error= "";
|
|
$creater_error = "";
|
|
$create_at_error = "";
|
|
|
|
|
|
if($_SERVER["REQUEST_METHOD"] == "POST"){
|
|
include "delivery_log-user-input.php";
|
|
|
|
$db_query = "INSERT INTO delivery_log(deliver_no, issue_time, location, memo,creater,create_at) VALUES ('$deliver_no', '$issue_time', '$location', '$memo','$creater', '$create_at')";
|
|
$result = mysqli_query($link,$db_query);
|
|
$affected = mysqli_affected_rows($link);
|
|
mysqli_close($link);
|
|
if ($affected > 0) {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('新增成功');";
|
|
echo "location.href='delivery_log-index.php?function_name=delivery_log&".$token_link."';";
|
|
echo "</script>";
|
|
} elseif ($affected == 0) {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('無新增資料');";
|
|
echo "location.href='delivery_log-index.php?function_name=delivery_log&".$token_link."';";
|
|
echo "</script>";
|
|
} else {
|
|
echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link);
|
|
}
|
|
}
|
|
?>
|
|
|