-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcategory.php
More file actions
95 lines (82 loc) · 2.72 KB
/
category.php
File metadata and controls
95 lines (82 loc) · 2.72 KB
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
<?php include 'includes/header.php';
//include 'includes/dbcontroller.php';
include 'includes/rb.php';
//$db_handle = new DBController();
////////////////////////////////////////////////////////////////////////REDBEAN
if(!R::testConnection())
{
R::setup('mysql:host=localhost;dbname=ecommerce', 'root', '');
}
if(!empty($_GET['id']))
{
$id=$_GET['id'];
$pages = R::find('categories',' id = ? ', array( $id ));
//var_dump($pages); exit;
if($pages)
{
foreach ($pages as $entry)
{
if($entry['id'])
{
$_SESSION["item_ID"]=$id;
break;
}
}
}
else
{
header('Location:index.php');
exit();
}
//exit();
// } WORKS OKAAAAYYYYYYYYY
}
$ob=R::load('categories',$id);
$ob1=R::load('main_categories',$ob->parent_id);
$pages2 = R::find('items',' category_id = ? ', array( $id ));
?>
<article id="grid">
<div id="breadcrumb"><a href="index.php">Home</a> > <a href=""><?php if(isset($ob1->main_category))echo $ob1->main_category ; ?></a> > <h1><?php if(isset($ob->category_name))echo$ob->category_name ; ?></h1></div>
<header>
<div class="paging">
Page: <a href="">1</a> | 2 | <a href="">3</a> | <a href="">View All</a>
</div>
<form action="#" >
<select onchange="javascript:addSort();" name="sortBy" id="sortBy">
<option value="">Default</option>
<option value="PriceHiLo">Price (High to Low)</option>
<option value="PriceLoHi">Price (Low to High)</option>
<option value="pID">Most Recent</option>
</select> Showing 26 - 50 of 78 Product(s)
</form>
</header>
<ul id="items">
<?php
//$ob2=R::load('items',$id);
foreach($pages2 as $entry)
{
?>
<li>
<a href="item.php?id=<?php echo $entry['id']; ?>">
<img src=<?php echo $entry['pic_path']; ?> alt=""/></a>
<a href="item.php?id=<?php echo $entry['id']; ?>" class="title"><?php echo $entry['name']; ?></a>
<strong>£<?php echo $entry['price']; ?></strong>
</li>
<?php }
?>
</ul>
<footer>
<div class="paging">
Page: <a href="">1</a> | 2 | <a > href="">3</a> | <a > href="">View All</a>
</div>
</footer>
</article>
<footer>
<div class="wrapper">
<span class="logo">Buy2</span>
Sitemap</a> <a href="#">Terms & Conditions</a> <a href="#">Shipping & Returns</a> <a href="#">Size Guide</a><a href="#">Help</a> <br />
Address to said Buy2 comp, including postcode - 1.888.CO.name <a href="">service@Buy2comp.com</a>
</div>
</footer>
</body>
</html>