<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 
?>
<link rel="stylesheet" href="<?=$poll_skin_path?>/style.css" type="text/css">

<div id="zmb_poll_title"><?=$po_subject?> (전체 <?=$nf_total_po_cnt?>표)</div>
<?	for ($i=1; $i<=count($list); $i++) { ?>
	<div class="zmb_poll_rs_list">
		<div><?=$list[$i][num]?>. <?=$list[$i][content]?></div>
		<div class="zmb_poll_rs_bar">
		<img src="<?=$g4[bbs_img_path]?>/poll_graph_y.gif" width="<?=(int)$list[$i][bar]?>" height="7"> 
		<span class="ratio_poll"><?=$list[$i][cnt]?>표 (<?=number_format($list[$i][rate], 1)?>%)</span>
		</div>
	</div>
<?	} ?>

<? if (1 || $is_etc) { ?>
<?		if ($member[mb_level] >= $po[po_level]) { ?>
        <form name="fpollresult" method="post" onsubmit="return fpollresult_submit(this);" autocomplete="off">
        <input type=hidden name=po_id value="<?=$po_id?>">
        <input type=hidden name=w value="">
		<input type=hidden name=skin_dir value="<?=$skin_dir?>">
        <table width=100% cellpadding=0 cellspacing=0>
        <tr> 
			<td colspan=2><?=$po_etc?></td>
        </tr>
		<tr> 
			<td width=150 align="center">
		<? if ($member[mb_id]) { ?>
				<input type=hidden name=pc_name value="<?=cut_str($member[mb_nick],255)?>"><b><?=$member[mb_nick]?></b>&nbsp;
		<? } else { ?>
               이름 <input type='text' name='pc_name' size=10 class=input required itemname='이름'> &nbsp;
		<? } ?>
			</td>
			<td>
				<input type='text' name='pc_idea' size=65 class=input required itemname='의견' maxlength="100"> &nbsp;
				<input name="image" type=image src='<?=$g4[bbs_img_path]?>/ok_btn.gif' align=absmiddle border=0>
			</td>
		</tr>
		</table>
        </form>

        <script type="text/javascript">
        function fpollresult_submit(f)
        {
            f.action = "./poll_etc_update.php";
            return true;
        }
        </script>
    <? } ?>

    <? for ($i=0; $i<count($list2); $i++) { ?>
        <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
            <td height="10" colspan="4"></td>
        </tr>
        <tr> 
            <td width="20" height="25" align="center" bgcolor="#FAFAFA"><img src="<?=$g4[bbs_img_path]?>/icon_03.gif" width="3" height="5"></td>
            <td width="350" bgcolor="#FAFAFA"><span style="font:normal 11px Dotum;"><?=$list2[$i][name]?></td>
            <td width="70" align="center" bgcolor="#FAFAFA"><? if ($list2[$i][del]) { echo $list2[$i][del] . "<img src='$g4[bbs_img_path]/btn_comment_delete.gif' width=45 height=14 border=0></a>"; } ?></td>
            <td width="150" align="center" bgcolor="#FAFAFA"><span style="font:normal 11px Dotum; color:#ADADAD;"><?=$list2[$i][datetime]?></span></td>
        </tr>
        <tr> 
            <td height="1" colspan="4" background="<?=$g4[bbs_img_path]?>/dot_bg.gif"></td>
        </tr>
        <tr> 
            <td width="20" height="25" bgcolor="#FAFAFA">&nbsp;</td>
            <td width="550" height="25" colspan="3" bgcolor="#FAFAFA"><span style="color:#414141; font:normal 12px '맑은 고딕';"><?=$list2[$i][idea]?></span></td>
        </tr>
        </table>
    <? } ?>
<? } ?>
<div style="margin:10px; text-align:center;">
	<a href="javascript:window.close();"><img src="<?=$poll_skin_path?>/img/btn_close.gif" border="0"></a>
</div>

<div class="more_poll">
<form name=fpolletc>
	<select name=po_id onchange="select_po_id(this)">
<?	for ($i=0; $i<count($list3); $i++) { ?>
	<option value='<?=$list3[$i][po_id]?>'>[<?=$list3[$i][date]?>] <?=$list3[$i][subject]?>
<?	} ?>
	</select>
	<script>document.fpolletc.po_id.value='<?=$po_id?>';</script>
</form>
</div>

<script type='text/javascript'>
function select_po_id(fld) 
{
    document.location.href = "./poll_result.php?po_id="+fld.options[fld.selectedIndex].value+"&skin_dir=<?=$skin_dir?>";
}
</script>
