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.
48 lines
1.6 KiB
48 lines
1.6 KiB
<?php
|
|
$contractno= "";
|
|
$facilityno= "";
|
|
$receivable_date= "";
|
|
$actual_date= "";
|
|
$receivable= "";
|
|
$actual= "";
|
|
$currency= "";
|
|
$owner= "";
|
|
$status= "";
|
|
$note= "";
|
|
|
|
$contractno_error= "";
|
|
$facilityno_error= "";
|
|
$receivable_date_error= "";
|
|
$actual_date_error= "";
|
|
$receivable_error= "";
|
|
$actual_error= "";
|
|
$currency_error= "";
|
|
$owner_error= "";
|
|
$status_error= "";
|
|
$note_error= "";
|
|
$creater_error = "";
|
|
$create_at_error = "";
|
|
|
|
|
|
if($_SERVER["REQUEST_METHOD"] == "POST"){
|
|
include "receivable-user-input.php";
|
|
|
|
$db_query = "INSERT INTO receivable(contractno, facilityno, receivable_date, actual_date, receivable, actual, currency, owner, status, note, creater, create_at) VALUES ('$contractno', '$facilityno', '$receivable_date', '$actual_date', '$receivable', '$actual', '$currency', '$owner', '$status', '$note', '$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='receivable-index.php?function_name=receivable&".$token_link."';";
|
|
echo "</script>";
|
|
} elseif ($affected == 0) {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('無新增資料');";
|
|
echo "location.href='receivable-index.php?function_name=receivable&".$token_link."';";
|
|
echo "</script>";
|
|
} else {
|
|
echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link);
|
|
}
|
|
}
|
|
?>
|
|
|