<?php

/**
 *--------------------------------------
 * cache
 *--------------------------------------
 * @project		: loga
 * @author		: cblee
 * @created		: 2016-07-01
 * @copyright	: (c)2016 AsThis
 *--------------------------------------
 */
defined('PFA_PATH') or exit('Access Denied');

class CacheModl extends Modl {
	public function __construct() {
		$this->autoCheckFields = false;
		parent::__construct();
	}

	/* show progress. $barLength: % */
	public function show_progress($msg, $barLength = '50') {
		echo '<script>show_progress("'.$msg.'", "'.$barLength.'%");</script>';
		@ob_flush();
		@flush();
	}

	/* show direction */
	public function show_direction($nextUrl, $show = false, $timeout = 0) {
		if($show) {
			echo '<script>show_direction("'.$nextUrl.'")</script>';
		}
		echo '<script>window.setTimeout("window.location=\''.$nextUrl.'\'", '.($timeout * 1000).');</script>';
		@ob_flush();
		@flush();
	}
}

?>