请问如何在曾加投票确认对话框啊?就是在用户投票后弹出要用户确认是否投当前的票,确定就投取消就撤回。
原来的代码是:
<?php if($cData[0]["vtype"] == 1)
{
$sql_c = " SELECT SUM(vresult = 1) AS y ,SUM(vresult = 0) AS n,SUM(vresult = 2) AS q FROM `vote_content` WHERE `vid` = " . $id;
$rss = $db ->query($sql_c);
$rssa = $db->fetch_array_list($rss);
?><tr>
<td class="Voteend">
<input type="radio" name="vote_tips" value="1" /> 同意<label for="radio"></label> <input type="radio" name="vote_tips" value="0" /> 不同意<label for="radio"></label>
<input type="radio" name="vote_tips" value="2" />
弃权
</td>
</tr>
<tr>
<td height="50" align="center">暂时的投票结果是 同意:<span class="RedBold"><?php echo intval($rssa[0]['y']); ?>票</span> | 不同意:<span class="RedBold"><?php echo intval($rssa[0]['n']); ?>票</span> | 弃权: <span class="RedBold"><?php echo intval($rssa[0]['q']); ?>票</span></td>
</tr>
<tr>
<td height="50" align="center"><input type="submit" name="button" id="button" class="btn" value="提交"/></td>
</tr><?php
}
elseif( $cData[0]["vtype"] == 0 )
{
?>
<tr>
<td height="50" align="center">投票未开始</td>
</tr>
<?php
}
elseif( $cData[0]["vtype"] == 2 )
{
$sql_c = " SELECT SUM(vresult = 1) AS y ,SUM(vresult = 0) AS n,SUM(vresult = 2) AS q FROM `vote_content` WHERE `vid` = " . $id;
$rss = $db ->query($sql_c);
$rssa = $db->fetch_array_list($rss);
?>
<tr>
<td height="50" align="center">投票已结束,投票结果是 同意:<span class="RedBold"><?php echo intval($rssa[0]['y']); ?>票</span> | 不同意:<span class="RedBold"><?php echo intval($rssa[0]['n']); ?>票</span> | 弃权: <span class="RedBold"><?php echo intval($rssa[0]['q']); ?>票</span></td>
</tr>
原来的代码是:
<?php if($cData[0]["vtype"] == 1)
{
$sql_c = " SELECT SUM(vresult = 1) AS y ,SUM(vresult = 0) AS n,SUM(vresult = 2) AS q FROM `vote_content` WHERE `vid` = " . $id;
$rss = $db ->query($sql_c);
$rssa = $db->fetch_array_list($rss);
?><tr>
<td class="Voteend">
<input type="radio" name="vote_tips" value="1" /> 同意<label for="radio"></label> <input type="radio" name="vote_tips" value="0" /> 不同意<label for="radio"></label>
<input type="radio" name="vote_tips" value="2" />
弃权
</td>
</tr>
<tr>
<td height="50" align="center">暂时的投票结果是 同意:<span class="RedBold"><?php echo intval($rssa[0]['y']); ?>票</span> | 不同意:<span class="RedBold"><?php echo intval($rssa[0]['n']); ?>票</span> | 弃权: <span class="RedBold"><?php echo intval($rssa[0]['q']); ?>票</span></td>
</tr>
<tr>
<td height="50" align="center"><input type="submit" name="button" id="button" class="btn" value="提交"/></td>
</tr><?php
}
elseif( $cData[0]["vtype"] == 0 )
{
?>
<tr>
<td height="50" align="center">投票未开始</td>
</tr>
<?php
}
elseif( $cData[0]["vtype"] == 2 )
{
$sql_c = " SELECT SUM(vresult = 1) AS y ,SUM(vresult = 0) AS n,SUM(vresult = 2) AS q FROM `vote_content` WHERE `vid` = " . $id;
$rss = $db ->query($sql_c);
$rssa = $db->fetch_array_list($rss);
?>
<tr>
<td height="50" align="center">投票已结束,投票结果是 同意:<span class="RedBold"><?php echo intval($rssa[0]['y']); ?>票</span> | 不同意:<span class="RedBold"><?php echo intval($rssa[0]['n']); ?>票</span> | 弃权: <span class="RedBold"><?php echo intval($rssa[0]['q']); ?>票</span></td>
</tr>
就是<input type="submit" name="button" id="button" class="btn" value="提交" onclick="return(confirm('确认投票?'))"/>另外有个问题怎样在“确认投票?”中加入投的什么票呢?