<!--<?php
print <<<EOT
-->
<style type="text/css">
.tt2{border:1px solid $tdcolor;}
.tt2 table tr td{padding:0 1em;line-height:25px;border-bottom:1px dotted #e4e4e4;}
.tt2 table tr th{line-height:25px;border-bottom:1px dotted #e4e4e4;text-align:left;padding:0 1em;font-weight:normal}
.tt2 table{background:$forumcolorone;}
.tt2 .h{padding:0 1em;}
</style>
<form action="job.php?action=vote" method="post" name="vote">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="c"></div>
<div class="tt2">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><th class="h" colspan="2"><span class="fr"><a href="read.php?fid=$fid&tid=$tid&viewvoter=$ifview">查看投票的會員</a></span>
總共有<b>{$voters}</b>人參與本次投票 發起于︰$tpc_date
<!--
EOT;
if ($tpc_endtime) {print <<<EOT
-->
 至 $tpc_endtime 結束
<!--
EOT;
}print <<<EOT
-->
</td></tr>
<!--
EOT;
foreach ($votedb as $key => $vote) {print <<<EOT
-->
<tr>
<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/$stylepath/tab-two.gif" width="$vote[width]" height="15" align="absmiddle" />&nbsp;$vote[num]&nbsp;票</td></tr>
<!--
EOT;
if ($vote['voter']) {print <<<EOT
-->
<tr><th colspan="2" class="gray">&nbsp;&nbsp;$vote[voter]&nbsp;&nbsp;</td></tr>
<!--
EOT;
}}print <<<EOT
-->
<tr><th class="tr4 s3" style="padding:0 1em;border-bottom:0px;">
<!--
EOT;
if ($vote_close) {print <<<EOT
-->
(本次投票已結束)
<!--
EOT;
}print <<<EOT
-->
</th>
<td class="tr4" style="padding:0 1em;border-bottom:0px;">
<!--
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&action=modify">修改投票</a></b>
<!--
EOT;
} else {
if ($action == 'modify') {print <<<EOT
-->
<input type="hidden" value="modify" name="voteaction" />
<!--
EOT;
}if ($readvote['multiple'] && $readvote['mostvotes']) {print <<<EOT
-->
限選個數︰{$readvote[mostvotes]}&nbsp;&nbsp;
<!--
EOT;
}print <<<EOT
-->
<input type="hidden" value="$tid" name="tid" />
&nbsp;&nbsp;<input class="btn" type="submit" value="提 交" />
<!--
EOT;
}print <<<EOT
-->
</div>
<!--
EOT;
}print <<<EOT
-->
</td>
</tr>
</table></div>
</form>
<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;
?>