<?php
class pollresultsAction extends security_normal {
	
	function action(){
		$pid=ceil($this->_getParamId(1));
		$pollcategory=new model_Pollcategory();
		$pollcategory->setSubsection('WHERE isvisible=0 AND pollcategory_id='.$pid);
		$PollCategoryRS=$pollcategory->doSelectOne();
		if(!$PollCategoryRS){
			$jsstring='Dialog.alert("对不起,您查看的投票不存在或已经被删除",function(){history.back(-1);});';
			MessageBox($jsstring);
			exit;
		}

		if($PollCategoryRS->getIsopen()!=0){
			$jsstring='Dialog.alert("对不起,此投票不允许查看投票结果",function(){history.back(-1);});';
			MessageBox($jsstring);
			exit;
		}

		$smarty = new Smarty();
		$smarty->load_filter('pre','micePreCompileIndex');
		$smarty->assign('PollCategoryRS',$PollCategoryRS);
		$smarty->assign("PollID",$pid);

		$filename = new getTPLFileName(__CLASS__);
		$tpl=$filename->TPLFileName;
		$smarty->display($tpl);
	}	
}
?>