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.4 KiB

<?php
$contractno= "";
$customerid= "";
$facilityno= "";
$walking_hours= "";
$walking_times= "";
$create_at= "";
$contractno_error= "";
$customerid_error= "";
$facilityno_error= "";
$walking_hours_error= "";
$walking_times_error= "";
$create_at_error = "";
if($_SERVER["REQUEST_METHOD"] == "POST"){
include "facility_current_status-user-input.php";
$db_query = "INSERT INTO facility_current_status(contractno, customerid, facilityno, walking_hours,walking_times,create_at) VALUES ('$contractno', '$customerid', '$facilityno', '$walking_hours','$walking_times','$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='facility_current_status-index.php?function_name=facility_current_sta&".$token_link."';";
echo "</script>";
} elseif ($affected == 0) {
echo "<script type ='text/JavaScript'>";
echo "alert('無新增資料');";
echo "location.href='facility_current_status-index.php?function_name=facility_current_sta&".$token_link."';";
echo "</script>";
} else {
echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link);
}
}
?>