<?php
class News extends MY_Controller {

        public $selected_news;
        public $news;
    
	function __construct()
	{
		parent::__construct();
		$this->title = $this->lang->line('News');
                
                
	}

	function index($news_id = 0)
	{
            
                $this->load->model('news_model');
                $news_data = $this->news_model->get_all_news();
                if ($news_data->num_rows() > 0) {
                    $this->news = $news_data->result_array();
                } 
                
                $news_data = $this->news_model->get_news_by_id($news_id);
                if ($news_data->num_rows() > 0) {
                    $this->selected_news = $news_data->row_array();
                } 
                
                 parent::renderPage("news");
		
	}

}