-
Notifications
You must be signed in to change notification settings - Fork 0
/
products.php
119 lines (113 loc) · 3.87 KB
/
products.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
<?php
include("includes/header.php");
include("includes/conn.php");
if(isset($_GET[type]))
{
$results = mysqli_query($con,"select * from products where product_type=$_GET[type]");
}
else
{
$results = mysqli_query($con,"select * from products");
}
?>
<div id="templatemo_main">
<div id="sidebar" class="float_l">
<div class="sidebar_box"><span class="bottom"></span>
<?php
include("sidebar.php");
products(1);
?>
</div>
</div>
<div id="templatemo_main">
<div id="sidebar" class="float_l">
<?php
include("cssidebar.php");
?>
</div>
<div id="content" class="float_r">
<h1>New Products</h1>
<?php
$i=0;
while($ros = mysqli_fetch_array($results))
{
if($ros[image]=="")
{
$img = "upload/noimage.jpg";
}
else
{
$img = "upload/".$ros[image];
}
if($i==0)
{
?>
<div class="product_box"><a href="productdetail.php?proid=<?php echo $ros[prod_id]; ?>&testids=<?php echo $_GET[testids]; ?>">
<a href="productdetail.php?proid=<?php echo $ros[prod_id]; ?>&testids=<?php echo $_GET[testids]; ?>">
<a href="productdetail.php?proid=<?php echo $ros[prod_id]; ?>&testids=<?php echo $_GET[testids]; ?>">
<a href="productdetail.php?proid=<?php echo $ros[prod_id]; ?>&testids=<?php echo $_GET[testids]; ?>">
<img src="<?php echo $img; ?>" alt="Image 02" height="150" width="200"/></a></a></a></a>
<h3><?php echo "Name: ". $ros["name"]; ?></h3>
<p class="product_price">Rs. <?php echo $ros["cost"]; ?></p>
<?php
if($_SESSION["logtype"]==Administrator)
{
?>
<a href="shoppingcart.php?proid=<?php echo $ros[prod_id]; ?>&testids=<?php echo $_GET[testids]; ?>" class="add_to_card">Order</a>
<?php
}
?>
<a href="productdetail.php?proid=<?php echo $ros[prod_id]; ?>&testids=<?php echo $_GET[testids]; ?>" class="detail">Product Detail</a>
</div>
<?php
$i=1;
}
else if($i==1)
{
?>
<div class="product_box">
<a href="productdetail.php?proid=<?php echo $ros[prod_id]; ?>"><img src="<?php echo $img; ?>" alt="Image 02" height="150" width="200"/></a>
<h3>Name : <?php echo $ros["name"]; ?></h3>
<p class="product_price">Rs. <?php echo $ros["cost"]; ?></p>
<?php
if($_SESSION["logtype"]==Administrator)
{
?>
<a href="shoppingcart.php?proid=<?php echo $ros[prod_id]; ?>&testids=<?php echo $_GET[testids]; ?>" class="add_to_card">Order</a>
<?php
}
?>
<a href="productdetail.php?proid=<?php echo $ros[prod_id]; ?>&testids=<?php echo $_GET[testids]; ?>" class="detail">Product Detail</a>
</div>
<?php
$i=2;
}
else if($i==2)
{
?>
<div class="product_box no_margin_right">
<a href="productdetail.php?proid=<?php echo $ros[prod_id]; ?>"><img src="<?php echo $img; ?>" alt="Image 02" height="150" width="200"/></a>
<h3>Name : <?php echo $ros["name"]; ?></h3>
<p class="product_price">Rs. <?php echo $ros["cost"]; ?></p> <?php
if($_SESSION["logtype"]==Administrator)
{
?>
<a href="shoppingcart.php?proid=<?php echo $ros[prod_id]; ?>" class="add_to_card">Order</a>
<?php
}
?>
<a href="productdetail.php?proid=<?php echo $ros[prod_id]; ?>" class="detail">Product Detail</a>
</div>
<?php
$i=0;
}
?>
<?php
}
?>
</div>
<div class="cleaner"></div>
</div>
<?php
include("includes/footer.php");
?>