-
Notifications
You must be signed in to change notification settings - Fork 5
/
veg.php
executable file
·111 lines (93 loc) · 3.63 KB
/
veg.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
<?php
$title="Search result";
include'header.php';
?>
<div class="mens">
<div class="main">
<div class="wrap">
<div class="cont span_2_of_3">
<h2 class="head">Search result</h2>
<div class="top-box">
<?php
if(isset($_GET['search']))
{
$p_search = $_GET['name'];
$count = 0;
$sql = "SELECT * FROM t_product WHERE p_name like '%{$p_search}%' OR p_desc like '%{$p_search}%'";
$res1 = mysql_query($sql);
while ($row = mysql_fetch_array($res1))
{
if($count>=3)
{
echo "
<div class='top-box'>
<div class='col_1_of_3 span_1_of_3'>
<a href=\"single.php?product={$row['p_id']}\">
<div class='inner_content clearfix'>
<div class='product_image'>
<img src='Supplier/{$row['p_img']}'/>
</div>
<div class='sale-box'><span class='on_sale title_shop'>New</span></div>
<div class='price'>
<div class='cart-left'>
<p class='title'>{$row['p_name']}</p>
<div class='price1'>
<span class='actual'>Rs. {$row['p_price']}</span>
</div>
</div>
</a>
<a href ='#'><div class='cart-right'> </div></a>
<div class='clear'></div>
</div>
</div>
</div>
</div>
";
$count=$count-1;
}
else
{
echo "
<div class='col_1_of_3 span_1_of_3'>
<a href=\"single.php?product={$row['p_id']}\">
<div class='inner_content clearfix'>
<div class='product_image'>
<img src='Supplier/{$row['p_img']}'/>
</div>
<div class='sale-box'><span class='on_sale title_shop'>New</span></div>
<div class='price'>
<div class='cart-left'>
<p class='title'>{$row['p_name']}</p>
<div class='price1'>
<span class='actual'>Rs. {$row['p_price']}</span>
</div>
</div>
</a>
<a href ='#'><div class='cart-right'> </div></a>
<div class='clear'></div>
</div>
</div>
</div>
";
$count=$count+1;
}
}
}
else{
echo '<script language="javascript">';
echo 'alert("Unable to search..."); location.href="index.php"';
echo '</script>';
}
?>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<script src="js/jquery.easydropdown.js"></script>
<?php
include 'includes/footer.php';
?>
</body>
</html>