<?php
require("session_check.php");	
	require("../foundation/aintegral.php");
	require("../foundation/adata_count.php");
	
	//语言包引入
	$m_langpackage=new modulelp;
	
	//变量区
	if(empty($pid)){
		$pid=intval(short_check(get_argg('poll_id')));
		$sendor_id=intval(short_check(get_argg('sendor_id')));
	}
	$dbo = new dbex;
	dbtarget('w',$dbServs);
	
	//数据表定义区
	$t_users=$tablePreStr."users";
	$t_poll=$tablePreStr."poll";
	$t_polloption=$tablePreStr."polloption";
	$t_polluser=$tablePreStr."polluser";
	$t_poll_com=$tablePreStr."poll_comment";
	
	$sql="delete from $t_poll where p_id=$pid";
	$dbo->exeUpdate($sql);
	$sql="delete from $t_polloption where pid=$pid";
	$dbo->exeUpdate($sql);
	$sql="delete from $t_polluser where pid=$pid";
	$dbo->exeUpdate($sql);
	$sql="delete from $t_poll_com where p_id=$pid";
	$dbo->exeUpdate($sql);
		
	increase_integral($dbo,$int_del_poll,$sendor_id);
	update_count($dbo,$sendor_id,"poll_num",-1);
	//回应信息
	echo $m_langpackage->m_del_suc;
?>