<?php
require_once('../../include/class.inc.php');

$id=$_GET["id"];
$VoteName=intval($_POST["VoteName"]);
$Votetitle=htmlspecialchars($_POST["Votetitle"]);
$totalnum=intval($_POST["totalnum"]);
if($VoteName!="" && $Votetitle!=""){
		$sql="update vote set voteid=$VoteName,Votetitle='$Votetitle',totalnum='$totalnum' where id='$id'";
		//echo $sql;
		//exit;
		$result=$my->data_work($sql); 
		
		if($result)
		{
			echo ("<script type='text/javascript'>alert('修改成功！！');location.href='vote.php';</script>");
		}
		else
		{
			echo ("<script type='text/javascript'>alert('修改失败！请选择投票主题。');location.href='vote_up.php?id=".$id."';</script>");
		}
}

else{
 echo "<script language=javascript>alert('请选择投票主题。');history.go(-1)</script>";
}

?>