<div class="main f_r">
    <div class="uc_title m_10">
        <label class="current"><span>我的建议</span></label>
    </div>
    <table class="list_table m_10" width="100%" cellpadding="0" cellspacing="0">
        <col />
        <col width="160px" />
        <col width="80px" />
        <col width="80px" />
        <thead>
        	<tr>
        		<th>建议主题</th>
        		<th>添加时间</th>
        		<th>状态</th>
        		<th>查看</th>
        	</tr>
        </thead>
        <tbody>
        {set:$querySuggestionList = Api::run('getUcenterSuggestion',$this->user['user_id'])}
		{foreach:items = $querySuggestionList->find()}
            <tr>
                <td class="t_l">{$item['title']}</td>
                <td>{$item['time']}</td>
                <td>
                	{if:$item['re_content']!=''}
                	<span class="green bold">已回复</span>
                	{else:}
                	<span>未回复</span>
                	{/if}
                </td>
                <td><a class="blue bold" href="javascript:void(0)" onclick='show_msg(this,{echo:JSON::encode($item)})'>查看</a></td>
            </tr>
        {/foreach}
        <tr id='show_msg' class="show" style="display:none">
            <td colspan="4">
				<i class="close f_r" onclick='$(this).parent().parent().hide()'></i>
				<b class="gray">建议主题:</b><p class="mt_10 m_10 gray indent" id='title'></p>
				<b class="gray">建议内容</b>:<p class="mt_10 m_10 gray indent" id='content'></p>
				<span id='re_info'>
					<hr class="dashed" />
					<b class="orange">{$this->_siteConfig->name}</b>
					在 [<span class="gray" id='re_time'></span>] 回复:<p class="gray indent mt_10" id='re_content'></p>
				</span>
			</td>
        </tr>
        </tbody>
        <tfoot><tr><td colspan="3" class="t_l">{$querySuggestionList->getPageBar()}</td></tr></tfoot>
    </table>
    <div class="orange_box">
		<form action="{url:/ucenter/complain_edit}" method="post" >
		    <table class="form_table" width="100%" cellpadding="0" cellspacing="0">
		        <col width="120px" />
		        <col />
		        <caption>建议信息：</caption>
		        <tr>
		            <th>建议标题：</th><td><input name="title" type="text" pattern='required' alt='标题不能为空' class="normal" /><label>*标题不能为空</label></td>
		        </tr>
		        <tr>
		            <th>建议内容：</th><td><textarea name='content' pattern='required' alt=''></textarea></td>
		        </tr>
		        <tr>
		            <th></th><td><label class="btn"><input type="submit" value="我要建议" /></label></td>
		        </tr>
		    </table>
		</form>
    </div>
</div>
<script type="text/javascript">
function show_msg(_self,obj)
{
	$('#show_msg').insertAfter($(_self).parent().parent());
	$('#show_msg').show();

	//设置数据
	obj.re_content ? $('#show_msg #re_info').show() : $('#show_msg #re_info').hide();
    for(var i in obj)
    {
    	$('#show_msg #'+i).text(obj[i]);
    }
}
</script>
