<?php
include("header.tpl.php");
include("bodytop.tpl.php"); 
include("navigation.tpl.php"); 
?>
<div class="clear"></div>
<div class="g_navigation">
		<a href="index.php">网站首页</a> >> <a href="product.php"><?php echo $productname?></a> >> <a href="productdisplay.php?pid=<?php echo $pid?>&categoryid=<?php echo $categoryid?>"><?php echo $productcategory[$categoryid]['categorytitle']?></a> >> <?php echo $allproduct['producttitle']?>
</div>
	<div id="productlist">
       <div class="rm_u">&nbsp;</div>
	   <div class="content">
	   <h2>&nbsp;</h2>
		<div class="productdiv_p font_14">
			<ul class="productlist_ul">
			<li class="title">
			<?php if($pervalue{16}){ ?>
			<a href="post.php?ipost=modifyproduct&mid=<?php echo $allproduct['productid']?>">[修改]</a>
			<? }?>
			<?php echo $allproduct['producttitle']?></li>	
			<li class="logoimg">
			<div><img src="<?php echo $allproduct['logo']?>" ></div>
			<span>
			<img src="images/common/product_enlarge_icon.gif"> 
			<a href="javascript:void(0)" onclick="popwindows('<?php echo $allproduct['storename']?>',1,0)">点击放大图片</a>
			</span>
			</li>
			<li class="prointro">
				<cite>产品简介</cite>
				<span><?php echo $allproduct['productintro']?></span>
			</li>
			<li class="space"></li>
			</ul>
             <div class="clear"></div>
			<div class="productbody_div">
				<?php echo $message?>
			</div>

			<div class="clear"></div>
			</div>
		</div>
		<div class="rm_d">&nbsp;</div>

	</div>
	

	<div id="productmenu">
		<div class="rs_u">&nbsp;</div>
		<div class="content">
			<h2>产品列表</h2>
		 <div class="div_p font_14">
			<ul class="productmenu_ul">
			<?php foreach ($maincategory as $key => $val){
				?>
				<li><a href="productdisplay.php?pid=<?php echo $val['pid']?>&categoryid=<?php echo $key?>"><?php echo $val['categorytitle']?></a></li>

				<?php foreach($subcategory[$key] as $subkey => $subval){?>
				<li>&nbsp;&nbsp;<a href="productdisplay.php?pid=<?php echo $subval['pid']?>&categoryid=<?php echo $subkey?>" class="font_12"><?php echo $subval['categorytitle']?></a>
				</li>
				<?php }?>
			<?php }?>
			</ul>
			</div>
		</div>
		<div class="rs_d">&nbsp;</div>
	</div>
	<div class="clear"></div>
	<?php if(intval($downattachs)){?>
	<div id="productlist">
       <div class="rm_u">&nbsp;</div>
		<div class="content">
			<h2>附件下载</h2>
			<div class="div_p font_14">
			<ul class="productattach_ul">
				<li class="name">附件名</li>
				<li>点击下载</li>	
				<li>下载次数</li>
				<?php	foreach($downattachs as $key => $val){ ?>
				<li class="name"><?php echo $val['icon']?> <?php echo $val['name']?></li>	
				<li><a href="download.php?fid=<?php echo $key?>&type=product">点击下载</a></li>	
				<li><?php echo $val['downtimes']?></li>
				<?php }?>
			</ul>
			<div class="clear"></div>
			</div>
		</div>
		<div class="rm_d">&nbsp;</div>
	</div>
	<?php }?>



