diff --git a/wms/wipwhole-rec-invoice-edit-submit.php b/wms/wipwhole-rec-invoice-edit-submit.php index 35d9cf59..c41aa812 100644 --- a/wms/wipwhole-rec-invoice-edit-submit.php +++ b/wms/wipwhole-rec-invoice-edit-submit.php @@ -193,7 +193,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { null, '$permission', '$creater', - '".date("Y-m-d H:i:s")."' + '" . date("Y-m-d H:i:s") . "' ); "; mysqli_query($link, $sql); @@ -649,10 +649,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_POST['form_name'] == 'update_date_form') { + + $creater = $user_id; + foreach ($_POST as $k => $v) $$k = htmlspecialchars(stripslashes(trim($v))); - $real_contract_arrival_date = $_POST['real_arrival_date']; + $real_arrival_date = $_POST['real_arrival_date']; $updatesql = " UPDATE wipwholestatus SET @@ -661,6 +664,49 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { "; mysqli_query($link, $updatesql); + + $sql = " + SELECT + `custom`, + `facilityno`, + `salesid` + FROM `wipwholestatus` + where `id` = '$id' + "; + $result = mysqli_query($link, $sql); + foreach ($result as $row) { + $permission = $row["salesid"]; + $custom = $row["custom"]; + $facilityno = $row["facilityno"]; + $title = "客戶:$custom 作番:$facilityno 實際出貨日變更"; + $content = "客戶:$custom +作番:$facilityno +實際出貨日(到工地):$real_arrival_date"; + + $sql = " + INSERT INTO notice( + kind, + related_id, + title, + content, + haveread, + permission, + creater, + create_at + )VALUES( + '1', + '$id', + '$title', + '$content', + null, + '$permission', + '$creater', + '" . date("Y-m-d H:i:s") . "' + ); + "; + mysqli_query($link, $sql); + } + echo "