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
3.1 KiB

<?php
require_once "database.php";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
foreach ($_POST as $k => $v) {
$$k = htmlspecialchars(stripslashes(trim($v)));
}
$account=$_POST['account'];
$facilityno=$_POST['facilityno'];
$sitename=$_POST['sitename'];
$caller=$_POST['caller'];
$customerconfirmationbar=$_POST['customerconfirmationbar'];
$address=$_POST['address'];
$buildingnumber=$_POST['buildingnumber'];
$positionnumber=$_POST['positionnumber'];
$maintenanceoperationcategory=$_POST['maintenanceoperationcategory'];
$brandmodel=$_POST['brandmodel'];
$faultstate=$_POST['faultstate'];
$investigationprocess=$_POST['investigationprocess'];
$causeanalysis=$_POST['causeanalysis'];
$processingprocess=$_POST['processingprocess'];
$calltime=$_POST['calltime'];
$arrivaltime=$_POST['arrivaltime'];
$completiontime=$_POST['completiontime'];
$returntime=$_POST['returntime'];
$handlestaff=$_POST['handlestaff'];
$supportstaff=$_POST['supportstaff'];
$supporttime=$_POST['supporttime'];
$faultcode=$_POST['faultcode'];
$remarks=$_POST['remarks'];
$operationstaff=$account;
$filingstaff=$_POST['filingstaff'];
$supervisor= $_POST['supervisor'];
$creater = $_POST['creater'];
$create_at = date('Y/m/d H:i:s');
$updatee_at=date('Y/m/d H:i:s');
$db_query = "insert into fault_notification_job_handling(facilityno,sitename,caller,customerconfirmationbar,address";
$db_query .= ",buildingnumber,positionnumber,maintenanceoperationcategory,brandmodel,faultstate,investigationprocess";
$db_query .= ",causeanalysis,processingprocess,calltime,arrivaltime,completiontime,returntime";
$db_query .= ",handlestaff,supportstaff,supporttime,faultcode,remarks,operationstaff,filingstaff";
$db_query .= ",supervisor,creater,create_at,updatee_at) values (";
$db_query .= "'$facilityno', '$sitename', '$caller', '$customerconfirmationbar', '$address', '$buildingnumber',";
$db_query .= "'$positionnumber', '$maintenanceoperationcategory', '$brandmodel', '$faultstate','$investigationprocess',";
$db_query .= "'$causeanalysis','$processingprocess','$calltime','$arrivaltime','$completiontime','$returntime',";
$db_query .= "'$handlestaff','$supportstaff','$supporttime','$faultcode','$remarks','$operationstaff','$filingstaff',";
$db_query .= "'$supervisor','$creater','$create_at','$updatee_at')";
$result = mysqli_query($link, $db_query);
if ($mid = mysqli_insert_id($link)) {
header("Location: faultreview-index.php?account=".$account);
if (mysqli_affected_rows($link) > 0) {
echo "<script type ='text/JavaScript'>";
echo "alert('新增成功')";
echo "</script>";
//header("Location: pricereview-index.php");
} else {
echo "<script type ='text/JavaScript'>";
echo "alert('新增失敗,請重新操作[I]')";
echo "</script>";
}
} else {
echo "<script type ='text/JavaScript'>";
echo "alert('新增失敗,請重新操作[M]')";
echo "</script>";
}
mysqli_close($link);
}
?>