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.5 KiB
62 lines
2.5 KiB
<?php
|
|
require_once "database.php";
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
|
|
foreach ($_POST as $k => $v) {
|
|
$$k = htmlspecialchars(stripslashes(trim($v)));
|
|
}
|
|
|
|
$facilityno=$_POST['facilityno'];
|
|
$maintance_contract_id=$_POST['maintance_contract_id'];
|
|
$brand=$_POST['brand'];
|
|
$type=$_POST['type'];
|
|
$speed=$_POST['speed'];
|
|
$weight=$_POST['weight'];
|
|
$usednature=$_POST['usednature'];
|
|
$usedage=$_POST['usedage'];
|
|
$numberoffloor=$_POST['numberoffloor'];
|
|
$numberofstop=$_POST['numberofstop'];
|
|
$numberofdoor=$_POST['numberofdoor'];
|
|
$tai_count=$_POST['tai_count'];
|
|
|
|
$yearlyinspectiondate=$_POST['yearlyinspectiondate'];//年檢日期
|
|
$standardprice=$_POST['standardprice'];//標準價
|
|
$discusspricing=$_POST['discusspricing'];//議定價
|
|
$calibrationfee=$_POST['calibrationfee'];//校驗費
|
|
$yearlyinspectionfee=$_POST['yearlyinspectionfee']; //年檢費
|
|
$sumfee= $_POST['sumfee'];//小計
|
|
$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 maintance_contract_detail(facilityno,maintance_contract_id,brand,type,speed";
|
|
$db_query .= ",weight,usednature,usedage,numberoffloor,numberofstop,numberofdoor";
|
|
$db_query .= ",tai_count,yearlyinspectiondate,standardprice,discusspricing,calibrationfee,yearlyinspectionfee";
|
|
$db_query .= ",sumfee,creater,create_at,updatee_at) values (";
|
|
$db_query .= "'$facilityno', '$maintance_contract_id', '$brand', '$type', '$speed', '$weight',";
|
|
$db_query .= "'$usednature', '$usedage', '$numberoffloor', '$numberofstop','$numberofdoor',";
|
|
$db_query .= "'$tai_count','$yearlyinspectiondate','$standardprice','$discusspricing','$calibrationfee','$yearlyinspectionfee',";
|
|
$db_query .= "'$sumfee','$creater','$create_at','$updatee_at')";
|
|
|
|
$result = mysqli_query($link, $db_query);
|
|
if ($mid = mysqli_insert_id($link)) {
|
|
header("Location: faultreview-index.php");
|
|
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);
|
|
}
|
|
?>
|