<?php
/**
 *	Generated by miceCMS
 *	http://www.miceCMS.com/
 */
class poll_delete2Action extends security_login {
	function action(){
		ModuleLimit(__CLASS__);
		global $conn;
		$msg='未删除任何内容';
		$num=0;
		$poll_id=$this->_getParam('poll_id');
		if($poll_id > 0){
			$pollcategory=new model_Poll();
			$pollcategory->setSubsection('WHERE poll_id='.$poll_id);
			$results=$pollcategory->doDelete();
			$num++;
		}elseif(sizeof($_POST['checkbox'])){
			foreach($_POST['checkbox'] as $cid){
				$pollcategory=new model_Poll();
				$pollcategory->setSubsection('WHERE poll_id='.$cid);
				$results=$pollcategory->doDelete();
				$num++;
			}
		}

		

		if($num>0){
			$msg='成功删除'.$num.'条记录';
		}

		$jsstring='Dialog.alert(\''.$msg.'\',function(){window.location.href="'.MICE_URL.'admin.php/poll/index2";window.event.returnValue = false;},300,100,"返回投票选项列表");';
		MessageBox($jsstring);
		exit;
	}
}
?>