<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Pages extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('model_app');
    }
    
    private $table = "page";
    private $table2 = "main_menu";
    private $table3 = "sub_menu";
    private $control = "pages";
    private $view = "frontend/page";

    public function index() {
        
    }
    
    function produk(){
        $key['key_page'] = $this->uri->segment(3);
        $konten = $this->db->get_where($this->table, $key);
        foreach ($konten->result() as $ktn) {
            $title = $ktn->title;
            $desc = $ktn->description;
            $keyword = $ktn->keyword_page;
            $picture = $ktn->picture;
            $content = $ktn->content;
        }
        $data = array(
            'title' => $title,
            'meta_desc' => $desc,
            'met_key' => $keyword,
            'picture' => $picture,
            'content' => $content,
            'home' => "transparent",
            "menu" => $this->db->get_where($this->table2, $key),
        );
        renderFront("$this->view/konten", $data);
    }
    
    function sub_produk(){
        $key['key_page'] = $this->uri->segment(3);
        $konten = $this->db->get_where($this->table, $key);
        foreach ($konten->result() as $ktn) {
            $title = $ktn->title;
            $desc = $ktn->description;
            $keyword = $ktn->keyword_page;
            $picture = $ktn->picture;
            $content = $ktn->content;
        }
        $data = array(
            'title' => $title,
            'meta_desc' => $desc,
            'met_key' => $keyword,
            'picture' => $picture,
            'content' => $content,
            'home' => "transparent",
            "sub_menu" => $this->db->get_where($this->table3, $key),
        );
        renderFront("$this->view/sub_konten", $data);
    }

}

/* End of file pages.php */
/* Location: ./application/controllers/pages.php */