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.
 
 
 
 
 
 

69 lines
2.3 KiB

<?php
$contractno= "";
$facilityno= "";
$combono= "";
$repairerid= "";
$repairername= "";
$duedate= "";
/*
$actualdate= "";
$item= "";
$item_detai= "";
$result= "";
#$evidences= "";
$descriptons= "";
$customer_login_id= "";
$customer_login_name= "";
$stars= "";
$details= "";
$customer_signature= "";
*/
$creater= "";
$create_at= "";
$contractno_error= "";
$facilityno_error= "";
$combono_error= "";
$repairerid_error= "";
$repairername_error= "";
$duedate_error= "";
/*
$actualdate_error= "";
$item_error= "";
$item_detai_error= "";
$result_error= "";
#$evidences_error= "";
$descriptons_error= "";
$customer_login_id_error= "";
$customer_login_name_error= "";
$stars_error= "";
$details_error= "";
$customer_signature_error= "";
*/
$creater_error = "";
$create_at_error = "";
if($_SERVER["REQUEST_METHOD"] == "POST"){
include "schedule-user-input.php";
#$db_query = "INSERT INTO schedule(contractno, facilityno, combono, repairerid, repairername, duedate, actualdate, item, item_detail, result, descriptons, customer_login_id, customer_login_name, stars, details, customer_signature, creater, create_at) VALUES ('$contractno', '$facilityno', '$combono', '$repairerid', '$repairername', '$duedate', '$actualdate', '$item', '$item_detail', '$result', '$descriptons', '$customer_login_id', '$customer_login_name', '$stars', '$details', '$customer_signature', '$creater', '$create_at')";
$db_query = "INSERT INTO schedule(contractno, facilityno, combono, repairerid, repairername, duedate, creater, create_at) VALUES ('$contractno', '$facilityno', '$combono', '$repairerid', '$repairername', '$duedate', '$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='schedule-index.php?function_name=schedule&".$token_link."';";
echo "</script>";
} elseif ($affected == 0) {
echo "<script type ='text/JavaScript'>";
echo "alert('無新增資料');";
echo "location.href='schedule-index.php?function_name=schedule&".$token_link."';";
echo "</script>";
} else {
echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link);
}
}
?>