|
|
|
ขอคำปรึกษาหน่อยครับ ต้องการให้หน้าแรกโชว์แค่ข้อมูลหมวดหมู่เดียว tab content ครับ |
|
|
|
|
|
|
|
สวัสดีครับผมมีปัญหาเรื่อง element tab content คือหน้าแรกต้องการโชว์แค่ อุปกรณ์ IT Office แต่ พอเพิ่มหมวดหมู่ที่2 กลายเป็นโชว์ผลรวมครับ ติดแค่ปัญหาหน้าแรกครับ แต่เมื่อกดปุ่มตาม tab ไม่มีปัญหาด้านการแสดงผลครับ
รูปภาพประกอบครับ หน้าแรก
ในส่วนของ Code ครับ รบกวนพี่ๆด้วยครับ
Code (PHP)
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>IT Stock</title>
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
<!-- Bootstrap icons-->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="css/styles.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.10.2/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<!--===== HEADER =====-->
<!-- Navigation-->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container px-4 px-lg-5">
<img class="img-fluid img-thumbnail" href="#!" src="img/logo.png">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0 ms-lg-4">
<li class="nav-item"><a class="nav-link active fw-bold" aria-current="page" href="#!">IT Equipment Stock</a></li>
<li class="nav-item"><a class="nav-link fw-bold "href="inktoner.html">Ink Toner Stock</a></li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle active" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Shop</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="#!">All Products</a></li>
<li><hr class="dropdown-divider" /></li>
<li><a class="dropdown-item" href="#!">Popular Items</a></li>
<li><a class="dropdown-item" href="#!">New Arrivals</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<header class="bg-dark py-5">
<div class="container px-4 px-lg-5 my-5">
<div class="text-center text-white">
<h1 class="display-4 fw-bolder">IT Equipment</h1>
<p class="lead fw-normal text-white-50 mb-0">North & South Factory</p>
</div>
</div>
</header>
<!-- Horizontal Bootstrap 4 Tabs -->
<section class="content-header">
<div class="container">
<div class="row gx-4 gx-lg-5 justify-content-center">
<div class="col-12">
<!-- Tabs navs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#firstMenu"><i class="#"></i>IT Equipment Office</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#secondmenu"><i class="#"></i> Network</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#thirdmenu"><i class="#"></i> Bootstrap</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#fourthmenu"><i class="#"></i> Angular</a>
</li>
</ul>
<!-- Tabs Content -->
<div class="tab-content">
<div id="firstMenu" class="tab-pane active">
<br>
<div class="row gx-4 gx-lg-5 row-cols-2 row-cols-md-3 row-cols-xl-4 ">
<?php
$query = "SELECT * FROM product WHERE pd_type = 'eqp'" or die("Error:" . mysqli_error());
$result = mysqli_query($con, $query);
while ($row = mysqli_fetch_array($result)) {
?>
<div class="col mb-5">
<div class="card h-100">
<!-- Product image-->
<img class="card-img-top" src="../../img_it/<?php echo $row['pd_img'];?>" alt="..." />
<!-- Product details-->
<div class="card-body p-4">
<div class="text-center gap-0">
<!-- Product name-->
<h5 class="fw-bolder p-1"><?php echo $row["pd_name"]; ?></h5>
<!-- Product Amouth-->
<h6 class="fw-light gap-0"> Nouth Factory : <?php echo $row["pd_sum_north"]; ?> ชิ้น</h6>
<h6 class="fw-light"> South Factory : <?php echo $row["pd_sum_south"]; ?> ชิ้น</h6>
</div>
</div>
<!-- Product actions-->
<div class="card-footer p-2 pt-0 border-top-0 bg-transparent">
<div class="text-center"><a class="btn btn-primary mt-auto" onclick="ChooseProductModal('<?php echo $row["pd_id"]; ?>');">Choose</a></div>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<div id="secondmenu" class="tab-pane active">
<br>
<div class="row gx-4 gx-lg-5 row-cols-2 row-cols-md-3 row-cols-xl-4 ">
<?php
$query = "SELECT * FROM product WHERE pd_type = 'network'" or die("Error:" . mysqli_error());
$result = mysqli_query($con, $query);
while ($row = mysqli_fetch_array($result)) {
?>
<div class="col mb-5">
<div class="card h-100">
<!-- Product image-->
<img class="card-img-top" src="../../img_it/<?php echo $row['pd_img'];?>" alt="..." />
<!-- Product details-->
<div class="card-body p-4">
<div class="text-center gap-0">
<!-- Product name-->
<h5 class="fw-bolder p-1"><?php echo $row["pd_name"]; ?></h5>
<!-- Product Amouth-->
<h6 class="fw-light gap-0"> Nouth Factory : <?php echo $row["pd_sum_north"]; ?> ชิ้น</h6>
<h6 class="fw-light"> South Factory : <?php echo $row["pd_sum_south"]; ?> ชิ้น</h6>
</div>
</div>
<!-- Product actions-->
<div class="card-footer p-2 pt-0 border-top-0 bg-transparent">
<div class="text-center"><a class="btn btn-primary mt-auto" onclick="ChooseProductModal('<?php echo $row["pd_id"]; ?>');">Choose</a></div>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="modals_order"></div> <!--- modals_stockIN_product.php -->
</section>
<!-- Susscess Modal HTML -->
<div id="SusscessModal" class="modal fade">
<div class="modal-dialog modal-confirm">
<div class="modal-content">
<div class="modal-header justify-content-center">
<div class="icon-box">
<i class="material-icons"></i>
</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body text-center">
<h5>ได้รับคำสั่งสินค้าเรียบร้อย</h5>
<p>โปรดรอการติดต่อกลับจากเจ้าหน้าที่ IT</p>
</div>
</div>
</div>
</div>
<!-- Footer-->
<footer class="py-3 bg-red">
<div class="container"><p class="m-0 text-center text-white">Copyright 2022 THAI TOHKEN THERMO CO.,LTD | All Rights Reserved ©</p></div>
</footer>
<!-- Bootstrap core JS-->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script>
function ChooseProductModal(pd_id){
var post = new Object();
post.pd_id = pd_id
$('#modals_order').load('../stock_card_project/modals_order.php',post,function(){
$("#modal_order").modal('show');
});
}
</script>
</body>
</html>
Tag : PHP, HTML, CSS, JavaScript
|
ประวัติการแก้ไข 2022-01-11 11:31:32
|
|
|
|
|
Date :
2022-01-11 11:29:41 |
By :
seetai |
View :
778 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตรวจสอบ Query และ Class tab element ดูก่อนครับว่าการแสดงผลกำหนดค่าในการแสดงผลพลาดตรงไหน
|
|
|
|
|
Date :
2022-01-11 21:39:55 |
By :
Manussawin |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|