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.
62 lines
2.7 KiB
62 lines
2.7 KiB
<?php
|
|
include "header.php";
|
|
|
|
if(isset($_POST['update'])) {
|
|
function user_input( $data ) {
|
|
$data1 = trim($data);
|
|
$data2 = stripslashes($data1);
|
|
$data3 = htmlspecialchars($data2);
|
|
return $data3;
|
|
}
|
|
|
|
$id = $_POST['id'];
|
|
$contractno = user_input($_POST["contractno"]);
|
|
$facilityno = user_input($_POST["facilityno"]);
|
|
$combono = user_input($_POST["combono"]);
|
|
$repairerid = user_input($_POST["repairerid"]);
|
|
$repairername = user_input($_POST["repairername"]);
|
|
$duedate = user_input($_POST["duedate"]);
|
|
|
|
$actualdate = user_input($_POST["actualdate"]);
|
|
$item = user_input($_POST["item"]);
|
|
$item_detail = user_input($_POST["item_detail"]);
|
|
$result = user_input($_POST["result"]);
|
|
#$evidences = user_input($_POST["evidences"]);
|
|
$descriptons = user_input($_POST["descriptons"]);
|
|
$customer_login_id = user_input($_POST["customer_login_id"]);
|
|
$customer_login_name = user_input($_POST["customer_login_name"]);
|
|
$stars = user_input($_POST["stars"]);
|
|
$stars2 = user_input($_POST["stars2"]);
|
|
$details = user_input($_POST["details"]);
|
|
//$customer_signature = user_input($_POST["customer_signature"]);
|
|
|
|
$creater = user_input($_POST["creater"]);
|
|
$create_at = date('Y/m/d H:i:s');
|
|
|
|
$db_query = "UPDATE schedule set contractno = '$contractno',
|
|
facilityno = '$facilityno', combono = '$combono',
|
|
repairerid = '$repairerid', repairername = '$repairername',
|
|
duedate = '$duedate', actualdate = '$actualdate',
|
|
item = '$item', item_detail = '$item_detail',
|
|
result = '$result', descriptons = '$descriptons',
|
|
customer_login_id = '$customer_login_id', customer_login_name = '$customer_login_name',
|
|
stars_c1 = '$stars', stars_c2 = '$stars2', details = '$details',
|
|
create_at = '$create_at' WHERE id='$id'";
|
|
mysqli_query($link, $db_query);
|
|
$affected = mysqli_affected_rows($link);
|
|
mysqli_close($link);
|
|
if ($affected > 0) {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('update成功');";
|
|
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);
|
|
}
|
|
}
|
|
?>
|