|
|
|
ช่วยด้วยครับจะส่งค่าผ่านปุ่มครับแล้วหน้าจอไม่แสดงข้อมูลครับ |
|
|
|
|
|
|
|
ไม่มีโค้ด ไม่มีเหตุ จะเอาผลลัพธิ์เลย ช่วยยากมากเลยครับ
|
|
|
|
|
Date :
2018-08-15 18:20:47 |
By :
arm8957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลืมแนบครับขอโทษด้วยครับ
Code
<?php
session_start();
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://fonts.googleapis.com/css?family=Sriracha" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Prompt:300" rel="stylesheet">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.5.0/css/mdb.min.css" rel="stylesheet">
<link rel="stylesheet" href="../css/bgcover.css">
<link rel="stylesheet" href="../css/contentindex.css">
<link rel="stylesheet" href="../css/datatables.css">
<link rel="stylesheet" href="../css/fontbg.css">
<title>เว็บไซต์ศูนย์ข้อมูลเพื่อเรียนรู้คุณค่าของสมุนไพรไทย</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar navbar-dark " style="background-color: #000000;">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-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 mr-auto">
<li class="nav-item">
<a class="nav-link" href="index.php">หน้าหลัก </a>
</li>
<li class="nav-item active">
<a class="nav-link" href="admin_herb-info.php">จัดการข้อมูลสมุนไพร </a>
</li>
<li class="nav-item">
<a class="nav-link" href="admin_relief-herbal.php">จัดการอาการที่ใช้สมุนไพรในการบรรเทา</a>
</li>
<li class="nav-item">
<a class="nav-link" href="admin_blog.php">จัดการบทความ</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="../php/logout.php">ออกจากระบบ</a>
</li>
</ul>
</div>
</nav>
<section class="bgimage">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<h1 class="font" style="font-size: 60px;">เว็บไซต์ศูนย์ข้อมูลเพื่อเรียนรู้คุณค่าของสมุนไพรไทย</h1>
</div>
</div>
<p class="fontbg"style="text-align:right;color:white;margin-top:165px;opacity:0.5;"> รูปภาพโดย : Tim Chow </p>
</div>
</section>
<!--content -->
<div class="container" id="contentindex">
<div class="row">
<div class="col-sm-4">
</div>
<div class="col-sm-4" style="text-align: center;margin-top: 50px;margin-bottom:30px;">
<h1>ข้อมูลสมุนไพร</h1>
</div>
<div class="col-sm-4">
</div>
</div>
</div>
<!--Data tables -->
<div class="container">
<div class="row col-md-12 ">
<table class="table table-hover" id="filterme">
<thead>
<!--search-->
<?php
require '../php/condb.php';
$perpage = 10;
if (isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = 1;
}
if (isset($_POST['search'])) {
$search = '%' . $_POST['search'] . '%';
} else {
$search = '%';
}
$start = ($page - 1) * $perpage;
//search //
$sql = "SELECT herbal.*,herb_howto.herb_howto_id FROM herbal,herb_howto WHERE herb_name LIKE '$search' ORDER BY `herb_name` ASC LIMIT {$start} , {$perpage} ";
$result1 = mysqli_query($condb, $sql);
?>
<!--searchbox-->
<div class="container">
<div class="row">
<div class="col-sm-3"><a href="form_herb-info.php" class="btn btn-primary btn-xs pull-right" style="margin-bottom: 30px"><b>+</b> เพิ่มข้อมูลสมุนไพร</a></div>
<div class="col-sm-4"></div>
<div class="col-sm-5">
<div class="input-group input-group-sm mb-3">
<form action="admin_herb-info.php?page=<?php echo $page;?>" method="post">
<input class="form-control " type="text"name="search" placeholder="Search" aria-label="Search"></input>
<div class="input-group-append">
<button type="submit" class="btn btn-primary">ค้นหาข้อมูล</button>
</div>
</div>
</div>
</div>
</div>
<!--searchbox-->
<tr>
<th class="text-center" style="font-size:20px">#</th>
<th class="text-center"style="font-size:20px">ชื่อสมุนไพร</th>
<th class="text-center" style="font-size:20px">Option</th>
</tr>
</thead>
<tbody>
<!-- pagination -->
<?php
while ($row = mysqli_fetch_array($result1, MYSQLI_ASSOC)) {
?>
<tr>
<th class="text-center"style="font-size:20px" > <?php echo $row['herbal_id'];?> </th>
<td class="text-center"style="font-size:20px" > <?php echo $row['herb_name']; ?> </td>
<td class="text-center"style="font-size:20px" ><a style="margin-right:15px;" class='btn btn-outline-primary btn-sm' href="edit_form_herb-info.php?herbal_id=<?php echo $row['herbal_id'];?>&herb_howto_id=<?php echo $row['herb_howto_id'];?>"><span class="glyphicon glyphicon-edit"></span> แก้ไข</a><a href="../php/del_herb-info.php?herbal_id=<?php echo $row['herbal_id'];?>" class="btn btn-outline-danger btn-sm"><span class="glyphicon glyphicon-remove"></span> ลบ</a></td>
</tr>
<?php
}
mysqli_free_result($result1);
mysqli_close($condb);
?>
</tbody>
</table>
</div>
</div>
<!--search-->
<?php
require '../php/condb.php';
$sql2 = "select * from herbal WHERE herb_name LIKE '$search'";
$result2 = mysqli_query($condb, $sql2);
$total_record = mysqli_num_rows($result2);
$total_page = ceil($total_record / $perpage);
?>
<!--searchbox-->
<!-- Pagination-->
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center">
<li class="page-item">
<a class="page-link" href="admin_herb-info.php?page=1" tabindex="-1">Previous</a>
</li>
<?php for($i=1;$i<=$total_page;$i++){ ?>
<li class="page-item">
<a class="page-link" href="admin_herb-info.php?page=<?php echo $i; ?>"><?php echo $i; ?></a>
</li>
<?php } ?>
<li class="page-item">
<a class="page-link" href="admin_herb-info.php?page=<?php echo $total_page;?>">Next</a>
</li>
</ul>
</nav>
<footer class="page-footer font-small stylish-color-dark pt-4 mt-4">
<!-- Copyright -->
<div class="footer-copyright text-center py-3"></a>
</div>
<!-- Copyright -->
</footer>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
</html>
|
ประวัติการแก้ไข 2018-08-15 18:41:10
|
|
|
|
Date :
2018-08-15 18:40:08 |
By :
pencil447 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตอบความคิดเห็นที่ : 3 เขียนโดย : pencil447 เมื่อวันที่ 2018-08-15 18:52:09
รายละเอียดของการตอบ ::
Code (SQL)
<?php
session_start();
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://fonts.googleapis.com/css?family=Sriracha" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Prompt:300" rel="stylesheet">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.5.0/css/mdb.min.css" rel="stylesheet">
<link rel="stylesheet" href="../css/bgcover.css">
<link rel="stylesheet" href="../css/contentindex.css">
<link rel="stylesheet" href="../css/datatables.css">
<link rel="stylesheet" href="../css/fontbg.css">
<title>เว็บไซต์ศูนย์ข้อมูลเพื่อเรียนรู้คุณค่าของสมุนไพรไทย</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar navbar-dark " style="background-color: #000000;">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-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 mr-auto">
<li class="nav-item">
<a class="nav-link" href="index.php">หน้าหลัก </a>
</li>
<li class="nav-item active">
<a class="nav-link" href="admin_herb-info.php">จัดการข้อมูลสมุนไพร </a>
</li>
<li class="nav-item">
<a class="nav-link" href="admin_relief-herbal.php">จัดการอาการที่ใช้สมุนไพรในการบรรเทา</a>
</li>
<li class="nav-item">
<a class="nav-link" href="admin_blog.php">จัดการบทความ</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="../php/logout.php">ออกจากระบบ</a>
</li>
</ul>
</div>
</nav>
<section class="bgimage">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<h1 class="font" style="font-size: 60px;">เว็บไซต์ศูนย์ข้อมูลเพื่อเรียนรู้คุณค่าของสมุนไพรไทย</h1>
</div>
</div>
<p class="fontbg"style="text-align:right;color:white;margin-top:165px;opacity:0.5;"> รูปภาพโดย : Tim Chow </p>
</div>
</section>
<!--content -->
<div class="container" id="contentindex">
<div class="row">
<div class="col-sm-4">
</div>
<div class="col-sm-4" style="text-align: center;margin-top: 50px;margin-bottom:30px;">
<h1>ข้อมูลสมุนไพร</h1>
</div>
<div class="col-sm-4">
</div>
</div>
</div>
<!--Data tables -->
<div class="container">
<div class="row col-md-12 ">
<table class="table table-hover" id="filterme">
<thead>
<!--search-->
<?php
require '../php/condb.php';
$perpage = 10;
if (isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = 1;
}
if (isset($_POST['search'])) {
$search = '%' . $_POST['search'] . '%';
} else {
$search = '%';
}
$start = ($page - 1) * $perpage;
//search //
$sql = "SELECT herbal.*,herb_howto.herb_howto_id FROM herbal,herb_howto WHERE herb_name LIKE '$search' ORDER BY `herb_name` ASC LIMIT {$start} , {$perpage} ";
$result1 = mysqli_query($condb, $sql);
?>
<!--searchbox-->
<div class="container">
<div class="row">
<div class="col-sm-3"><a href="form_herb-info.php" class="btn btn-primary btn-xs pull-right" style="margin-bottom: 30px"><b>+</b> เพิ่มข้อมูลสมุนไพร</a></div>
<div class="col-sm-4"></div>
<div class="col-sm-5">
<div class="input-group input-group-sm mb-3">
<form action="admin_herb-info.php?page=<?php echo $page;?>" method="post">
<input class="form-control " type="text"name="search" placeholder="Search" aria-label="Search"></input>
<div class="input-group-append">
<button type="submit" class="btn btn-primary">ค้นหาข้อมูล</button>
</div>
</div>
</div>
</div>
</div>
<!--searchbox-->
<tr>
<th class="text-center" style="font-size:20px">#</th>
<th class="text-center"style="font-size:20px">ชื่อสมุนไพร</th>
<th class="text-center" style="font-size:20px">Option</th>
</tr>
</thead>
<tbody>
<!-- pagination -->
<?php
while ($row = mysqli_fetch_array($result1, MYSQLI_ASSOC)) {
?>
<tr>
<th class="text-center"style="font-size:20px" > <?php echo $row['herbal_id'];?> </th>
<td class="text-center"style="font-size:20px" > <?php echo $row['herb_name']; ?> </td>
<td class="text-center"style="font-size:20px" ><a style="margin-right:15px;" class='btn btn-outline-primary btn-sm' href="edit_form_herb-info.php?herbal_id=<?php echo $row['herbal_id'];?>&&herb_howto_id=<?php echo $row['herb_howto_id'];?>"><span class="glyphicon glyphicon-edit"></span> แก้ไข</a><a href="../php/del_herb-info.php?herbal_id=<?php echo $row['herbal_id'];?>" class="btn btn-outline-danger btn-sm"><span class="glyphicon glyphicon-remove"></span> ลบ</a></td>
</tr>
<?php
}
mysqli_free_result($result1);
mysqli_close($condb);
?>
</tbody>
</table>
</div>
</div>
<!--search-->
<?php
require '../php/condb.php';
$sql2 = "select * from herbal WHERE herb_name LIKE '$search'";
$result2 = mysqli_query($condb, $sql2);
$total_record = mysqli_num_rows($result2);
$total_page = ceil($total_record / $perpage);
?>
<!--searchbox-->
<!-- Pagination-->
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center">
<li class="page-item">
<a class="page-link" href="admin_herb-info.php?page=1" tabindex="-1">Previous</a>
</li>
<?php for($i=1;$i<=$total_page;$i++){ ?>
<li class="page-item">
<a class="page-link" href="admin_herb-info.php?page=<?php echo $i; ?>"><?php echo $i; ?></a>
</li>
<?php } ?>
<li class="page-item">
<a class="page-link" href="admin_herb-info.php?page=<?php echo $total_page;?>">Next</a>
</li>
</ul>
</nav>
<footer class="page-footer font-small stylish-color-dark pt-4 mt-4">
<!-- Copyright -->
<div class="footer-copyright text-center py-3"></a>
</div>
<!-- Copyright -->
</footer>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
</html>
|
|
|
|
|
Date :
2018-08-15 18:53:19 |
By :
pencil447 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|