Browse Source

option mi 開權限

main
Cheng 1 year ago
parent
commit
e08dab0543
  1. 42
      wms/mkt/price_option-index.php
  2. 19
      wms/mkt/price_option-select.php

42
wms/mkt/price_option-index.php

@ -3,6 +3,8 @@ include '../header.php';
require_once './conn.php'; require_once './conn.php';
$kind = $_GET['kind']; $kind = $_GET['kind'];
$sql_str = "SELECT * FROM option_price WHERE kind = :kind AND status ='Y'"; $sql_str = "SELECT * FROM option_price WHERE kind = :kind AND status ='Y'";
$sql_str = "SELECT option_price.*, option_mi.price as mi FROM option_price LEFT JOIN (SELECT option_mi.option_price_id, option_mi.price FROM option_mi GROUP BY option_mi.option_price_id) option_mi ON option_price.id = option_mi.option_price_id WHERE kind = :kind AND status ='Y'";
$stmt = $conn->prepare($sql_str); $stmt = $conn->prepare($sql_str);
$stmt->bindParam(':kind', $kind); $stmt->bindParam(':kind', $kind);
$stmt->execute(); $stmt->execute();
@ -17,15 +19,29 @@ $optional_arr = [1=>'標', 2=>'選'];
<div class="price_option-index" x-data="priceOptionIndex"> <div class="price_option-index" x-data="priceOptionIndex">
<div class="sidebar"> <div class="sidebar">
<a href="./price_option-select.php?<?php echo $token_link; ?> ">全部顯示</a> <a href="./price_option-select.php?<?php echo $token_link; ?> ">全部顯示</a>
<a <?php if($kind == 'A'){echo 'class="active"';} ?> href="./price_option-index.php?kind=A&<?php echo $token_link; ?>">A-1車廂意匠</a> <a <?php if ($kind == 'A') {
<a <?php if($kind == 'B'){echo 'class="active"';} ?> href="./price_option-index.php?kind=B&<?php echo $token_link; ?>">A-2車廂內裝</a> echo 'class="active"';
<a <?php if($kind == 'C'){echo 'class="active"';} ?> href="./price_option-index.php?kind=C&<?php echo $token_link; ?>">A-3車廂外部</a> } ?> href="./price_option-index.php?kind=A&<?php echo $token_link; ?>">A-1車廂意匠</a>
<a <?php if($kind == 'D'){echo 'class="active"';} ?> href="./price_option-index.php?kind=D&<?php echo $token_link; ?>">A-4控制與其他</a> <a <?php if ($kind == 'B') {
<a <?php if($kind == 'E'){echo 'class="active"';} ?> href="./price_option-index.php?kind=E&<?php echo $token_link; ?>">B-1平台梯</a> echo 'class="active"';
<a <?php if($kind == 'F'){echo 'class="active"';} ?> href="./price_option-index.php?kind=F&<?php echo $token_link; ?>">C-1汰改</a> } ?> href="./price_option-index.php?kind=B&<?php echo $token_link; ?>">A-2車廂內裝</a>
<a <?php if ($kind == 'C') {
echo 'class="active"';
} ?> href="./price_option-index.php?kind=C&<?php echo $token_link; ?>">A-3車廂外部</a>
<a <?php if ($kind == 'D') {
echo 'class="active"';
} ?> href="./price_option-index.php?kind=D&<?php echo $token_link; ?>">A-4控制與其他</a>
<a <?php if ($kind == 'E') {
echo 'class="active"';
} ?> href="./price_option-index.php?kind=E&<?php echo $token_link; ?>">B-1平台梯</a>
<a <?php if ($kind == 'F') {
echo 'class="active"';
} ?> href="./price_option-index.php?kind=F&<?php echo $token_link; ?>">C-1汰改</a>
</div> </div>
<div class="options"> <div class="options">
<div class="container"><h2>OPTION價格查詢</h2></div> <div class="container">
<h2>OPTION價格查詢</h2>
</div>
<div id="exTab1" class="container"> <div id="exTab1" class="container">
<div class="toolbar"> <div class="toolbar">
<label for=""> <label for="">
@ -57,12 +73,17 @@ $optional_arr = [1=>'標', 2=>'選'];
<th scope="col" nowrap>配置</th> <th scope="col" nowrap>配置</th>
<th scope="col" nowrap>單位</th> <th scope="col" nowrap>單位</th>
<th scope="col" nowrap>定價</th> <th scope="col" nowrap>定價</th>
<?php if ($user_id == 'M0174' || $user_id == 'M0107' || $user_id == "M0225") : ?>
<th scope="col" nowrap>MI</th>
<?php endif; ?>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<template x-if="options.length <= 0"> <template x-if="options.length <= 0">
<tr> <tr>
<td colspan="6"><p style="font-size:13px;color:#a00">沒有符合的結果。</p></td> <td colspan="6">
<p style="font-size:13px;color:#a00">沒有符合的結果。</p>
</td>
</tr> </tr>
</template> </template>
<template x-for="option in options"> <template x-for="option in options">
@ -72,7 +93,10 @@ $optional_arr = [1=>'標', 2=>'選'];
<td x-text="option.memo"></td> <td x-text="option.memo"></td>
<td x-text="options_arr[option.optional]"></td> <td x-text="options_arr[option.optional]"></td>
<td x-text="option.unit"></td> <td x-text="option.unit"></td>
<td x-html="option.price!=null ? Number(option.price).toLocaleString() : ''"></td> <td x-html="option.price!=null ? '$'+Number(option.price).toLocaleString() : ''"></td>
<?php if ($user_id == 'M0174' || $user_id == 'M0107' || $user_id == "M0225") : ?>
<td x-html="option.mi!=null ? '$'+Number(option.mi).toLocaleString() : ''"></td>
<?php endif; ?>
</tr> </tr>
</template> </template>
</table> </table>

