$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 ""; //header("Location: pricereview-index.php"); } else { echo ""; } } else { echo ""; } mysqli_close($link); } ?>