001.
<?php
002.
session_start();
003.
include
(
"config/dbconnect.php"
);
004.
?>
005.
<!DOCTYPE html>
006.
<head>
007.
<meta http-equiv=
"Content-Type"
content=
"width=device-width; charset=utf-8"
/>
008.
<link rel=
"stylesheet"
href=
"css/bootstrap.min.css"
>
009.
<link rel=
"stylesheet"
href=
"css/font-awesome.min.css"
>
010.
<link rel=
"stylesheet"
href=
"css/animate.css"
>
011.
<style type=
"text/css"
>
012.
.product_view .modal-dialog{max-width: 800px; width: 100%;}
013.
.pre-cost{text-decoration: line-through; color: #a5a5a5;}
014.
.space-ten{padding: 10px 0;}
015.
</style>
016.
<script src=
"js/jquery-3.2.1.min.js"
></script>
017.
<script src=
"js/bootstrap.min.js"
></script>
018.
<title>GD Systems</title>
019.
</head>
020.
<body>
021.
<legend>แชมพูและครีมนวดผม</legend>
022.
<?php
023.
$sql
=
"SELECT * FROM tb_product WHERE cate_id = 1 "
;
024.
$result
= mysql_query(
$sql
)
or
die
(
$connect
);
025.
while
(
$product
= mysql_fetch_assoc(
$result
))
026.
{
027.
$product_id
=
$product
[
'product_id'
];
028.
$product_name
=
$product
[
'product_name'
];
029.
$product_price
=
$product
[
'product_price'
];
030.
$product_picture
=
$product
[
'product_picture'
];
031.
$product_detail
=
$product
[
'product_detail'
];
032.
?>
033.
<div
class
=
"container"
>
034.
<div
class
=
"row"
>
035.
<div
class
=
"col-md-3 col-sm-6"
>
036.
<span
class
=
"thumbnail"
>
037.
<img src=
"uploadimg/<?php echo $product_picture;?>"
>
038.
<h4><?php
echo
(
"$product_name"
);?></h4>
039.
<div
class
=
"ratings"
>
040.
<span
class
=
"glyphicon glyphicon-star"
></span>
041.
<span
class
=
"glyphicon glyphicon-star"
></span>
042.
<span
class
=
"glyphicon glyphicon-star"
></span>
043.
<span
class
=
"glyphicon glyphicon-star"
></span>
044.
<span
class
=
"glyphicon glyphicon-star-empty"
></span>
045.
</div>
046.
<p><?php
echo
(
"$product_detail"
);?></p>
047.
<hr
class
=
"line"
>
048.
<div
class
=
"row"
>
049.
<div
class
=
"col-md-6 col-sm-6"
>
050.
<p
class
=
"price"
>ราคา <?php
echo
(
"$product_price"
);?> บาท</h4></p>
051.
</div>
052.
<div
class
=
"col-md-6 col-sm-6"
>
053.
<button type=
"button"
class
=
"btn btn-primary"
data-toggle=
"modal"
data-target=
"#view<?php echo product_id;?>"
>หยิบใส่ตะกร้า</button>
054.
</div>
055.
</div>
056.
</span>
057.
</form>
058.
</div>
059.
<?php } ?>
060.
</div>
061.
</div>
062.
063.
<div
class
=
"modal fade product_view"
id=
"view<?php echo product_id;?>"
>
064.
<div
class
=
"modal-dialog"
>
065.
<div
class
=
"modal-content"
>
066.
<div
class
=
"modal-header"
>
067.
<a href=
"#"
data-dismiss=
"modal"
class
=
"class pull-right"
><span
class
=
"glyphicon glyphicon-remove"
></span></a>
068.
<h3
class
=
"modal-title"
>สินค้าที่เลือก</h3>
069.
</div>
070.
<div
class
=
"modal-body"
>
071.
<div
class
=
"row"
>
072.
<div
class
=
"col-md-6 product_img"
>
073.
<img src=
"uploadimg/<?php echo $product_picture;?>"
class
=
"img-responsive"
>
074.
</div>
075.
<div
class
=
"col-md-6 product_content"
>
076.
<h4><?php
echo
(
"$product_name"
);?></h4>
077.
<div
class
=
"rating"
>
078.
<span
class
=
"glyphicon glyphicon-star"
></span>
079.
<span
class
=
"glyphicon glyphicon-star"
></span>
080.
<span
class
=
"glyphicon glyphicon-star"
></span>
081.
<span
class
=
"glyphicon glyphicon-star"
></span>
082.
<span
class
=
"glyphicon glyphicon-star"
></span>
083.
</div>
084.
<p><?php
echo
(
"$product_detail"
);?></p>
085.
<h3
class
=
"cost"
>ราคา <?php
echo
$product_price
;?> บาท <small
class
=
"pre-cost"
></h3>
086.
<div
class
=
"row"
>
087.
<div
class
=
"col-md-4 col-sm-6 col-xs-12"
>
088.
<input type=text
class
=
"form-control"
name=
"qty"
id=
"qty"
>
089.
<P>*ระบุจำนวนที่ต้องการ*</P>
090.
</div>
091.
</div>
092.
<div
class
=
"space-ten"
></div>
093.
<div
class
=
"btn-ground"
>
094.
<button type=
"button"
class
=
"btn btn-primary"
><span
class
=
"glyphicon glyphicon-shopping-cart"
></span> ใส่ตะกร้า </button>
095.
</div>
096.
</div>
097.
</div>
098.
</div>
099.
</div>
100.
</div>
101.
</div>
102.
</body>
103.
</html>