|
|
@ -200,16 +200,10 @@ OAmount =$OAmount, UnPayOAmount=$UnPayOAmount, Balance = $OAmountWithTax, LBalan |
|
|
|
} |
|
|
|
$notice_rib_num = mysqli_num_rows($notice_rib); |
|
|
|
$notice_rib = mysqli_fetch_row($notice_rib); |
|
|
|
|
|
|
|
$notice_sql = "SELECT * FROM notice WHERE related_id = 810"; |
|
|
|
$notice_num = mysqli_query($link, $notice_sql); |
|
|
|
$notice_num = mysqli_num_rows($notice_num); |
|
|
|
$title = "有" . $notice_rib_num . "個費用報銷單待審核"; |
|
|
|
if ($notice_num == 0) { |
|
|
|
$insert_notice_sql = "INSERT INTO notice (kind, related_id, title, content, haveread, permission, creater) VALUES(1,810,'$title','$content',1,'M0056','system')"; |
|
|
|
} else { |
|
|
|
$insert_notice_sql = "UPDATE notice SET title= '$title', content='$content',permission='M0056' WHERE related_id=810"; |
|
|
|
} |
|
|
|
$insert_notice_sql = "UPDATE notice SET title= '$title', content='$content',haveread=NULL WHERE id=1654"; |
|
|
|
mysqli_query($link, $insert_notice_sql); |
|
|
|
$insert_notice_sql = "UPDATE notice SET title= '$title', content='$content',haveread=NULL WHERE id=1959"; |
|
|
|
mysqli_query($link, $insert_notice_sql); |
|
|
|
} elseif ($state == 2) { |
|
|
|
//取得表頭資料 |
|
|
@ -392,23 +386,11 @@ OAmount =$OAmount, UnPayOAmount=$UnPayOAmount, Balance = $OAmountWithTax, LBalan |
|
|
|
} |
|
|
|
$notice_rib_num = mysqli_num_rows($notice_rib); |
|
|
|
$notice_rib = mysqli_fetch_row($notice_rib); |
|
|
|
$notice_sql = "SELECT * FROM notice WHERE related_id = 810"; |
|
|
|
$notice_num = mysqli_query($link, $notice_sql); |
|
|
|
$notice_num = mysqli_num_rows($notice_num); |
|
|
|
$title = "有" . $notice_rib_num . "個費用報銷單待審核"; |
|
|
|
if ($notice_rib_num > 0) { |
|
|
|
if ($notice_num == 0) { |
|
|
|
$insert_notice_sql = "INSERT INTO notice (kind, related_id, title, content, haveread, permission, creater) VALUES(1,810,'$title','$content',1,'M0056','system')"; |
|
|
|
} else { |
|
|
|
$insert_notice_sql = "UPDATE notice SET title= '$title', content='$content',permission='M0056' WHERE related_id=810"; |
|
|
|
} |
|
|
|
mysqli_query($link, $insert_notice_sql); |
|
|
|
} else { |
|
|
|
if ($notice_num != 0) { |
|
|
|
$insert_notice_sql = "DELETE FROM notice WHERE related_id = 810"; |
|
|
|
} |
|
|
|
mysqli_query($link, $insert_notice_sql); |
|
|
|
} |
|
|
|
$insert_notice_sql = "UPDATE notice SET title= '$title', content='$content',haveread=NULL WHERE id=1654"; |
|
|
|
mysqli_query($link, $insert_notice_sql); |
|
|
|
$insert_notice_sql = "UPDATE notice SET title= '$title', content='$content',haveread=NULL WHERE id=1959"; |
|
|
|
mysqli_query($link, $insert_notice_sql); |
|
|
|
} |
|
|
|
?> |
|
|
|
<script> |
|
|
|