You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
3.4 KiB
76 lines
3.4 KiB
<?php
|
|
include '../header.php';
|
|
require_once './conn.php';
|
|
$kind = $_GET['kind'];
|
|
$sql_str = "SELECT * FROM option_price WHERE kind = :kind AND status ='Y'";
|
|
$stmt = $conn->prepare($sql_str);
|
|
$stmt->bindParam(':kind', $kind);
|
|
$stmt->execute();
|
|
$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="../contract/semantic/dist/semantic.min.css">
|
|
<script defer src="../contract/js/alpinejs/cdn.min.js"></script>
|
|
<script src="../contract/js/axios/axios.min.js"></script>
|
|
<div class="price_option-index" x-data="priceOptionIndex">
|
|
<div class="container"><h2>OPTION價格查詢</h2></div>
|
|
<div id="exTab1" class="container">
|
|
<div class="toolbar">
|
|
<label for="">
|
|
顯示
|
|
<select x-model="pageLength" @change="changeType()">
|
|
<option value="10">10</option>
|
|
<option value="25">25</option>
|
|
<option value="50">50</option>
|
|
<option value="100">100</option>
|
|
<option value="999999">顯示全部</option>
|
|
</select>
|
|
</label>
|
|
<label for="">
|
|
<template x-for="btn in buttons">
|
|
<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>
|
|
</template>
|
|
</label>
|
|
<label for="">
|
|
搜尋
|
|
<input type="text" @keyup="inputSearch($event)" />
|
|
</label>
|
|
</div>
|
|
<table id="table_index2" class="table table-striped table-bordered" style="width:100%">
|
|
<thead>
|
|
<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>
|
|
</thead>
|
|
<tbody>
|
|
<template x-if="options.length <= 0">
|
|
<tr>
|
|
<td colspan="6"><p style="font-size:13px;color:#a00">沒有符合的結果。</p></td>
|
|
</tr>
|
|
</template>
|
|
<template x-for="option in options">
|
|
<tr>
|
|
<td x-text="option.group_name"></td>
|
|
<td x-text="option.spec"></td>
|
|
<td x-text="option.memo"></td>
|
|
<td x-text="options_arr[option.optional]"></td>
|
|
<td x-text="option.unit"></td>
|
|
<td x-text="option.price!=null ? option.price.toLocaleString() : ''"></td>
|
|
</tr>
|
|
</template>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="./assets/js/alpine.js"></script>
|
|
<script>
|
|
const options = [...<?php echo json_encode($options); ?>];
|
|
const kind = '<?php echo $kind; ?>';
|
|
</script>
|