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.
59 lines
1.9 KiB
59 lines
1.9 KiB
<?php
|
|
$contractno= "";
|
|
$facilityno= "";
|
|
$customerid= "";
|
|
$weight= "";
|
|
$numberofstop= "";
|
|
$numberoffloor= "";
|
|
$opentype= "";
|
|
$speed= "";
|
|
$repairtype= "";
|
|
$longitude= "";
|
|
$latitude= "";
|
|
$address= "";
|
|
$repairerid= "";
|
|
$repairername= "";
|
|
$creater= "";
|
|
$create_at= "";
|
|
|
|
$contractno_error= "";
|
|
$facilityno_error= "";
|
|
$customerid_error= "";
|
|
$weight_error= "";
|
|
$numberofstop_error= "";
|
|
$numberoffloor_error= "";
|
|
$opentype_error= "";
|
|
$speed_error= "";
|
|
$repairtype_error= "";
|
|
$longitude_error= "";
|
|
$latitude_error= "";
|
|
$address_error= "";
|
|
$repairerid_error= "";
|
|
$repairername_error= "";
|
|
$creater_error = "";
|
|
$create_at_error = "";
|
|
|
|
|
|
if($_SERVER["REQUEST_METHOD"] == "POST"){
|
|
include "facility-user-input.php";
|
|
|
|
$db_query = "INSERT INTO facility(contractno, facilityno, customerid, weight,numberofstop, numberoffloor,opentype,speed,repairtype,longitude, latitude, address,repairerid,repairername,creater, create_at) VALUES ('$contractno', '$facilityno', '$customerid', '$weight','$numberofstop', '$numberoffloor','$opentype','$speed','$repairtype','$longitude', '$latitude', '$address','$repairerid','$repairername','$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='facility-index.php?function_name=facility&".$token_link."';";
|
|
echo "</script>";
|
|
} elseif ($affected == 0) {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('無新增資料');";
|
|
echo "location.href='facility-index.php?function_name=facility&".$token_link."';";
|
|
echo "</script>";
|
|
} else {
|
|
echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link);
|
|
}
|
|
}
|
|
?>
|
|
|