<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->
<!--{if $a == "run"}-->
<div class="oemarry_layout">
  <div class="oe_top_nav"><i></i>单页管理->单页内容</div>
  <div class="oe_content">
	
	<form id="serform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
	<div class="oe_txtwrap">
	  分类：<!--{hook mod='aboutcat' type='select' name='scatid' text='=请选择=' value=$scatid}-->&nbsp;&nbsp;
	  标题：<input type="text" name="stitle" id="stitle" class="input-200" value="<!--{$stitle}-->" />&nbsp;
	  &nbsp;&nbsp;&nbsp;<input type="submit" name="btn_search" id="btn_search" class="button_2" value="搜索" />
	</div>
	</form>

    <div class="oe_tools_bar clearfix">
      <a class="icon-checkbox-unchecked" href="javascript:;" id="selAll" onclick="oemarrySelectAll(this, 'selall');">选择</a>
      <a class="icon-remove-2" onclick="oemarryDialogFormDel('myform');">删除</a>
      <span class="fr"><a class="icon-plus" href="<!--{$oefile}-->&c=<!--{$c}-->&a=add">添加</a></span>
    </div>
    
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&a=del" method="post">
    <table class="oe_table_list table_cs">
	  <tr>
	    <th width="8%">ID</th>
		<th width="12%">分类</th>
		<th width="20%">标题</th>
		<th width="7%">图片</th>
		<th width="6%">排序</th>
		<th width="6%">状态</th>
		<th width="6%">推荐</th>
		<th width="10%">模板文件</th>
		<th width="14%">添加时间</th>
		<th>操作</th>
	  </tr>
	  <!--{if empty($about)}-->
	  <tr>
	    <td class="text_center" colspan="10">没有符合条件的信息！</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $about as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.abid}-->" /><!--{$volist.abid}--></td>
		<td><!--{$volist.catname}--></td>
		<td><a href="<!--{$urlpath}-->index.php?c=about&a=detail&id=<!--{$volist.abid}-->" target="_blank"><!--{$volist.title}--></a></td>
		<td class="text_center">
		<!--{if !empty($volist.thumbimg)}-->
		<img src="<!--{$urlpath}--><!--{$volist.thumbimg}-->" width="20px" height="20px" f="viewimg" data-img="<!--{$volist.drawimg}-->" />
		<!--{else}-->
		~~
		<!--{/if}-->
		</td>
		<td class="text_center"><!--{$volist.orders}--></td>
		<td class="text_center">
		<!--{if $volist.flag=='0'}-->
			<input type="hidden" id="attr_flag<!--{$volist.abid}-->" value="flagopen" />
			<img id="flag<!--{$volist.abid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.abid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$volist.abid}-->" value="flagclose" />
			<img id="flag<!--{$volist.abid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.abid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td class="text_center">
		<!--{if $volist.elite=='0'}-->
			<input type="hidden" id="attr_elite<!--{$volist.abid}-->" value="eliteopen" />
			<img id="elite<!--{$volist.abid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('elite', '<!--{$volist.abid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_elite<!--{$volist.abid}-->" value="eliteclose" />
			<img id="elite<!--{$volist.abid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('elite', '<!--{$volist.abid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td class="text_center"><!--{$volist.tplname}--></td>
		<td><!--{$volist.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
		<td class="text_center">
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.abid}-->&<!--{$comeurl}-->" class="oe_ico_blue">编辑</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.abid}-->&<!--{$comeurl}-->');" class="oe_ico_red">删除</a>
		</td>
	  </tr>
	  <!--{/foreach}-->
	  <!--{/if}-->
	</table>
	</form>

	<div class="oe_page_box"><!--{$showpage}--></div>

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

