<?php namespace App\Controllers;

class Download extends FrontController
{	
	public function index(){
		$data['meta_data']['title'] = "";
		$data['meta_data']['description'] = "";
		$data['meta_data']['keywords'] = "";
		$data['download_list'] = $this->get_download_list();
		echo $this->view_inner_template('download',$data);
	}
	
	private function get_download_list(){
		$builder = $this->cmObj->get_table_builder('download AS d');
		$query = $builder->join('icon AS i',"d.icon_id=i.icon_id",'left')
			->select('d.download_id, 
				d.title,
				d.document_file,
				d.upload_type,
				i.icon_file')
			->where('d.status','Active')
			->where('d.is_deleted','No')
			->orderBy('d.download_id','DESC')
			->get();
		return $query->getResultArray();
	}
}