<?php 
class ControllerSubscribe extends Controller { 
	function index() {        
	    $request  =& $this->locator->get('request');
		$response =& $this->locator->get('response');
		$database =& $this->locator->get('database');
		$url      =& $this->locator->get('url');
		$language =& $this->locator->get('language');
		$template =& $this->locator->get('template');
		$session  =& $this->locator->get('session');
		$module   =& $this->locator->get('module');
		if($request->isPost()){
			$sql = "insert into subscribe set email = '?', status = '1', addtime =  now()";				
			$results = $database->query($database->parse($sql, $request->get('email','post')));
			echo "<script>alert('Thanks, You have subscribed our newsletter sucessfully.');window.history.back(-1);</script>";
		}
  	}
}
?>

