<?php
$issuetime = getDateTimeMk_YMDHM($article_array['issuetime']);
$content_count = getContentCount();
$content = mediaScriptParse($articleContent['content']);
$content_pages = showContentPages();
$comment_count = getCommentCount();
$poll_total_selectcount = getPollTotalSelectCount();
$poll_total_count = getPollTotalCount();
$poll_array=getPoll($poll_total_count);
if($act=='show') $display_result = '';
else $display_result = 'none';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo SYS_CHARSET ?>" />
<title><?php echo  $article_array['title'] ?> _<?php echo $sys_title ?></title>
<meta name="keywords" content="<?php echo  $article_array['title'] ?>" />
<meta name="description" content="<?php echo  $article_array['title'] ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo SYS_FRONT_STYLE_PATH?>style/article.css" />
<script type="text/javascript" src="<?php echo SYS_FRONT_STYLE_PATH?>js/common.js"></script>
<script language="javascript" type="text/javascript">
function showResult()
{
	document.getElementById('pollresult').style.display='';
}
function checkPoll()
{
	var rtn_poll = false;
	var rtn_notion = false;
	var inputO =  document.getElementsByTagName("input");
  if(inputO.length>0)
	{			
  	for(i=0; i<inputO.length; i++)
  	{
  		if(inputO[i].name.substr(0,7)=="poll_id")
  		{
	  		if(inputO[i].checked == true)
	  		{	    			
					rtn_poll = true;		
					break;													
	  		}
		  }
  	}
  }
  
  if(document.getElementById('notion').value.length>0) rtn_notion = true;
  
  if(rtn_poll||rtn_notion) return true;
  else
  { 
  	alert("请选择或填写补充说明!");
  	return false;
  }

}
</script>
<base target="_self" />
</head>

<body>
<?php include("inc_topbar.tpl.html"); ?>
<div id="wrap">
<!--Content, Left, Right, Middle, Outer, Advertisement--> 
<!--Header-->
<div id="header">
<?php 
include("inc_pagetitle.tpl.html"); 
include("inc_mainmenu.tpl.html"); 
include("inc_submenu.tpl.html"); 
include("inc_navigation.tpl.html"); 
?>
</div>
<!--/Header-->

<!--Content-->

<!--C1 layout-->
<div class="contentL">
	
<!--C1-R layout-->
<div class="sideL">
<!--C1-R1 layout-->
<div id="hotview" class="sideblock">
<h3><?php echo $layout_title_array['hotview'] ?></h3>
<ul class="msgtitlelist" >
<?php
$hotview_array=getLayoutn('hotview');
foreach($hotview_array as $row){
?>
<li><a href='article.php?id=<?php echo $row['id'] ?>' target='_self'><?php echo $row['title'] ?></a></li>
<?php } ?>
</ul>
</div>
<!--/C1-R1 layout-->

<!--C1-R2 layout-->
<div id="newread" class="sideblock">
<h3><?php echo $layout_title_array['newread'] ?></h3>
<ul class="msgtitlelist" >
<?php
$newread_array=getLayoutn('newread');
foreach($newread_array as $row){
?>
<li><a href='article.php?id=<?php echo $row['id'] ?>' target='_self'><?php echo $row['title'] ?></a></li>
<?php } ?>
</ul>
</div>
<!--/C1-R2 layout-->

</div>
<!--/C1-R layout-->

<!--C1-L layout-->
<div class="mainarea" style="float:right;">
<!--poll-->
<div id="articledetail">
<h1 class="articletitle"><?php echo $article_array['title'] ?></h1>
<p >参与人数:<?php echo $poll_total_count ?> / 投票人数:<?php echo $poll_total_selectcount ?></p>

<p id="pollsummary"><?php echo $article_array['intro'] ?></p>
<form id="pollform" action="article.php?act=savepoll" method="post" onSubmit="return checkPoll()">
<fieldset id="pollresult" style="display: <?php echo $display_result ?>">
<legend>投票结果</legend>
<ul>
<?php
foreach($poll_array as $row){
?>	
<li><?php echo $row['title'] ?><p><span class='pollnum'>得票:<?php echo $row['eifr_poll_num'] ?> / <?php echo $row['eifr_poll_rate'] ?>%</span><span class='pollpercent'><span style='width: <?php echo $row['eifr_poll_rate'] ?>%;'>&nbsp;</span></span></p></li>
<?php } ?>
</ul>
</fieldset>
<script language="javascript" type="text/javascript">
function showresult() {
var result=getbyid('pollresult');
if (result.style.display=='none') result.style.display='block'; else result.style.display='none';
}
</script>

<fieldset id="dopoll">
<legend>投票</legend>
<ul>
<?php
foreach($poll_array as $row){
?>	
<li><input type='<?php echo $row['eifr_type'] ?>' name='<?php echo $row['eifr_name'] ?>' value='<?php echo $row['id'] ?>' /><label for='ratevalue'><?php echo $row['title'] ?></label></li>
<?php } ?>
</ul>
<input type="hidden" name="id" value="<?php echo $id ?>" />
<input type="hidden" name="act" value="savepoll" />
<div style="display:none">补充说明:<input type="text" name="notion" id="notion" size="40" value="" /></div>
<button id="dovote" name="pollbtn" type="submit" value="true">投票</button>
&nbsp;<button type="button" onclick="showResult();">查看结果</button>
</fieldset>
</form>
</div>
<!--/poll-->
<br />

<?php
include("inc_relation.tpl.html");
?> 

</div>
<!--/C1-L layout-->

</div>
<!--C1 layout-->

<!--/Content-->

<?php include("inc_footer.tpl.html"); ?>
</div>
</body>
</html>