<?php
switch ($act) {
	default:
$info_package = $db->pe_select('package', array('package_id'=>intval($_g_package_id))); 
//评论列表
$info_list = $db->pe_selectall('comment', array('package_id'=>intval($_g_package_id), 'comment_state'=>1, 'order by'=>'comment_id desc'), '*', array(30));
$jshtml = <<<html
	<div class="pinglun mat15">
	  	<div class="left">
			<div class="left_tt"></div>
			<div class="table1">
				<form action="{$pe['host_root']}index.php?mod=comment&act=addsql" method="post">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
              	<tr>
                	<td style="color:#000000"><a name="nav6"></a>姓名：</td>
                	<td><input type="text" name="comment[comment_uname]" class="input1" /></td>
              	</tr>
              	<tr>
                	<td style="color:#000000">邮箱：</td>
                	<td><input type="text" name="comment[comment_uemail]" class="input1"/></td>
              	</tr>
              	<tr>
                	<td style="color:#000000">留言：</td>
                	<td><textarea name="comment[comment_text]" class="input2"></textarea></td>
              	</tr>
              	<tr>
                	<td>
                		<input type="hidden" name="comment[package_id]" value="{$info_package['package_id']}" />
                		<input type="hidden" name="comment[package_name]" value="{$info_package['package_name']}" />
                	</td>
                	<td><input type="submit" id="comment" class="tj_btn1" value=" " /></td>
              	</tr>
            	</table>
            	</form>
			</div>
			<div class="left_bot"></div>
		</div>
		<div class="left mar5" style="display:inline;">
			<div class="right_tt"></div>
			<div class="table1" style="overflow:hidden; height:220px;color:#000;text-align: left">
				<div id="comment_list" style="height:220px; overflow-y:auto;">
html;
foreach ($info_list as $v) {
	$jshtml .= "<div class='pl_one'><div><span class='cblue'>{$v['comment_uname']}</span> <span class='c888' style='text-align:right'>".pe_date($v['comment_atime'])."</span> 说: </div><p>{$v['comment_text']}</p>";
	if ($v['comment_replytext']) {
		$jshtml .= "<div class='cred1'>管理员：{$v['comment_replytext']}</div>";
	}
	$jshtml .= '</div>';
}
$jshtml .= <<<html
				</div>
				<div class="fenye">{$comment_page}</div>
			</div>
			<div class="left_bot"></div>
		</div>
		<div class="clear"></div>
	</div>
<script type="text/javascript">
$(function(){
$("#comment").click(function(){
	if ($(":input[name='comment[comment_uname]']").val() == '') {
		alert('姓名不能为空');
		return false;
	};
	if ($(":input[name='comment[comment_uemail]']").val() == '') {
		alert('邮箱不能为空');
		return false;
	};
	if (rule_email.test($(":input[name='comment[comment_uemail]']").val()) == false) {
		alert('邮箱格式不正确');
		return false;
	};
	if ($(":input[name='comment[comment_text]']").val() == '') {
		alert('留言不能为空');
		return false;
	};
})
})
</script>
html;
	echo pe_jstext($jshtml);
	break;
}
?>