-
Notifications
You must be signed in to change notification settings - Fork 0
/
blog.php
61 lines (45 loc) · 1.53 KB
/
blog.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
<?php include("securearea.php"); ?>
<?php
class Blog extends Securearea
{
function __construct() {
parent::__construct();
$this->load->model('admin/blogs_model');
}
public function index()
{
$this->loadHeader($this,FALSE,"Blog");
// $this->loadSidebar($this);
$data['blogs_data'] = $this->blogs_model->getAllData();
$this->load->view("blogs_grid_view",$data);
$this->loadFooter($this);
}
public function viewBlog($prod_name = "",$second = "",$prod_id = "")
{
if(is_numeric($second))
{
$this->$prod_name($second);die;
}
$this->productname = removehyphens(urldecode($prod_name));
$this->product = $this->blogs_model->getProduct("","","AND blog_name = '".$this->productname."'");
//echo "<pre>";print_r($this->product);die;
if($this->product)
{
$this->product = $this->product[0];
//echo "<pre>";print_r($this->product);die;
//load header
$this->loadHeader($this,"",removehyphens($prod_name));
//load middle content
$view["obj"] = $this;
$view['userdata'] = $this->userData;
$this->load->view('single_blog_view',$view);
//load footer
$this->loadFooter($this);
}
else
{
redirect(base_url(),"refresh");
}
}
}
?>