Browse Source

option mi 開權限

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

242
wms/mkt/price_option-index.php

@ -1,110 +1,134 @@
<?php <?php
include '../header.php'; 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'";
$stmt = $conn->prepare($sql_str); $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->bindParam(':kind', $kind);
$stmt->execute(); $stmt = $conn->prepare($sql_str);
$options = $stmt->fetchAll(PDO::FETCH_ASSOC); $stmt->bindParam(':kind', $kind);
$optional_arr = [1=>'標', 2=>'選']; $stmt->execute();
?> $options = $stmt->fetchAll(PDO::FETCH_ASSOC);
<link rel="stylesheet" href="./css/style.css"> $optional_arr = [1 => '標', 2 => '選'];
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> ?>
<link rel="stylesheet" href="../contract/semantic/dist/semantic.min.css"> <link rel="stylesheet" href="./css/style.css">
<script defer src="../contract/js/alpinejs/cdn.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="../contract/js/axios/axios.min.js"></script> <link rel="stylesheet" href="../contract/semantic/dist/semantic.min.css">
<div class="price_option-index" x-data="priceOptionIndex"> <script defer src="../contract/js/alpinejs/cdn.min.js"></script>
<div class="sidebar"> <script src="../contract/js/axios/axios.min.js"></script>
<a href="./price_option-select.php?<?php echo $token_link; ?> ">全部顯示</a> <div class="price_option-index" x-data="priceOptionIndex">
<a <?php if($kind == 'A'){echo 'class="active"';} ?> href="./price_option-index.php?kind=A&<?php echo $token_link; ?>">A-1車廂意匠</a> <div class="sidebar">
<a <?php if($kind == 'B'){echo 'class="active"';} ?> href="./price_option-index.php?kind=B&<?php echo $token_link; ?>">A-2車廂內裝</a> <a href="./price_option-select.php?<?php echo $token_link; ?> ">全部顯示</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 == 'A') {
<a <?php if($kind == 'D'){echo 'class="active"';} ?> href="./price_option-index.php?kind=D&<?php echo $token_link; ?>">A-4控制與其他</a> echo 'class="active"';
<a <?php if($kind == 'E'){echo 'class="active"';} ?> href="./price_option-index.php?kind=E&<?php echo $token_link; ?>">B-1平台梯</a> } ?> href="./price_option-index.php?kind=A&<?php echo $token_link; ?>">A-1車廂意匠</a>
<a <?php if($kind == 'F'){echo 'class="active"';} ?> href="./price_option-index.php?kind=F&<?php echo $token_link; ?>">C-1汰改</a> <a <?php if ($kind == 'B') {
</div> echo 'class="active"';
<div class="options"> } ?> href="./price_option-index.php?kind=B&<?php echo $token_link; ?>">A-2車廂內裝</a>
<div class="container"><h2>OPTION價格查詢</h2></div> <a <?php if ($kind == 'C') {
<div id="exTab1" class="container"> echo 'class="active"';
<div class="toolbar"> } ?> href="./price_option-index.php?kind=C&<?php echo $token_link; ?>">A-3車廂外部</a>
<label for=""> <a <?php if ($kind == 'D') {
顯示 echo 'class="active"';
<select x-model="pageLength" @change="changeType()"> } ?> href="./price_option-index.php?kind=D&<?php echo $token_link; ?>">A-4控制與其他</a>
<option value="10">10</option> <a <?php if ($kind == 'E') {
<option value="25">25</option> echo 'class="active"';
<option value="50">50</option> } ?> href="./price_option-index.php?kind=E&<?php echo $token_link; ?>">B-1平台梯</a>
<option value="100">100</option> <a <?php if ($kind == 'F') {
<option value="999999">顯示全部</option> echo 'class="active"';
</select> } ?> href="./price_option-index.php?kind=F&<?php echo $token_link; ?>">C-1汰改</a>
</label> </div>
<label for=""> <div class="options">
<template x-for="btn in buttons"> <div class="container">
<button style="margin-right:4px" :class="['btn', (btn.type == btntype) ? 'btn-primary' : 'btn-secondary text-light']" x-text="btn.name" @click="changeType(btn.type)"></button> <h2>OPTION價格查詢</h2>
</template> </div>
</label> <div id="exTab1" class="container">
<label for=""> <div class="toolbar">
搜尋 <label for="">
<input type="text" @keyup="inputSearch($event)" /> 顯示
</label> <select x-model="pageLength" @change="changeType()">
</div> <option value="10">10</option>
<table id="table_index2" class="table table-striped table-bordered" style="width:100%"> <option value="25">25</option>
<thead> <option value="50">50</option>
<tr class="kind-col"> <option value="100">100</option>
<th scope="col" nowrap>名稱</th> <option value="999999">顯示全部</option>
<th scope="col" nowrap>規格</th> </select>
<th scope="col" nowrap>備註</th> </label>
<th scope="col" nowrap>配置</th> <label for="">
<th scope="col" nowrap>單位</th> <template x-for="btn in buttons">
<th scope="col" nowrap>定價</th> <button style="margin-right:4px" :class="['btn', (btn.type == btntype) ? 'btn-primary' : 'btn-secondary text-light']" x-text="btn.name" @click="changeType(btn.type)"></button>
</tr> </template>
</thead> </label>
<tbody> <label for="">
<template x-if="options.length <= 0"> 搜尋
<tr> <input type="text" @keyup="inputSearch($event)" />
<td colspan="6"><p style="font-size:13px;color:#a00">沒有符合的結果。</p></td> </label>
</tr> </div>
</template> <table id="table_index2" class="table table-striped table-bordered" style="width:100%">
<template x-for="option in options"> <thead>
<tr> <tr class="kind-col">
<td x-text="option.group_name"></td> <th scope="col" nowrap>名稱</th>
<td x-text="option.spec"></td> <th scope="col" nowrap>規格</th>
<td x-text="option.memo"></td> <th scope="col" nowrap>備註</th>
<td x-text="options_arr[option.optional]"></td> <th scope="col" nowrap>配置</th>
<td x-text="option.unit"></td> <th scope="col" nowrap>單位</th>
<td x-html="option.price!=null ? Number(option.price).toLocaleString() : ''"></td> <th scope="col" nowrap>定價</th>
</tr> <?php if ($user_id == 'M0174' || $user_id == 'M0107' || $user_id == "M0225") : ?>
</template> <th scope="col" nowrap>MI</th>
</table> <?php endif; ?>
<div class="pagination"> </tr>
<small x-text="'顯示第'+((Number(currentpage)-1)*Number(pageLength)+1)+' 至 '+((((Number(currentpage)-1)*Number(pageLength) +Number(pageLength))< dataLangth) ? ((Number(currentpage)-1)*Number(pageLength) +Number(pageLength)) : dataLangth )+' 項結果,共 '+dataLangth+' 項'"></small> </thead>
<div class="links"> <tbody>
<template x-if="currentpage>1"> <template x-if="options.length <= 0">
<a href="###" @click="switchPage(currentpage-1)">&laquo;</a> <tr>
</template> <td colspan="6">
<template x-if="pageNumber <= 10"> <p style="font-size:13px;color:#a00">沒有符合的結果。</p>
<template x-for="page in pageNumber"> </td>
<a href="javascript:;" @click="switchPage(page)" :class="[(page == currentpage) ? 'active' : '']" x-text="page" ></a> </tr>
</template> </template>
</template> <template x-for="option in options">
<template x-if="pageNumber > 10"> <tr>
<select @change="selectPage($event)" style="width:66px;padding:8px 2px" x-model="currentpage"> <td x-text="option.group_name"></td>
<template x-for="page in pageNumber"> <td x-text="option.spec"></td>
<option :value="page" x-text="page"></option> <td x-text="option.memo"></td>
</template> <td x-text="options_arr[option.optional]"></td>
</select> <td x-text="option.unit"></td>
</template> <td x-html="option.price!=null ? '$'+Number(option.price).toLocaleString() : ''"></td>
<template x-if="currentpage<pageNumber"> <?php if ($user_id == 'M0174' || $user_id == 'M0107' || $user_id == "M0225") : ?>
<a href="###" @click="switchPage(currentpage+1)">&raquo;</a> <td x-html="option.mi!=null ? '$'+Number(option.mi).toLocaleString() : ''"></td>
</template> <?php endif; ?>
</div> </tr>
</div> </template>
</div> </table>
</div> <div class="pagination">
</div> <small x-text="'顯示第'+((Number(currentpage)-1)*Number(pageLength)+1)+' 至 '+((((Number(currentpage)-1)*Number(pageLength) +Number(pageLength))< dataLangth) ? ((Number(currentpage)-1)*Number(pageLength) +Number(pageLength)) : dataLangth )+' 項結果,共 '+dataLangth+' 項'"></small>
<div class="links">
<script src="./assets/js/alpine.js"></script> <template x-if="currentpage>1">
<script> <a href="###" @click="switchPage(currentpage-1)">&laquo;</a>
const options = [...<?php echo json_encode($options); ?>]; </template>
const kind = '<?php echo $kind; ?>'; <template x-if="pageNumber <= 10">
<template x-for="page in pageNumber">
<a href="javascript:;" @click="switchPage(page)" :class="[(page == currentpage) ? 'active' : '']" x-text="page"></a>
</template>
</template>
<template x-if="pageNumber > 10">
<select @change="selectPage($event)" style="width:66px;padding:8px 2px" x-model="currentpage">
<template x-for="page in pageNumber">
<option :value="page" x-text="page"></option>
</template>
</select>
</template>
<template x-if="currentpage<pageNumber">
<a href="###" @click="switchPage(currentpage+1)">&raquo;</a>
</template>
</div>
</div>
</div>
</div>
</div>
<script src="./assets/js/alpine.js"></script>
<script>
const options = [...<?php echo json_encode($options); ?>];
const kind = '<?php echo $kind; ?>';
</script> </script>

