-
Notifications
You must be signed in to change notification settings - Fork 0
/
component.php
49 lines (41 loc) · 1.63 KB
/
component.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
function components($image,$item_name,$price,$description,$product_id){
?>
<div class="item_box">
<form action="index.php" method="POST">
<div class="item_image">
<img src="<?php echo $image; ?>" alt="Item Image" class="img_responsive img_curve">
</div>
<div class="item_description">
<p><?php echo $item_name;?></p>
<p><?php echo $price;?></p>
<p><?php echo $description;?></p><br>
<input class="lnk" type="submit" name="add" value="Add To Cart">
<input type="hidden" name="product_id" value="<?php echo $product_id;?>">
</div>
</form>
</div>
<?php
}
function cartElement($image,$item_name,$price,$description,$product_id){
?>
<form action="cart.php?action=remove&id=<?php echo $product_id;?>" method="POST">
<div class="carter">
<div class="wrapper">
<div class="item_box1">
<div class="item_image1">
<img src="<?php echo $image;?>" alt="Item Image" class="img_responsive img_curve">
</div>
<div class="item_description1">
<p><?php echo $item_name; ?></p>
<p><?php echo $price; ?></p>
<button type="submit" class="btn btn-success" name="save">SaveForLater</button>
<button type="submit" class="btn btn-danger" name="remove">Remove</button>
</div>
</div>
</form>
<!-- <div class="clear_fix"></div>-->
</div>
<?php
}
?>