-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategory_dashboard.php
136 lines (105 loc) · 3.16 KB
/
category_dashboard.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
<?php
if(!isset($_SESSION)){
session_start(); // starting session for checking username
}
if(is_null($_SESSION['username']))
{
header("location:index.php"); // Redirect to login.php page
}
?>
<?php require('user_header.php'); ?>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#parent_cat").change(function() {
$(this).after('<div id="loader"><img src="img/loading.gif" alt="loading subcategory" /></div>');
$.get('loadsubcat.php?parent_cat=' + $(this).val(), function(data) {
$("#sub_cat").html(data);
$('#loader').slideUp(200, function() {
$(this).remove();
});
});
});
});
</script>
<div class="page-content">
<div class="row">
<div class="col-lg-8">
<div class="well">
<form action="category_dashboard.php" class="form-inline" method ="GET">
<td>
<select name="select_country" id="parent_cat" class="form-control">
<option value="select item">select category</option>
<?php include"all_category.php";?>
<?php maincat() ?>
</select>
</td>
<td>
<select name="Sub_Category" class="form-control" id="sub_cat">
<option value="select item">select sub category</option>
</select>
</td>
<td><button type="submit" class="btn btn-success" name="save">submit</button></td>
</form>
</div>
</div>
<div class="col-lg-4">
<div class="well">
<form action="final_search.php" class="form-inline">
<td>
<input type="search" name="name"class="form-control" placeholder="Search ..." id="msearch">
<button class="btn btn-success" name="btn">
search
</button>
</td>
</form>
</div>
</div>
</div>
</div>
<div class="page-content">
<div class="row">
<div class="col-lg-12">
<?php
require_once("connection.php");
if (isset($_GET['save']))
{
$select_country = $_GET['select_country'];
$Sub_Category = $_GET['Sub_Category'];
$result = "SELECT * FROM `products` WHERE `category` = '$select_country ' AND `sub_category` = '$Sub_Category' ORDER BY `pro_id` DESC ";
$query = mysql_query ($result) or die (mysql_error());
while ( $count = mysql_fetch_array($query))
{
?>
<div class="col-lg-4">
<div class="well">
<td> <h1><b> <?php echo $count['pro_name'];?></b></h1><br />
<a href=""><?php $file_name = $count['product_image']; echo "<img src=\"profile_image/$file_name\" height=\"200\" width=\"220\" >"; echo"</br>"; echo"<center>".$count['selling_price']."</center>"; ?></a><br />
<input type="submit" name="" class="btn btn-success" value="sell it now" />
<input type="submit" name="" class="btn btn-success" value="details" />
</td>
</div>
</div>
<?php
}
}
?>
</div>
</div>
</div>