<div id="productmsg">
<?php foreach($replys as $val){?>
<table class="posttab">
  <tr>
       <td valign="top" class="postauthor">
	   			 	   <?php if($val['reply_uid']&&!$val['uid']){?>
					<cite><s><?php echo $val['postname']?>(<?php echo $val['ip']?>)</s></cite>
				  <div class="authorface"><img src="images/userface/<?php echo $val['userface']?>"></div>
				   <center><div> 该用户已经被删除 </div></center>
				  <?}else{?>
	   			<cite><?php echo $val['userid']?>(<?php echo $val['ip']?>)</cite>
				  <div class="authorface"><img src="images/userface/<?php echo $val['userface']?>"></div>
				  <?php }?>
	   			    <ul>
				      
					   <?php if($val['uid']){?>
					   <li> 用户组：<?php echo $groupnames[$val['gid']][0]?></li>
					   <li>帖子数：<?php echo $val['postcount']?></li>
					   <li>注册时间：<?php echo gmdate('Y-n-j',$val['registertime']+28800)?></li>	
					   <?php }?>			   
					</ul>
      </td>
    <td class="reply_r" valign="top">
	  <div class="postinfo">
	 <cite><?php echo $val['floor']?>楼</cite>
	  <em onclick="$('postmessage_<?php echo $val['rid']?>').className='t_bigfont'">大</em>
	  <em onclick="$('postmessage_<?php echo $val['rid']?>').className='t_msgfont'">中</em>
	  <em onclick="$('postmessage_<?php echo $val['rid']?>').className='t_smallfont'">小</em>
	  回复时间：<?php echo gmdate('Y-n-j H:i',$val['subtime']+28800)?>
	    </div>

       <div id="postmessage_<?php echo $val['rid']?>" class="t_msgfont"> <?php  echo $val['content']?></div>
	   <?php  if(!empty($replydownattachs[$val['rid']])){?>
	  <div class="reply_downtitle">附件下载</div>
	  <?php foreach($replydownattachs[$val['rid']] as $v){?>
		 <div class="reply_down font_12"><?php  echo $v['icon'].' <a href="download.php?fid='.$v['fid'].'&type=reply">'.$v['name'].'</a> '.' ('.sizecount($v['size']).') (下载次数:'.$v['downtimes'].')'; ?></div>
	  <?php  } }?>
   </td>
  </tr>
  <tr>
			 <td class="postauthor"></td>
			  <td class="thread_r"><div class="postaction">   <a href="###" onclick="window.scrollTo(0,0);">TOP</a>
			  <?php if(($pervalue{1} && $val['reply_uid']==$uid) || $pervalue{16}){?>
			    <a href="post.php?ipost=modifyreply&mid=<?php echo $val['rid']?>">修改</a>
			  <?php }?>
			  <?php if(($pervalue{0} && $val['reply_uid']==$uid) || $pervalue{16}){?>
			  <a href="###" onclick="delreply(<?php echo $val['rid']?>)">删除</a>
			  <?php }?>
			  </div></td>
  </tr>
</table>
<?php }?>
<?php	
		if($multipage){
		echo '<div class="pages_btns font_14">'.$multipage.'</div>';
		}
?>
</div>

<?php if($pervalue{12}){?>
<form enctype="multipart/form-data" method="post" action="post.php?action=savereply&typeid=2&bid=<?php echo $productid?>" onsubmit="parseurl()">
	<div id="msglist">
       <div class="rm_u">&nbsp;</div>
		<div class="content">
			<h2>发表评论</h2>
			<div class="div_p font_14">
				<ul>
				<li><?php include("editor.tpl.php");?></li>
				<li>
				<?php if($allowedauthcode{0}){ ?>
				<input type="text" name="replyproductauthcode" class="authcode" style="margin-left:5px;"> 
				<div id="iauthcodediv" ></div>
				<SCRIPT LANGUAGE="JavaScript">
					changeauthcode();
				</SCRIPT>
		    	<?php }?>
				<div class="clear"></div>
				<input type="submit" value="发表评论" class="postmsgbtn">
				</li>
				</li>
				</ul>
				<div class="clear"></div>
			</div>

		</div>
		<div class="rm_d">&nbsp;</div>
	</div>
	</form>
<?php }?>
	<div class="clear"></div>

<?php
include("tail.tpl.php"); 
?>