221
wms/mkt/price_option-select.php

@ -1,106 +1,117 @@
<?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'";
$stmt = $conn->prepare($sql_str); $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->execute(); $stmt = $conn->prepare($sql_str);
$options = $stmt->fetchAll(PDO::FETCH_ASSOC); $stmt->execute();
$optional_arr = [1=>'標', 2=>'選']; $options = $stmt->fetchAll(PDO::FETCH_ASSOC);
?> $optional_arr = [1 => '標', 2 => '選'];
<link rel="stylesheet" href="./css/style.css"> ?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="./css/style.css">
<link rel="stylesheet" href="../contract/semantic/dist/semantic.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script defer src="../contract/js/alpinejs/cdn.min.js"></script> <link rel="stylesheet" href="../contract/semantic/dist/semantic.min.css">
<script src="../contract/js/axios/axios.min.js"></script> <script defer src="../contract/js/alpinejs/cdn.min.js"></script>
<div class="price_option-select" x-data="priceOptionSelect"> <script src="../contract/js/axios/axios.min.js"></script>
<div class="price_option-select" x-data="priceOptionSelect">
<div class="sidebar">
<a class="active" href="./price_option-select.php?<?php echo $token_link; ?> ">全部顯示</a> <div class="sidebar">
<a href="./price_option-index.php?kind=A&<?php echo $token_link; ?>">A-1車廂意匠</a> <a class="active" href="./price_option-select.php?<?php echo $token_link; ?> ">全部顯示</a>
<a href="./price_option-index.php?kind=B&<?php echo $token_link; ?>">A-2車廂內裝</a> <a href="./price_option-index.php?kind=A&<?php echo $token_link; ?>">A-1車廂意匠</a>
<a href="./price_option-index.php?kind=C&<?php echo $token_link; ?>">A-3車廂外部</a> <a href="./price_option-index.php?kind=B&<?php echo $token_link; ?>">A-2車廂內裝</a>
<a href="./price_option-index.php?kind=D&<?php echo $token_link; ?>">A-4控制與其他</a> <a href="./price_option-index.php?kind=C&<?php echo $token_link; ?>">A-3車廂外部</a>
<a href="./price_option-index.php?kind=E&<?php echo $token_link; ?>">B-1平台梯</a> <a href="./price_option-index.php?kind=D&<?php echo $token_link; ?>">A-4控制與其他</a>
<a href="./price_option-index.php?kind=F&<?php echo $token_link; ?>">C-1汰改</a> <a href="./price_option-index.php?kind=E&<?php echo $token_link; ?>">B-1平台梯</a>
</div> <a href="./price_option-index.php?kind=F&<?php echo $token_link; ?>">C-1汰改</a>
<div class="options"> </div>
<div class="options">
<div class="container"><h2>OPTION價格查詢</h2></div>
<div id="exTab1" class="container"> <div class="container">
<div class="toolbar"> <h2>OPTION價格查詢</h2>
<label for=""> </div>
顯示 <div id="exTab1" class="container">
<select x-model="pageLength" @change="changeType()"> <div class="toolbar">
<option value="10">10</option> <label for="">
<option value="25">25</option> 顯示
<option value="50">50</option> <select x-model="pageLength" @change="changeType()">
<option value="100">100</option> <option value="10">10</option>
<option value="999999">顯示全部</option> <option value="25">25</option>
</select> <option value="50">50</option>
</label> <option value="100">100</option>
<label for=""> <option value="999999">顯示全部</option>
</label> </select>
<label for=""> </label>
搜尋 <label for="">
<input type="text" @keyup="inputSearch($event)" /> </label>
</label> <label for="">
</div> 搜尋
<table id="table_index2" class="table table-striped table-bordered" style="width:100%"> <input type="text" @keyup="inputSearch($event)" />
<thead> </label>
<tr class="kind-col"> </div>
<th scope="col" nowrap>名稱</th> <table id="table_index2" class="table table-striped table-bordered" style="width:100%">
<th scope="col" nowrap>規格</th> <thead>
<th scope="col" nowrap>備註</th> <tr class="kind-col">
<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>
</tr> <th scope="col" nowrap>配置</th>
</thead> <th scope="col" nowrap>單位</th>
<tbody> <th scope="col" nowrap>定價</th>
<template x-if="options.length <= 0"> <?php if ($user_id == 'M0174' || $user_id == 'M0107' || $user_id == "M0225") : ?>
<tr> <th scope="col" nowrap>MI</th>
<td colspan="6"><p style="font-size:13px;color:#a00">沒有符合的結果。</p></td> <?php endif; ?>
</tr> </tr>
</template> </thead>
<template x-for="option in options"> <tbody>
<tr> <template x-if="options.length <= 0">
<td x-text="option.group_name"></td> <tr>
<td x-text="option.spec"></td> <td colspan="6">
<td x-text="option.memo"></td> <p style="font-size:13px;color:#a00">沒有符合的結果。</p>
<td x-text="options_arr[option.optional]"></td> </td>
<td x-text="option.unit"></td> </tr>
<td x-html="option.price!=null ? Number(option.price).toLocaleString() : ''"></td> </template>
</tr> <template x-for="option in options">
</template> <tr>
</table> <td x-text="option.group_name"></td>
<div class="pagination"> <td x-text="option.spec"></td>
<small x-text="'顯示第'+((Number(currentpage)-1)*Number(pageLength)+1)+' 至 '+((((Number(currentpage)-1)*Number(pageLength) +Number(pageLength))< dataLangth) ? ((Number(currentpage)-1)*Number(pageLength) +Number(pageLength)) : dataLangth )+' 項結果,共 '+dataLangth+' 項'"></small> <td x-text="option.memo"></td>
<div class="links"> <td x-text="options_arr[option.optional]"></td>
<template x-if="currentpage>1"> <td x-text="option.unit"></td>
<a href="###" @click="switchPage(currentpage-1)">&laquo;</a> <td x-html="option.price!=null ? '$'+Number(option.price).toLocaleString() : ''"></td>
</template> <?php if ($user_id == 'M0174' || $user_id == 'M0107' || $user_id == "M0225") : ?>
<template x-if="pageNumber <= 10"> <td x-html="option.mi!=null ? '$'+Number(option.mi).toLocaleString() : ''"></td>
<template x-for="page in pageNumber"> <?php endif; ?>
<a href="javascript:;" @click="switchPage(page)" :class="[(page == currentpage) ? 'active' : '']" x-text="page" ></a> </tr>
</template> </template>
</template> </table>
<template x-if="pageNumber > 10"> <div class="pagination">
<select @change="selectPage($event)" style="width:66px;padding:8px 2px" x-model="currentpage"> <small x-text="'顯示第'+((Number(currentpage)-1)*Number(pageLength)+1)+' 至 '+((((Number(currentpage)-1)*Number(pageLength) +Number(pageLength))< dataLangth) ? ((Number(currentpage)-1)*Number(pageLength) +Number(pageLength)) : dataLangth )+' 項結果,共 '+dataLangth+' 項'"></small>
<template x-for="page in pageNumber"> <div class="links">
<option :value="page" x-text="page"></option> <template x-if="currentpage>1">
</template> <a href="###" @click="switchPage(currentpage-1)">&laquo;</a>
</select> </template>
</template> <template x-if="pageNumber <= 10">
<template x-if="currentpage<pageNumber"> <template x-for="page in pageNumber">
<a href="###" @click="switchPage(currentpage+1)">&raquo;</a> <a href="javascript:;" @click="switchPage(page)" :class="[(page == currentpage) ? 'active' : '']" x-text="page"></a>
</template> </template>
</div> </template>
</div> <template x-if="pageNumber > 10">
</div> <select @change="selectPage($event)" style="width:66px;padding:8px 2px" x-model="currentpage">
</div> <template x-for="page in pageNumber">
</div> <option :value="page" x-text="page"></option>
</template>
<script src="./assets/js/alpine.js"></script> </select>
<script> </template>
const options = [...<?php echo json_encode($options); ?>]; <template x-if="currentpage<pageNumber">
<a href="###" @click="switchPage(currentpage+1)">&raquo;</a>
</template>
</div>
</div>
</div>
</div>
</div>
<script src="./assets/js/alpine.js"></script>
<script>
const options = [...<?php echo json_encode($options); ?>];
</script> </script>
Loading…
Cancel
Save