<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

require './vendor/autoload.php';

class View_dok extends CI_Controller {

    public function __construct() {
        parent::__construct();
    }

    public function index(){
      $token = $this->input->get('token');
      $url_file = explode('|', base64_decode($token));
      $url_file = $url_file[1];

      if(!is_null($token)){
		if(file_exists($url_file)){
			force_download($url_file, NULL);
			unlink($url_file);
		}else{
			echo 'Token sudah kadaluarsa';
		}
      }else {
        echo 'gagal';
      }
    }
}