19
wms/mkt/price_option-select.php

@ -1,7 +1,8 @@
<?php <?php
include "../header.php"; include "../header.php";
require_once('./conn.php'); require_once('./conn.php');
$sql_str = "SELECT * FROM option_price WHERE status = 'Y' ORDER BY kind, id"; $sql_str = "SELECT * FROM option_price WHERE status ='Y'";
$sql_str = "SELECT option_price.*, option_mi.price as mi FROM option_price LEFT JOIN (SELECT option_mi.option_price_id, option_mi.price FROM option_mi GROUP BY option_mi.option_price_id) option_mi ON option_price.id = option_mi.option_price_id WHERE status ='Y'";
$stmt = $conn->prepare($sql_str); $stmt = $conn->prepare($sql_str);
$stmt->execute(); $stmt->execute();
$options = $stmt->fetchAll(PDO::FETCH_ASSOC); $options = $stmt->fetchAll(PDO::FETCH_ASSOC);
@ -25,7 +26,9 @@ $optional_arr = [1=>'標', 2=>'選'];
</div> </div>
<div class="options"> <div class="options">
<div class="container"><h2>OPTION價格查詢</h2></div> <div class="container">
<h2>OPTION價格查詢</h2>
</div>
<div id="exTab1" class="container"> <div id="exTab1" class="container">
<div class="toolbar"> <div class="toolbar">
<label for=""> <label for="">
@ -54,12 +57,17 @@ $optional_arr = [1=>'標', 2=>'選'];
<th scope="col" nowrap>配置</th> <th scope="col" nowrap>配置</th>
<th scope="col" nowrap>單位</th> <th scope="col" nowrap>單位</th>
<th scope="col" nowrap>定價</th> <th scope="col" nowrap>定價</th>
<?php if ($user_id == 'M0174' || $user_id == 'M0107' || $user_id == "M0225") : ?>
<th scope="col" nowrap>MI</th>
<?php endif; ?>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<template x-if="options.length <= 0"> <template x-if="options.length <= 0">
<tr> <tr>
<td colspan="6"><p style="font-size:13px;color:#a00">沒有符合的結果。</p></td> <td colspan="6">
<p style="font-size:13px;color:#a00">沒有符合的結果。</p>
</td>
</tr> </tr>
</template> </template>
<template x-for="option in options"> <template x-for="option in options">
@ -69,7 +77,10 @@ $optional_arr = [1=>'標', 2=>'選'];
<td x-text="option.memo"></td> <td x-text="option.memo"></td>
<td x-text="options_arr[option.optional]"></td> <td x-text="options_arr[option.optional]"></td>
<td x-text="option.unit"></td> <td x-text="option.unit"></td>
<td x-html="option.price!=null ? Number(option.price).toLocaleString() : ''"></td> <td x-html="option.price!=null ? '$'+Number(option.price).toLocaleString() : ''"></td>
<?php if ($user_id == 'M0174' || $user_id == 'M0107' || $user_id == "M0225") : ?>
<td x-html="option.mi!=null ? '$'+Number(option.mi).toLocaleString() : ''"></td>
<?php endif; ?>
</tr> </tr>
</template> </template>
</table> </table>

Loading…
Cancel
Save