Browse Source

bug fix

gary
jrbin 2 years ago
parent
commit
3427043146
  1. 43
      wms/mkt/pricereview_renovate-check.php

43
wms/mkt/pricereview_renovate-check.php

@ -66,8 +66,26 @@ foreach ($res as $data) {
mysqli_free_result($res_s); mysqli_free_result($res_s);
if (!empty($row_s["sign1"])) list($person1, $status1, $dtte1) = explode(",", $row_s["sign1"]); if (!empty($row_s["sign1"])) list($person1, $status1, $dtte1) = explode(",", $row_s["sign1"]);
else $person1 = $status1 = $dtte1 = ""; else $person1 = $status1 = $dtte1 = "";
if (!empty($row_s["sign2"])) list($person2, $status2, $dtte2) = explode(",", $row_s["sign2"]); if (!empty($row_s["sign2"])) {
else $person2 = $status2 = $dtte2 = ""; if ($st == 2 && (preg_match("/Y/", $row_s["sign2"]) || preg_match("/N/", $row_s["sign2"]))) {
echo "<script>";
echo "alert('請勿重覆審核!');";
echo "location.href='pricereview_renovate-index.php?function_name=pricereview_renovate&".$token_link."';";
echo "</script>";
exit;
}
$sign2_arr = explode("<##>", $row_s["sign2"]); // M0024,,<##>M0175,,
$person2_arr = [];
foreach ($sign2_arr as $v) {
list($person2, $status2, $dtte2) = explode(",", $v);
if (strlen($v) == 7) { // 未審
$person2_arr[] = $person2;
} else {
unset($person2_arr);
break;
}
}
} else $person2 = $status2 = $dtte2 = "";
if (!empty($row_s["sign3"])) list($person3, $status3, $dtte3) = explode(",", $row_s["sign3"]); if (!empty($row_s["sign3"])) list($person3, $status3, $dtte3) = explode(",", $row_s["sign3"]);
else $person3 = $status3 = $dtte3 = ""; else $person3 = $status3 = $dtte3 = "";
if (!empty($row_s["sign4"])) list($person4, $status4, $dtte4) = explode(",", $row_s["sign4"]); if (!empty($row_s["sign4"])) list($person4, $status4, $dtte4) = explode(",", $row_s["sign4"]);
@ -99,7 +117,7 @@ foreach ($res as $data) {
if ($st == 1 && ($person1 == $user_id) && ($status1 == "")) { if ($st == 1 && ($person1 == $user_id) && ($status1 == "")) {
$sign_on = 1; $sign_on = 1;
} }
if ($st == 2 && ($person2 == $user_id) && ($status2 == "")) { if ($st == 2 && ($person2 == $user_id || (isset($person2_arr) && in_array($user_id, $person2_arr))) && ($status2 == "")) {
$sign_on = 1; $sign_on = 1;
} }
if ($st == 3 && ($person3 == $user_id) && ($status3 == "")) { if ($st == 3 && ($person3 == $user_id) && ($status3 == "")) {
@ -402,7 +420,6 @@ hr {
</div> </div>
</div> </div>
</div> </div>
<div class="container"> <div class="container">
<form class="form-inline" method="post" action="pricereview_renovate-record-check.php" enctype="multipart/form-data"> <form class="form-inline" method="post" action="pricereview_renovate-record-check.php" enctype="multipart/form-data">
<input type="hidden" name="id" id="id" value="<?=$id;?>"> <input type="hidden" name="id" id="id" value="<?=$id;?>">
@ -440,7 +457,6 @@ hr {
$item_amt_A_all += $val["item_price_bp"]; $item_amt_A_all += $val["item_price_bp"];
if ($viewmi) { if ($viewmi) {
for ($i=0; $i<$val["item_qty"]; $i++) { for ($i=0; $i<$val["item_qty"]; $i++) {
?> ?>
<tr name="facil_templ"> <tr name="facil_templ">
<td><?php echo $idx; ?><input type="hidden" name="item_no" value="<?php echo $item_no; ?>"></td> <td><?php echo $idx; ?><input type="hidden" name="item_no" value="<?php echo $item_no; ?>"></td>
@ -456,7 +472,6 @@ hr {
<td><input type="text" name="gross_profit" class="form-control dollar-right" size="9" value="<?=number_format($val["gross_profit"]);?>"></td> <td><input type="text" name="gross_profit" class="form-control dollar-right" size="9" value="<?=number_format($val["gross_profit"]);?>"></td>
<td><input type="text" name="gross_profit_rate" class="form-control" size="6" value="<?=number_format($val["gross_profit_rate"], 1);?>"></td> <td><input type="text" name="gross_profit_rate" class="form-control" size="6" value="<?=number_format($val["gross_profit_rate"], 1);?>"></td>
<!--<td><input type="text" name="note" class="form-control" size="17" value="<?=$val["note"];?>"></td>--> <!--<td><input type="text" name="note" class="form-control" size="17" value="<?=$val["note"];?>"></td>-->
</tr> </tr>
<tr name="facil_templ2"> <tr name="facil_templ2">
<td colspan="5"></td> <td colspan="5"></td>
@ -506,8 +521,8 @@ hr {
</thead> </thead>
<tbody> <tbody>
<?php <?php
$item_amt_B_all = 0;
$idx = 1; $idx = 1;
$item_amt_B_all = 0;
foreach ($option_arr as $item_no => $val) { foreach ($option_arr as $item_no => $val) {
$item_amt_B_all += $val["item_price_bp"]; $item_amt_B_all += $val["item_price_bp"];
?> ?>
@ -976,7 +991,19 @@ hr {
</tr> </tr>
<tr> <tr>
<td>業務承辦人</td> <td>業務承辦人</td>
<td><?php echo (empty($accountname_arr[$person2])) ? "---" : $accountname_arr[$person2]; ?></td> <td>
<?php
if (empty($person2_arr)) {
echo (empty($accountname_arr[$person2])) ? "---" : $accountname_arr[$person2];
} else {
$person2_name_str = "";
foreach ($person2_arr as $pv) {
$person2_name_str .= $accountname_arr[$pv]."/";
}
echo rtrim($person2_name_str, "/");
}
?>
</td>
<td><?php echo $checker_2_result; ?></td> <td><?php echo $checker_2_result; ?></td>
<td><?php echo nl2br($sign2_note); ?></td> <td><?php echo nl2br($sign2_note); ?></td>
<td><?php echo $dtte2; ?></td> <td><?php echo $dtte2; ?></td>

Loading…
Cancel
Save