01.
<style type=
"text/css"
>
02.
.button1{border:1px solid #E4DFDF; width:35.5%;text-align:center;}
03.
.img{height:150px; width:250px;}
04.
</style>
05.
<?php
06.
@session_start();
07.
include
(
"connect.php"
);
08.
$sqli
=
"select * from equipment"
;
09.
$result
= mysqli_query(
$connect
,
$sqli
);
10.
?>
11.
<div
class
=
"wrap"
>
12.
<!--<div ><a href=
"index.php?ref=addCS"
class
=
"button1"
id=
"but"
>เพิ่ม</a></div><br>-->
13.
<?php
$i
=1;
while
(
$data
= mysqli_fetch_array(
$result
)){ ?>
14.
<?php
if
(
$data
[
'eqStatus'
] != 0){?>
15.
<section
class
=
"col-1-3"
><div
class
=
"wrap-col"
>
16.
<div
class
=
"box"
>
17.
<div>
18.
<h2><span><?=
$data
[
'eqName'
]?></span></h2>
19.
<figure><img src=
"<?=$data['eqImage']?>"
class
=
"img"
></figure>
20.
<h2 style=
"color:red;"
>จำนวนคงเหลือ : <span><?=number_format(
$data
[
'eqNumber'
])?></span> <?=
$data
[
'eqDevice_unit'
]?>
21.
<br>ราคาต่อชิ้น : <span><?=number_format(
$data
[
'eqPrice'
])?></span> บาท
22.
<br>จำนวนที่ต้องการเช่า : <input type=
"text"
name=
"txtQty"
id=
"txtQty"
value=
"1"
size=
"1"
/></h2>
23.
<input type=
"hidden"
name=
"txtEqid"
id=
"txtEqid"
value=
"<?php echo $data["
eq_ID
"];?>"
size=
"2"
/>
24.
</p>
25.
<?php
if
(@
$_SESSION
[
'status_type'
] != null){?>
26.
<a href=
"javascript:doSendParams(<?php echo $data['eq_ID']?>,);"
class
=
"button1"
>เลือก</a>
27.
28.
<?php }?>
29.
<!--<a href=
"#"
class
=
"button1"
>รายละเอียด</a>-->
30.
</div>
31.
</div>
32.
</div></section>
33.
<?php }?>
34.
<?php }?>
35.
<script type=
"text/javascript"
>
36.
function
doSendParams(eq_ID){
37.
var
txtEqid = document.getElementById(
"txtEqid"
).value;
38.
var
txtQty = document.getElementById(
"txtQty"
).value;
39.
location.href=
'order.php?eq_ID='
+ eq_ID +
'&txtQty='
+ txtQty;
40.
}
41.
</script>
42.
</div>