<?php
if(!defined("BASE_DIR")) exit;
if(!perm('polls'))
{
	no_perm();
} else {
	
	include_once(BASE_DIR . 'admin/class/class.poll.php');
	$poll = new Poll;
	
	$_REQUEST['sub'] = (isset($_REQUEST['sub']) && !empty($_REQUEST['sub'])) ? $_REQUEST['sub'] : 'overview';
	switch($_REQUEST['sub'])
	{
		case 'overview':
			$poll->Overview();
		break;
		
		case 'edit':
			$poll->Edit($_REQUEST['id']);
		break;
		
		case 'new':
			$poll->NewPoll();
		break;
		
		case 'delete':
			$poll->DeletePoll($_REQUEST['id']);
		break;
		
		case 'openclose':
			$poll->OpenClose($_REQUEST['id'],$_REQUEST['op']);
		break;
		
		case 'delstats':
			$poll->DelStats($_REQUEST['id']);
		break;
	}
}
?>
		