@ -2,12 +2,14 @@
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'";
$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();
$options = $stmt->fetchAll(PDO::FETCH_ASSOC);
$options = $stmt->fetchAll(PDO::FETCH_ASSOC);
$optional_arr = [1=>'標', 2=>'選'];
$optional_arr = [1 => '標', 2 => '選'];
?>
?>
< link rel = "stylesheet" href = "./css/style.css" >
< 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 = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity = "sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin = "anonymous" referrerpolicy = "no-referrer" / >
@ -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 = "" >
@ -45,7 +61,7 @@ $optional_arr = [1=>'標', 2=>'選'];
< / label >
< / label >
< label for = "" >
< label for = "" >
搜尋
搜尋
< input type = "text" @ keyup = "inputSearch($event)" / >
< input type = "text" @ keyup = "inputSearch($event)" / >
< / label >
< / label >
< / div >
< / div >
< table id = "table_index2" class = "table table-striped table-bordered" style = "width:100%" >
< table id = "table_index2" class = "table table-striped table-bordered" style = "width:100%" >
@ -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 >
@ -84,7 +108,7 @@ $optional_arr = [1=>'標', 2=>'選'];
< / template >
< / template >
< template x-if = "pageNumber <= 10" >
< template x-if = "pageNumber <= 10" >
< template x-for = "page in pageNumber" >
< template x-for = "page in pageNumber" >
< a href = "javascript:;" @ click = "switchPage(page)" :class = "[(page == currentpage) ? 'active' : '']" x-text = "page" > < / a >
< a href = "javascript:;" @ click = "switchPage(page)" :class = "[(page == currentpage) ? 'active' : '']" x-text = "page" > < / a >
< / template >
< / template >
< / template >
< / template >
< template x-if = "pageNumber > 10" >
< template x-if = "pageNumber > 10" >