<?php
	class Hc_media_model extends MY_Model {
		protected $_table_name = 'hc_media';
		protected $_order_by = 'hc_media.id';
		public $limit = 12;

		public function __construct(){
			parent::__construct();
		}

		public function get_media_model_data($offset, $search_param = ""){

	    	$this->db->order_by('id', 'desc');
	    	if($search_param){
	    		$this->db->where("file_name LIKE '%".$search_param."%'");
	    	}
	        $this->db->where("is_active = 1");
	        $this->db->limit($this->limit, $offset);
	        $media_content = $this->media->get();

	        return $media_content;
	    }

	    public function get_media_count(){
	    	$this->db->order_by('id', 'desc');
	        $this->db->where("is_active = 1");
	        $total_count = $this->media->get_count();

	        return $total_count;
	    }
	}
?>