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

class Log extends CI_Controller
{
	public function __construct()
	{
		parent::__construct();

		if (isset($this->session->id_user) == false) {
			redirect(base_url('Auth'));
		}
		$this->load->model('M_pengaturan');
	}

	public function index()
	{
		$tpclog = $this->load->database('log', TRUE);
		//$datalog = $tpclog->get('tpc_log', 10, 20)->result_array();
		$datalog = $tpclog->query("select * from tpc_log order by dtCreate desc limit 20,10;")->result_array();
		echo json_encode($datalog);
	}


}