<!--{if $a == 'add'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>单页管理->单页内容->添加
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_content">
    <h6>添加单页内容</h6>
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post" />
	<input type="hidden" name="a" id="a" value="saveadd" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">标题：<span class="f_red">*</span></th>
		<td width="35%"><input type="text" name="title" id="title" class="input-b" /></td>
	    <th width="15%">所属分类：<span class="f_red"></span></th>
		<td width="35%"><!--{hook mod='aboutcat' type='select' name='catid' text='=请选择='}--></td>
	  </tr>
	  <tr>
		<th>状态：</th>
		<td>
		  <input type="radio" name="flag" id="flag" value="1" checked />正常，
		  <input type="radio" name="flag" id="flag" value="0" />锁定
		</td>
		<th>推荐：</th>
		<td>
		  <input type="radio" name="elite" id="elite" value="1" />是，
		  <input type="radio" name="elite" id="elite" value="0" checked />否
		</td>
	  </tr>
	  <tr>
		<th>排序：</th>
		<td><input type="text" name="orders" id="orders" class="input-s" value="<!--{$orders}-->" /></td>
		<th>图片：<span class="f_red"></span> </th>
		<td>
		  <table class="oe_table_wrap">
		    <tr>
			  <td width="150px">
				  <div class="oe_img_upload">
					<label class="_uploadbtn">点击上传<input type="file" name="img" id="img" value="" /></label>
					<label class="_uploading" id="img_loading">
					  <img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" />上传中...
					</label>
					<input type="hidden" id="img_thumb" name="thumbimg" value="" />
					<input type="hidden" id="img_url" name="drawimg" value="" />
				  </div>
				  <script type="text/javascript">
				  $(function(){
					  $("#img").live("change", function(){
						oemarryUploadImg("img", "<!--{$oefile}-->&c=index&a=uploadimg&module=upload&thumbfiles=1");
					  });
				  });
				  </script>
			  </td>
			  <td width="50px">预览：</td>
			  <td width="80px">
			    <img src="<!--{$urlpath}-->tpl/static/images/nopic.jpg" width="30px" height="30px" id="img_preview" f="viewimg" />
				<a href="javascript:;" class="_removeimg" f="removeimg" data-preview="img_preview" data-thumb="img_thumb" data-draw="img_url">移除</a>
			  </td>
			  <td></td>
			</tr>
		  </table>
		</td>
	  </tr>

	  <tr>
		<th>指定模板文件：<span class="f_red"></span> </th>
		<td>
		  <input type="text" name="tplname" id="tplname" class="input-150" />.tpl
		  <a href="###" style="color:#ff6600;" onclick="oemarry_varpop_tpl('tplname');">选择模板</a> (不填写为默认模板)
		</td>
		<th>浏览次数：</th>
		<td><input type="text" name="hits" id="hits" class="input-100" /></td>
	  </tr>
	  <tr>
	    <th>内容：</th>
		<td colspan="3">
		<textarea name="content" id="content" style="width:90%;height:350px;display:none;"></textarea>
		</td>
	  </tr>
	  <tr>
		<th>meta标题：<span class="f_red"></span> </th>
		<td colspan="3"><input type="text" name="metatitle" id="metatitle" class="input-b" /></td>
	  </tr>
	  <tr>
	    <th>Meta描述：</th>
		<td colspan="3"><textarea name="metadesc" id="metadesc" style="width:50%;height:40px;"></textarea></td>
	  </tr>
	  <tr>
	    <th>Meta关键词：</th>
		<td colspan="3"><textarea name="metakeyword" id="metakeyword" style="width:50%;height:40px;"></textarea></td>
	  </tr>
	  <tr>
	    <td></td>
		<td><input type="button" id="btn_save" class="button_2" value="添加保存" /> </td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){
	var myeditor;
	KindEditor.ready(function(K) {myeditor = K.create("#content");});
	$("#btn_save").bind("click", function(){
		if ($("#title").val().length == 0) {
			ToastShow("请填写标题", "title");
			return false;
		}
		$("#content").text(myeditor.html());
		$("#myform").submit();
	});
});
</script>
<!--{/if}-->


