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.
42 lines
1.2 KiB
42 lines
1.2 KiB
<?php
|
|
require_once "database.php";
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
|
|
foreach ($_POST as $k => $v) {
|
|
$$k = htmlspecialchars(stripslashes(trim($v)));
|
|
}
|
|
$maintance_contract_id=$_POST['maintance_contract_id'];
|
|
|
|
$paymentdate=$_POST['paymentdate'];
|
|
$receivableamount=$_POST['receivableamount'];
|
|
$paidamount=$_POST['paidamount'];
|
|
|
|
$creater = $_POST['creater'];
|
|
$create_at = date('Y/m/d H:i:s');
|
|
$updatee_at=date('Y/m/d H:i:s');
|
|
$id= $_POST['id'];
|
|
|
|
$db_query = "update maintance_contract_receivable set paymentdate = '$paymentdate',";
|
|
$db_query .= "receivableamount = '$receivableamount', paidamount = '$paidamount',";
|
|
$db_query .= "updatee_at ='$updatee_at'";
|
|
$db_query .= " where id = '$id'";
|
|
|
|
if ($rs = mysqli_query($link, $db_query)) {
|
|
header("Location: receivableview-index.php");
|
|
if (mysqli_affected_rows($link) > 0) {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('更新成功')";
|
|
echo "</script>";
|
|
|
|
} else {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('更新失敗,請重新操作[I]')";
|
|
echo "</script>";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
mysqli_close($link);
|
|
}
|
|
?>
|