<?php
require_once APPPATH . 'libraries/Cf_REST_Controller.php';

class FileChangesWidget extends Cf_REST_Controller
{
    public function statistics_get()
    {
        $changeDays = $_REQUEST['changeDays'];
        $from = date('Y-m-d 00:00:00', strtotime("-$changeDays day"));
        $to = date('Y-m-d 23:59:59', time());
        $result = $this->getRestClient()->get('/file-changes/statistics?fromTime=' . urlencode($from) . '&toTime=' . urlencode($to));
        respond_ok($result);
    }
}
