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

class Galery extends CI_Controller {
	
	public function __construct()
    {
        parent::__construct();
    }
	
	
	public function index($id=null, $judul=null)
	{
		$d['judul'] = "Galery ".$this->config->item('nama_aplikasi_full');
        $d['bawah'] = $this->config->item('footer');
        $d['judul_lengkap'] = $d['judul'];
        $d['kunci'] = "Galery sekolah musik jogja ".$this->config->item('kunci');
        
		
		$this->load->view('theme/at_atas.php',$d);
        $this->load->view('galeri/index.php',$d);
        $this->load->view('theme/at_bawah.php',$d);
	}

	public function profil($id=null, $judul=null)
	{
	          
       
		$d['judul'] = "Gallery ".$this->config->item('nama_aplikasi_full');
        $d['bawah'] = $this->config->item('footer');
        $d['judul_lengkap'] = $d['judul'];
        $d['kunci'] = "Galery icc, kursus masak, $judul, ".$this->config->item('kunci');
        $d['id'] = $id;
        
        $config['total_rows'] = $this->profil->galeri_hal("where galeri_id='$id'", "");
		$config['per_page'] = 16;
		$config['uri_segment'] = 5;
		$config['full_tag_open'] = '<ul class="pagination margin-top-none">';
		$config['full_tag_close'] = '</ul>';
		$config['prev_link'] = '&lt;';
		$config['prev_tag_open'] = '<li>';
		$config['prev_tag_close'] = '</li>';
		$config['next_link'] = '&gt;';
		$config['next_tag_open'] = '<li>';
		$config['next_tag_close'] = '</li>';
		$config['cur_tag_open'] = '<li class="active"><a href="#">';
		$config['cur_tag_close'] = '</a></li>';
		$config['num_tag_open'] = '<li>';
		$config['num_tag_close'] = '</li>';
		 
		$config['first_tag_open'] = '<li>';
		$config['first_tag_close'] = '</li>';
		$config['last_tag_open'] = '<li>';
		$config['last_tag_close'] = '</li>';
		 
		$config['first_link'] = '&lt;&lt;';
		$config['last_link'] = '&gt;&gt;';
		$config['base_url'] = base_url()."index.php/galery/profil/$id/$judul";
		$this->pagination->initialize($config);
		
		
		
		$hal = $this->uri->segment(5);
		 if($hal==""){
			 $hal=0;
		}
           
        
		$d['page'] = $this->pagination->create_links();
		$d['no'] = $hal;
		//echo"limit $hal, $config[per_page]";exit;
        
        $d['produk'] = $this->profil->galeri_semua("where galeri_id='$id'", "limit $hal, $config[per_page]");
        
        
		$this->load->view('theme/at_atas.php',$d);
        $this->load->view('galeri/at_tampil.php',$d);
        $this->load->view('theme/at_bawah.php',$d);
	}
    
    

	
}
