<?php

namespace App\Controllers;

use App\Controllers\BaseController;
use CodeIgniter\HTTP\ResponseInterface;
use App\Models\HistoryUsedModel;


class History extends BaseController
{

    private $HistoryUsedModel;

    public function __construct()
    {
        $this->HistoryUsedModel   = new HistoryUsedModel();   
    }

    public function index()
    {
                    
        $data = [
            'title'    => "History"
        ];
        
        return view('app/history/history-css', $data) .
        view('app/history/history', $data) .
        view('app/history/history-js', $data);
    }


    public function get_all_data()
    {

        $this->HistoryUsedModel->draw     = $this->request->getPOST('draw');
        $this->HistoryUsedModel->start    = $this->request->getPOST('start');
        $this->HistoryUsedModel->limit    = $this->request->getPOST('length');
        $this->HistoryUsedModel->search   = $this->request->getPOST('search')['value'];
        $this->HistoryUsedModel->columns  = $this->request->getPOST('columns');
        $this->HistoryUsedModel->order    = $this->request->getPOST('order');

        echo $this->HistoryUsedModel->get_all_data();
    }

}
