<?php 
class Licence_Controller extends Base_Controller{
	function __construct(){
		parent::__construct();
		$this->licence	=	new Licence_Model();
	}
	function index($page=1,$showlines=30){
		$result	=	$this->licence->get($page,$showlines);
		$pagecfg['total_items']			=	$result->count();
		$pagecfg['current_page']		=	$page;
		$pagecfg['items_per_page']		=	$showlines;
		$pagecfg['base_url']			=	BASEURI."licence/index";
		$this->pagination				=	new Pagination($pagecfg);
		$this->view						=	new View("licence/list");
		$this->view->licences			=	$result->result_array();
		$this->display();
	}
	function delete($licenceid=0){
		if($this->input->post()){
			$licenceids	=	$this->input->post("select_id");
		}
		else{
			$licenceids	=	$licenceid;
		}
		$this->licence->delete($licenceids);
		unset($_POST);
		$this->index();
	}
}