|
|
|
อัพขึ้น 000webhost แล้วเกิด HTTP ERROR 500 ควรแก้ยังไงดีครับ |
|
|
|
|
|
|
|
<?php require_once('header.php'); ?>
<section class="content-header">
<div class="content-header-left">
<h1>ข้อมูลสินค้า</h1>
</div>
<div class="content-header-left">
<a href="product-add.php" class="btn btn-info btn-sm "> เพิ่มสินค้า <i class="fa fa-plus" aria-hidden="true"></a></i>
</div>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box box-info">
<div class="box-body table-responsive">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th width="30">ลำดับ</th>
<th>รูปถาพ</th>
<th width="300">ชื่อสินค้า</th>
<th width="80">ราคาเก่า</th>
<th width="90">ราคาปัจจุบัน</th>
<th width="100">จำนวนสินค้า</th>
<th width="150">ให้สินค้าเป็นจุดเด่น?</th>
<th width="100">ให้โชว์สินค้า?</th>
<th width="100">ประเภทสินค้า</th>
<th width="100">Action</th>
</tr>
</thead>
<tbody>
<?php
$query = "SELECT
pd.prd_id,
pd.prd_name,
pd.prd_price,
pd.prd_old,
pd.prd_stock,
pd.prd_photo,
pd.prd_is_featured,
pd.prd_is_active,
pd.subcategory_id,
st.subcategory_id,
st.subcategory_name,
ct.category_id,
ct.category_name,
pt.type_id,
pt.type_name
FROM product pd
JOIN subcategory st
ON pd.subcategory_id = st.subcategory_id
JOIN category ct
ON st.category_id = ct.category_id
JOIN product_type pt
ON ct.type_id = pt.type_id
ORDER BY pd.prd_id asc"or die("Error:" . mysqli_error());
$result = mysqli_query($connect, $query);
$i=0;
while($row = mysqli_fetch_array($result)) {
$i++;
?>
<tr>
<td><?php echo $i; ?></td>
<td style="width:130px;"><?php
if(!$row['prd_photo']==""){ ?>
<center><a href="product/image_product/<?php echo $row['prd_photo']; ?>" rel="lightbox" title="<?php echo $row['prd_photo']; ?>" >
<img class="photo" src="product/image_product/<?php echo $row['prd_photo']; ?>" width="70" height="90" border="0" /></a>
</center> <? }else{ ?>
<center><a href="product/image_product/photo.jpg" rel="lightbox" title="รอรูปสินค้า" width="70" height="90" border="0"> <img class="photo" src="product/image_product/photo.jpg" width="70" height="90" border="0" /> </a>
</center><? } ?></td>
<td><?php echo $row['prd_name']; ?></td>
<td><?php echo $row['prd_old']; ?></td>
<td><?php echo $row['prd_price']; ?></td>
<td><?php echo $row['prd_stock']; ?></td>
<td>
<?php if($row['prd_is_featured'] == 1) {echo 'ใช่';} else {echo 'ไม่';} ?>
</td>
<td>
<?php if($row['prd_is_active'] == 1) {echo 'ใช่';} else {echo 'ไม่';} ?>
</td>
<td><B>ประเภทสินค้า : </B><?php echo $row['type_name']; ?><br><B>หมวดหมู่หลัก : </B><?php echo $row['category_name']; ?><br><B>หมวดหมู่ย่อย : </B><?php echo $row['subcategory_name']; ?></td>
<td>
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">เพิ่มเติ่ม
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li> <a href="product-edit.php?id=<?php echo $row['prd_id']; ?>" a class="dropdown-item fa fa-edit edit_data" > แก้ไข</a> </li>
<li> <a name="del" value="del" id="<?php echo $row["prd_id"]; ?>" a class="dropdown-item fa fa-trash del_data" > ลบข้อมูล</a></li>
</ul>
</div>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
<!-- #############################################ลบข้อมูล########################################################################## -->
<form method="post" id="del_form" action="product/product-delete-db.php">
<div class="modal fade" id="dataModal_del" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">ยืนยันการลบ</h4>
</div>
<!-- <div class="modal-body" id="member_detail_del">
</div> -->
<div class="modal-body" id="delete_detalis">
<br />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-danger" id="del">DELETE</button>
</div>
</div>
</div>
</div>
</form>
<!-- #############################################ลบข้อมูล########################################################################## -->
<?php;
include('product/script.php');
?>
<?php require_once('footer.php'); ?>
Tag : PHP
|
|
|
|
|
|
Date :
2020-04-01 19:24:22 |
By :
Sarun003 |
View :
985 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|