<!--<?php
print <<<EOT
-->
<style type="text/css">
.vote-ol{margin-left:2.5em;list-style-type:decimal;line-height:2}
</style>
<div class="t">
<form action="job.php?action=vote" method="post" name="vote">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="h" style="border-top:0 none;">
<!-- 
EOT;
if('no' === $viewvoter){
print <<<EOT
-->
<span class="fr"><a href="read.php?fid=$fid&tid=$tid&displayMode=1&viewvoter=$ifview">查看投票的会员</a></span>
<!-- 
EOT;
}else{
print <<<EOT
-->
<span class="fr"><a href="read.php?fid=$fid&tid=$tid&displayMode=1&viewvoter=$ifview">隐藏投票的会员</a></span>
<!--
EOT;
}
print <<<EOT
-->
<strong>总共有<b>{$voters}</b>人参与本次投票 发起于:$tpc_date</strong>
<!--
EOT;
if ($tpc_endtime) {print <<<EOT
-->
<strong> 至 $tpc_endtime 结束</strong>
<!--
EOT;
}print <<<EOT
-->
</div>
<table width="100%" cellspacing="0" cellpadding="0">
<tr class="tr3 f_two"><td colspan="2">
<b>投票限制条件:</b> <br />
<ol class="vote-ol">
<!--
EOT;
if ($readvote['regdatelimit']) {print <<<EOT
-->
<li>本投票只允许注册日期大于 $regdatelimit 会员投票 </li>
<!--
EOT;
}if ($readvote['multiple'] && $readvote['leastvotes'] > 1) {print <<<EOT
-->
<li>至少选择个数:{$readvote[leastvotes]} </li>
<!--
EOT;
}if ($readvote['multiple'] && $readvote['mostvotes']) {print <<<EOT
-->
<li>最多选择个数:{$readvote[mostvotes]} </li>
<!--
EOT;
}if ($creditlimit) {print <<<EOT
-->
<li>投票积分限制:
<!--
EOT;
foreach ($credit->cType as $key => $value) {
if (empty($creditlimit[$key])) continue;print <<<EOT
-->
{$value}:$creditlimit[$key] &nbsp;
<!--
EOT;
}print <<<EOT
-->
</li>
<!--
EOT;
}if($readvote['postnumlimit']) {print <<<EOT
-->
<li>您的发帖数大于 {$readvote[postnumlimit]} 才能投票</li>
<!--
EOT;
}print <<<EOT
-->
</ol>
</td>
</tr>
<!--
EOT;
foreach ($votedb as $key => $vote) {print <<<EOT
-->
<tr class="tr3">
<th width="40%">
<!--
EOT;
if (!$vote_close && (!$readvote['havevote'] || $action == 'modify')) {print <<<EOT
-->
<input type="$votetype" value="$key" name="voteid[]" onclick="checkVote(this)" />
<!--
EOT;
}print <<<EOT
-->
$vote[name]
</th>
<td><img src="$imgpath/post/vote/tab-two.gif" width="$vote[width]" height="15" align="absmiddle" />&nbsp;$vote[num]&nbsp;票</td></tr>
<!--
EOT;
if ($vote['voter']) {print <<<EOT
-->
<tr class="tr3"><td colspan="2" class="gray">&nbsp;&nbsp;$vote[voter]&nbsp;&nbsp;</td></tr>
<!--
EOT;
}}print <<<EOT
-->
<tr class="tr3"><th class="s3" style="border-bottom:0;">
<!--
EOT;
if ($vote_close) {print <<<EOT
-->
(本次投票已结束)
<!--
EOT;
}print <<<EOT
-->
</th>
<td style="border-bottom:0;">
<!--
EOT;
if ((!$readvote['havevote'] || $readvote['modifiable']) && $vote_close == 0) {print <<<EOT
-->
<div>
<!--
EOT;
if ($readvote['havevote'] && $action != 'modify' && $readvote['modifiable']) {print <<<EOT
-->
&nbsp;* <b><a href="read.php?fid=$fid&tid=$tid&displayMode=1&action=modify">修改投票</a></b>
<!--
EOT;
} else {
if ($action == 'modify') {print <<<EOT
-->
<input type="hidden" value="modify" name="voteaction" />
<!--
EOT;
} print <<<EOT
-->
<input type="hidden" value="$tid" name="tid" />
<span class="btn2"><span><button type="submit">提 交</button></span></span>
<!--
EOT;
}print <<<EOT
-->
</div>
<!--
EOT;
}print <<<EOT
-->
</td>
</tr>
</table>
</form>
</div>
<script language="JavaScript">
var tempnum = 0;
var voteid = '';
var multi = '$readvote[mostvotes]';
function checkVote(obj){
	if ((obj.type == 'checkbox' || obj.type == 'radio') && multi != 0) {
		if (!tempnum) {
			tempnum = 0;
		}
		if (!voteid) {
			voteid = '';
		}
		if (obj.checked) {
			if(obj.type == 'checkbox'){
				if (tempnum == multi) {
					obj.checked = false;
					return;
				}
				voteid += (voteid ? '|' : '') + obj.value;
				tempnum++;
			} else {
				voteid = obj.value;
				tempnum = 1;
			}
		} else {
			tempnum--;
		}
	}
}
</script>
<!--
EOT;
?>