<!--{if $a == 'edit'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>单页管理->单页内容->编辑
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_content">
    <h6>编辑单页内容</h6>
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->" method="post" />
	<input type="hidden" name="a" id="a" value="saveedit" />
	<input type="hidden" name="id" id="id" value="<!--{$id}-->" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">标题：<span class="f_red">*</span></th>
		<td width="35%"><input type="text" name="title" id="title" value="<!--{$about.title}-->" class="input-b" /></td>
	    <th width="15%">所属分类：<span class="f_red"></span></th>
		<td width="35%"><!--{hook mod='aboutcat' type='select' name='catid' text='=请选择=' value=$about.catid}--></td>
	  </tr>
	  <tr>
		<th>状态：</th>
		<td>
		  <input type="radio" name="flag" id="flag" value="1"<!--{if $about.flag == '1'}--> checked<!--{/if}--> />正常，
		  <input type="radio" name="flag" id="flag" value="0"<!--{if $about.flag == '0'}--> checked<!--{/if}--> />锁定
		</td>
		<th>推荐：</th>
		<td>
		  <input type="radio" name="elite" id="elite" value="1"<!--{if $about.elite == '1'}--> checked<!--{/if}--> />是，
		  <input type="radio" name="elite" id="elite" value="0"<!--{if $about.elite == '0'}--> checked<!--{/if}--> />否
		</td>
	  </tr>
	  <tr>
		<th>排序：</th>
		<td><input type="text" name="orders" id="orders" class="input-s" value="<!--{$about.orders}-->" /></td>
		<th>图片：<span class="f_red"></span> </th>
		<td>
		  <table class="oe_table_wrap">
		    <tr>
			  <td width="150px">
				  <div class="oe_img_upload">
					<label class="_uploadbtn">点击上传<input type="file" name="img" id="img" value="" /></label>
					<label class="_uploading" id="img_loading">
					  <img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" />上传中...
					</label>
					<input type="hidden" id="img_thumb" name="thumbimg" value="<!--{$about.thumbimg}-->" />
					<input type="hidden" id="img_url" name="drawimg" value="<!--{$about.drawimg}-->" />
				  </div>
				  <script type="text/javascript">
				  $(function(){
					  $("#img").live("change", function(){
						oemarryUploadImg("img", "<!--{$oefile}-->&c=index&a=uploadimg&module=upload&thumbfiles=1");
					  });
				  });
				  </script>
			  </td>
			  <td width="50px">预览：</td>
			  <td width="80px">
			    <!--{if !empty($about.thumbimg)}-->
				<img src="<!--{$urlpath}--><!--{$about.thumbimg}-->" width="30px" height="30px" id="img_preview" f="viewimg" />
				<!--{else}-->
				<img src="<!--{$urlpath}-->tpl/static/images/nopic.jpg" width="30px" height="30px" id="img_preview" f="viewimg" />
				<!--{/if}-->
				<a href="javascript:;" class="_removeimg" f="removeimg" data-preview="img_preview" data-thumb="img_thumb" data-draw="img_url">移除</a>
			  </td>
			  <td></td>
			</tr>
		  </table>
		</td>
	  </tr>

	  <tr>
		<th>指定模板文件：<span class="f_red"></span> </th>
		<td>
		  <input type="text" name="tplname" id="tplname" value="<!--{$about.tplname}-->" class="input-150" />.tpl
		  <a href="###" style="color:#ff6600;" onclick="oemarry_varpop_tpl('tplname');">选择模板</a> (不填写为默认模板)
		</td>
		<th>浏览次数：</th>
		<td><input type="text" name="hits" id="hits" class="input-100" value="<!--{$about.hits}-->" /></td>
	  </tr>
	  <tr>
	    <th>内容：</th>
		<td colspan="3">
		<textarea name="content" id="content" style="width:90%;height:350px;display:none;"><!--{$about.content}--></textarea>
		</td>
	  </tr>
	  <tr>
		<th>meta标题：<span class="f_red"></span> </th>
		<td colspan="3"><input type="text" name="metatitle" id="metatitle" class="input-b" value="<!--{$about.metatitle}-->" /></td>
	  </tr>
	  <tr>
	    <th>Meta描述：</th>
		<td colspan="3"><textarea name="metadesc" id="metadesc" style="width:50%;height:40px;"><!--{$about.metadesc}--></textarea></td>
	  </tr>
	  <tr>
	    <th>Meta关键词：</th>
		<td colspan="3"><textarea name="metakeyword" id="metakeyword" style="width:50%;height:40px;"><!--{$about.metakeyword}--></textarea></td>
	  </tr>
	  <tr>
	    <td></td>
		<td><input type="button" id="btn_save" class="button_2" value="编辑保存" /> </td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){
	var myeditor;
	KindEditor.ready(function(K) {myeditor = K.create("#content");});

	$("#btn_save").bind("click", function(){
		if ($("#title").val().length == 0) {
			ToastShow("请填写标题", "title");
			return false;
		}
		$("#content").text(myeditor.html());
		$("#myform").submit();
	});
});
</script>
<!--{/if}-->
</body>
</html>