-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct-details.php
148 lines (143 loc) · 4.14 KB
/
product-details.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
include_once("includes/header.php");
if($_REQUEST[product_id])
{
$SQL="SELECT * FROM `art`, `Artists`, `type` WHERE product_type_id = type_id AND product_company_id = company_id AND product_id = ".$_REQUEST[product_id];
$rs=mysqli_query($con,$SQL) or die(mysqli_error($con));
$data=mysqli_fetch_assoc($rs);
}
$SQL="SELECT * FROM `art`, `Artists`, `type` WHERE product_type_id = type_id AND product_company_id = company_id AND type_id = ".$data[type_id];
$product_rs=mysqli_query($con,$SQL) or die(mysqli_error($con));
?>
<script>
function goToPage(product_id, product_cost)
{
location.href = "lib/cart.php?act=save_item&product_id="+product_id+"&cost="+product_cost;
}
</script>
<div class="crumb">
</div>
<div class="clear"></div>
<div id="content_sec">
<div class="col1">
<div class="contact">
<h4 class="heading colr"><?=$data[product_name]?> Details</h4>
<?php
if($_REQUEST['msg']) {
?>
<div class="msg"><?=$_REQUEST['msg']?></div>
<?php
}
?>
<div id="myrow">
<table>
<tr>
<th>Art ID</th>
<td><?=$data[product_id]?></td>
</tr>
<tr>
<th>Art Name</th>
<td><?=$data[product_name]?></td>
</tr>
<tr>
<th>Artist Name</th>
<td><?=$data[artist_name]?></td>
</tr>
<tr>
<th>Artist Id</th>
<td><?=$data[artist_id]?></td>
</tr>
<tr>
<th>Artist Description</th>
<td><?=$data[artist_desc]?></td>
</tr>
<tr>
<th>Art Type</th>
<td><?=$data[type_name]?></td>
</tr>
<tr>
<th>Art Name</th>
<td><?=$data[product_name]?></td>
</tr>
<tr>
<th>Art Category</th>
<td><?=$data[company_name]?></td>
</tr>
<tr>
<th>Art Price</th>
<td><?=$data[product_price]?></td>
</tr>
<tr>
<th>Art Description</th>
<td><?=$data[product_description]?></td>
</tr>
<tr>
<th>Stock</th>
<td><?=$data[product_stock]?></td>
</tr>
</table>
<div style="text-align:right; margin-top: 33px;">
<?php
$stock = $data['product_stock'];
// echo $stock;
if ($stock <= 0) {
echo "Out of Stock";
}
else {
echo '<a href="#" onClick="goToPage('.$data['product_id'].','.$data['product_price'].')" class="button-link">Add to Cart</a>';
}
?>
</div>
</div><br><br>
<h4 class="heading colr">All Related Arts</h4>
<div class="static">
<table>
<?php
$sr_no=1;
while($product_data = mysqli_fetch_assoc($product_rs))
{
?>
<tr>
<td><a href="product-details.php?product_id=<?php echo $product_data[product_id] ?>"><img src="<?=$SERVER_PATH.'uploads/'.$product_data[product_image]?>" style="height:170px; width:150px"></a></td>
<td style="vertical-align:top">
<table border="0">
<tr>
<td class="tdheading">Art ID</th>
<td><?=$product_data[product_id]?></td>
</tr>
<tr>
<td class="tdheading">Art Name</th>
<td><?=$product_data[product_name]?></td>
</tr>
<tr>
<td class="tdheading">Art Type</th>
<td><?=$product_data[type_name]?></td>
</tr>
<tr>
<td class="tdheading">Category</th>
<td><?=$product_data[company_name]?></td>
</tr>
<tr>
<td class="tdheading">Price</th>
<td><?=$product_data[product_price]?></td>
</tr>
<tr>
<td colspan="2" style="text-align:center; padding:12px;">
<a href="product-details.php?product_id=<?php echo $product_data[product_id] ?>" class="button-link">View Details</a>
<a href="#" onClick="goToPage(<?=$data[product_id]?>,<?=$data[product_price]?>)" class="button-link">Add to Cart</a>
</td>
</tr>
</table>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
<div class="col2">
<h4 class="heading colr">Art <?=$data['product_name']?></h4>
<div><img src="<?=$SERVER_PATH.'uploads/'.$data[product_image]?>" style="width: 250px"></div><br>
</div>
</div>
<?php include_once("includes/footer.php"); ?>