<!--{assign var='menuid' value=''}-->
<!--{assign var='usercpmod' value='yes'}-->
<!--{include file="<!--{$tplpath}-->cp/<!--{$tplpre}-->block_head.tpl"}-->
<body>
<!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_menu.tpl"}-->
<div id="page-index" class="page">
  <div class="zx">
    <!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_search.tpl"}-->
	<!--{include file="<!--{$tplpath}-->cp/<!--{$tplpre}-->block_menu.tpl"}-->
	
	<div class="zright">

	  <!--{if $a eq 'run'}--> 
      <div class="topmenu"> 
		<a href="<!--{$ucfile}-->?c=ask" class='now'>爱情求助</a>
		<a href="<!--{$ucfile}-->?c=ask&a=add">发布求助</a>
	  </div>
      <div class="tb1 hy">
        <div class="htitle">
		  <span class="right1">共发布了
          <label class="f_red"><!--{$total}--></label>
          条求助信息 </span>
		</div>
		<!-- 列表开始 -->
		<table cellpadding='0' cellspacing='0' border='0' class='tb' width="100%">
		  <tr>
			<th width='12%' align='center'>求助分类</th>
			<th width='30%' align='center'>求助标题</th>
			<th width='8%' align='center'>浏览</th>
			<th width='8%' align='center'>回答</th>
			<th width='8%' align='center'>悬赏积分</th>
			<th width='8%' align='center'>状态</th>
			<th width='8%' align='center'>审核</th>
			<th width='10%' align='center'>发表日期</th>
			<th align='center'>操作</th>
		  </tr>

		  <!--{foreach $ask as $volist}-->
		  <tr onMouseOver='overColor(this)' onMouseOut='outColor(this)'>
		    <!-- 分类 -->
			<td align='center' class='hback'><!--{$volist.catname}--></td>
			<!-- 标题 -->
			<td align='left' class='hback'><a href="<!--{$volist.url}-->" target="_blank"><!--{$volist.title}--></a> <!--{if $volist.privacy==1}--><font color="blue">匿名</font><!--{/if}--></td>
			<!-- 浏览 -->
			<td align='center' class='hback'><!--{$volist.hits}--></td>
			<!-- 回答 -->
			<td align='center' class='hback'><!--{$volist.answercount}--></td>
			<!-- 积分 -->
			<td align='center' class='hback'><!--{$volist.rewardpoints}--></td>
			<!-- 是否采纳 -->
			<td align='center' class='hback'>
			<!--{if $volist.acceptid=="0"}-->
			<img src='<!--{$tplpath}-->cp/images/icn_time.gif' title="<!--{$lang.cp_ask_status0}-->" />
			<!--{else}-->
				<img src='<!--{$tplpath}-->cp/images/icn_ok.gif' title="<!--{$lang.cp_ask_status1}-->" />	
			<!--{/if}-->
			</td>
			<!-- 审核 -->
			<td align='center' class='hback'>
			<!--{if $volist.flag=="1"}-->
			    <img src='<!--{$tplpath}-->cp/images/yes.gif' title="已审核" />	
			<!--{else}-->
			    <img src='<!--{$tplpath}-->cp/images/no1.gif' title="待审核" />
			<!--{/if}-->
			</td>
			<!-- 发布时间 -->
			<td align='left' class='hback' title='<!--{$volist.timeline|date_format:"%H:%M:%S"}-->'><!--{$volist.timeline|date_format:"%Y/%m/%d"}--></td>
			<!-- 修改 -->
			<td align='center' class='hback'><a href='<!--{$ucfile}-->?c=ask&a=edit&id=<!--{$volist.askid}-->&page=<!--{$page}-->'>编辑</a></td>
		  </tr>
		  <!--{foreachelse}-->
		  <tr>
			<td colspan="9" align="center" class='hback'>对不起，暂没有信息。</td>
		  </tr>
		  <!--{/foreach}-->
		</table>
		<!--{if $showpage!=""}-->
		<div class="page_digg" style="margin-top:15px"><!--{$showpage}--></div>
		<!--{/if}-->
		
	  </div>
	  <!--{/if}-->

	  <!--{if $a eq 'add'}--> 
      <div class="topmenu"> 
		<a href="<!--{$ucfile}-->?c=ask">爱情求助</a>
		<a href="<!--{$ucfile}-->?c=ask&a=add" class='now'>发布求助</a>
	  </div>
      <div class="tb1 hy">

			<form name="myform" id="myform" action="<!--{$ucfile}-->?c=ask" method="post">
			<input type="hidden" name="a" value="saveadd" />
			<table cellpadding='3' cellspacing='3' border='0' class='tab'>
			  <!-- 标题 -->
			  <tr>
				<td class='hback_b'>求助标题 <span class='f_red'>*</span></td>
				<td class='hback'><input type='text' name='title' id='title' class="input-txt" /> <span id="dtitle" class="f_red"></span></td>
			  </tr>
			  <!-- 分类 -->
			  <tr>
				<td class='hback_b' width='15%'>求助分类 <span class='f_red'>*</span></td>
				<td class='hback' width='85%'><!--{hook mod='askcategory' type='select' name='catid' text='=请选择='}--> <span id="dcatid" class="f_red"></span></td>
			  </tr>
			  <!-- 悬赏积分 -->
			  <tr>
				<td class='hback_b'>悬赏积分 <span class='f_red'></span></td>
				<td class='hback'><input type='text' name='rewardpoints' id='rewardpoints' value="200" class="input-s" /> <font color='#999999'>（0表示没有积分悬赏，一旦提交无法修改。）</font>  &nbsp;&nbsp;<font color="green">您当前剩余积分  <!--{$u.points}--></font></td>
			  </tr>
			  <!-- 匿名 -->
			  <tr>
				<td class='hback_b'>匿名发布 <span class='f_red'></span></td>
				<td class='hback'>
				<input type="radio" name="privacy" id="privacy" value="0" checked /> 否&nbsp;&nbsp;&nbsp;
				<input type="radio" name="privacy" id="privacy" value="1" /> 是
				
				<font color='#999999'>（选择匿名发布，将不会显示您的个人信息）</font> 
				</td>
			  </tr>
			  <!-- 内容 -->
			  <tr>
				<td class='hback_b'>求助内容 <span class='f_red'>*</span></td>
				<td class='hback'>
				<textarea name='content' id='content' style='width:98%;height:120px;display:;overflow:auto;'></textarea><br /><span id="dcontent" class="f_red"></span> <font color='#999999'>描述您当前遇到的问题，一旦提交不能修改。</font>
				</td>
			  </tr>
			  <!-- 补充内容 -->
			  <tr>
				<td class='hback_b'>补充内容 <span class='f_red'></span></td>
				<td class='hback'>
				<textarea name='cddedcontent' id='cddedcontent' style='width:98%;height:100px;display:;overflow:auto;'></textarea><br /><span id="dcddedcontent" class="f_red"></span>
				<font color='#999999'>需要补充的内容信息</font>
				</td>
			  </tr>
			  <!-- 提交保存 -->
			  <tr>
				<td class='hback_none'></td>
				<td class='hback_none'>
				<a href="###" class="btn_b2" onclick="return checkform();"><span>添加保存</span></a>
				&nbsp;&nbsp;
				<a href="<!--{$ucfile}-->?c=ask" class="btn_b3"><span>返回列表</span></a>
				</td>
			  </tr>
	      </table>
		  </form>

	  </div>
	  <!--{/if}-->


	  <!--{if $a eq 'edit'}--> 
      <div class="topmenu"> 
		<a href="<!--{$ucfile}-->?c=ask">爱情求助</a>
		<a href="<!--{$ucfile}-->?c=ask&a=add">发布求助</a>
		<a class='now'>编辑求助</a>
	  </div>
      <div class="tb1 hy">

			<form name="myform" id="myform" action="<!--{$ucfile}-->?c=ask" method="post" >
			<input type="hidden" name="a" value="saveedit" />
			<input type="hidden" name="id" value="<!--{$id}-->" />
			<table cellpadding='3' cellspacing='3' border='0' class='tab'>
			  <!-- 标题 -->
			  <tr>
				<td class='hback_b'>求助标题 <span class='f_red'>*</span></td>
				<td class='hback'><input type='text' name='title' id='title' class="input-txt" value="<!--{$ask.title}-->" /> <span id="dtitle" class="f_red"></span></td>
			  </tr>
			  <!-- 分类 -->
			  <tr>
				<td class='hback_b' width='15%'>求助分类 <span class='f_red'>*</span></td>
				<td class='hback' width='85%'><!--{hook mod='askcategory' type='select' name='catid' text='=请选择=' value=$ask.catid}--> <span id="dcateid" class="f_red"></span></td>
			  </tr>
			  <!-- 悬赏积分 -->
			  <tr>
				<td class='hback_b'>悬赏积分 <span class='f_red'></span></td>
				<td class='hback'><!--{$ask.rewardpoints}--></td>
			  </tr>
			  <!-- 匿名 -->
			  <tr>
				<td class='hback_b'>匿名发布 <span class='f_red'></span></td>
				<td class='hback'>
				<input type="radio" name="privacy" id="privacy" value="0"<!--{if $ask.privacy==0}--> checked<!--{/if}--> /> 否&nbsp;&nbsp;&nbsp;
				<input type="radio" name="privacy" id="privacy" value="1"<!--{if $ask.privacy==1}--> checked<!--{/if}--> /> 是
				
				<font color='#999999'>（选择匿名发布，将不会显示您的个人信息）</font>
				</td>
			  </tr>
			  <!-- 内容 -->
			  <tr>
				<td class='hback_b'>求助内容 <span class='f_red'></span></td>
				<td class='hback'><!--{$ask.content|nl2br}--></td>
			  </tr>
			  <!-- 补充内容 -->
			  <tr>
				<td class='hback_b'>补充内容 <span class='f_red'></span></td>
				<td class='hback'>
				<textarea name='cddedcontent' id='cddedcontent' style='width:98%;height:100px;display:;overflow:auto;'><!--{$ask.cddedcontent}--></textarea><br /><span id="dcddedcontent" class="f_red"></span>
				</td>
			  </tr>
			  <!-- 提交保存 -->
			  <tr>
				<td class="hback"></td>
				<td class="hback">
				<a href="###" class="btn_b2" onclick="return checkform();"><span>编辑保存</span></a>
				&nbsp;&nbsp;
				<a href="<!--{$ucfile}-->?c=ask&<!--{$comeurl}-->" class="btn_b3"><span>返回列表</span></a>
				</td>
			  </tr>
	      </table>
		  </form>
	  </div>
	  <!--{/if}-->
	


    </div>
    <div style="clear:both;"></div>
  </div>
  <div style="clear:both;"></div>
</div>
<!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_footer.tpl"}-->
</body>
</html>
<script type="text/javascript">
function checkform() {
	var t = "";
	var v = "";

	//标题
	t = "title";
	v = $("#"+t).val();
	if(v == "") {
		dmsg("标题不能为空", t);
		return false;
	}
    
	//分类
	t = "catid";
	v = $("#"+t).val();
	if(v == "") {
		dmsg("请选择求助分类", t);
		return false;
	}

	//内容
	t = "content";
	v = $("#"+t).val();
	if(v == "") {
		dmsg("求助内容不能为空", t);
		return false;
	}
	$('#myform').submit();
	return true;
}
</script>