<!--{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='articlecat' name='scatid' type='select' text='=默认=' value=$scatid}-->&nbsp;
	  标题：<input type="text" name="stitle" id="stitle" class="input-150" value="<!--{$stitle}-->" />&nbsp;
	  状态：
	  <select name="sflag" id="sflag">
	  <option value=""></option>
	  <option value="1"<!--{if $sflag == '1'}--> selected<!--{/if}-->>正常</option>
	  <option value="2"<!--{if $sflag == '2'}--> selected<!--{/if}-->>锁定</option>
	  </select>
	  &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="24%">标题</th>
		<th width="8%">分类</th>
		<th width="5%">图文</th>
		<th width="10%">地区</th>
		<th width="13%">添加时间</th>
		<th width="5%">状态</th>
		<th width="5%">推荐</th>
		<th width="5%">头条</th>
		<th width="6%">浏览</th>
		<th>操作</th>
	  </tr>
	  <!--{if empty($article)}-->
	  <tr>
	    <td class="text_center" colspan="11">没有符合条件的信息！</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $article as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.articleid}-->" /><!--{$volist.articleid}--></td>
		<td><!--{$volist.title}--></td>
		<td class="text_center"><!--{$volist.catname}--></td>
		<td class="text_center">
		<!--{if !empty($volist.thumbimg)}-->
		<img src="<!--{$volist.thumbimg}-->" width="20px" height="20px" data-img="<!--{$volist.drawimg}-->" f="viewimg" />
		<!--{else}-->
		~~
		<!--{/if}-->
		</td>
		<td class="text_center"><!--{area type='text' value=$volist.area1}--> <!--{area type='text' value=$volist.area2}--></td>
		<td class="text_center"><!--{$volist.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
		<td class="text_center">
		<!--{if $volist.flag=='0'}-->
			<input type="hidden" id="attr_flag<!--{$volist.articleid}-->" value="flagopen" />
			<img id="flag<!--{$volist.articleid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.articleid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$volist.articleid}-->" value="flagclose" />
			<img id="flag<!--{$volist.articleid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.articleid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td class="text_center">
		<!--{if $volist.elite=='0'}-->
			<input type="hidden" id="attr_elite<!--{$volist.articleid}-->" value="eliteopen" />
			<img id="elite<!--{$volist.articleid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('elite', '<!--{$volist.articleid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_elite<!--{$volist.articleid}-->" value="eliteclose" />
			<img id="elite<!--{$volist.articleid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('elite', '<!--{$volist.articleid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td class="text_center">
		<!--{if $volist.istop=='0'}-->
			<input type="hidden" id="attr_top<!--{$volist.articleid}-->" value="topopen" />
			<img id="top<!--{$volist.articleid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('top', '<!--{$volist.articleid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_top<!--{$volist.articleid}-->" value="topclose" />
			<img id="top<!--{$volist.articleid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('top', '<!--{$volist.articleid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td class="text_center"><!--{$volist.hits}--></td>
		<td class="text_center">
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.articleid}-->&<!--{$comeurl}-->" class="oe_ico_blue">编辑</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.articleid}-->&<!--{$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%"><!--{hook mod='articlecat' type='select' name='catid' text='=请选择='}--></td>
		<th width="15%">所在地区：</th>
		<td width="35%">
		<!--{area type='select' name='area' depth='1' child='1' text='=请选择='}-->
		<span id="json_area2">
		  <select name="area2" id="area2"><option value="">=请选择=</option></select>
		</span>
		<span id="json_area3">
		  <select name="area3" id="area3"><option value="">=请选择=</option></select>
		</span>
		<span id="json_area4">
		
		</span>
		</td>
	  </tr>
	  <tr>
	    <th>标题：<span class="f_red">*</span></th>
		<td colspan="3">
		  <input type="text" name="title" id="title" class="input-b" />
		  <span class="oe_trap">（225个字以内）</span>
		</td>
	  </tr>
	  <tr>
		<th>封面图片：<span class="f_red"></span> </th>
		<td>
		  <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=article&thumbfiles=img_url");
			  });
		  });
		  </script>
		</td>
		<th>作者：</th>
		<td><input type="text" name="author" id="author" class="input-150" /></td>
	  </tr>
	  <tr>
		<th>图片预览：</th>
		<td>
		  <img src="<!--{$urlpath}-->tpl/static/images/waitimg.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>
		<th>来源：</th>
		<td><input type="text" name="comefrom" id="comefrom" class="input-150" /></td>
	  </tr>
	  <tr>
	    <th>摘要：<span class="f_red"></span> </th>
		<td><textarea name="summary" id="summary" style="width:80%;height:40px;"></textarea></td>
		<th>浏览次数：</th>
		<td><input type="text" name="hits" id="hits" class="input-s" /></td>
	  </tr>
	  <tr>
	    <th>状态：<span class="f_red"></span> </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>头条：<span class="f_red"></span> </th>
		<td colspan="3">
		<input type="radio" name="istop" id="istop" value="1" checked />是，
		<input type="radio" name="istop" id="istop" value="0" />否
		</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>指定模板文件：<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>
	  </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描述：<span class="f_red"></span> </th>
		<td colspan="3"><textarea name="metadesc" id="metadesc" style="width:50%;height:40px;"></textarea></td>
	  </tr>
	  <tr>
		<th>meta关键词：<span class="f_red"></span> </th>
		<td colspan="3">
		  <textarea name="metakeyword" id="metakeyword" style="width:50%;height:40px;"></textarea><br />
		  （多个关键词请使用英文逗号“,”隔开）
		</td>
	  </tr>
	  <tr>
	    <td></td>
		<td colspan="3"> <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%"><!--{hook mod='articlecat' type='select' name='catid' text='=请选择=' value=$article.catid}--></td>
		<th width="15%">所在地区：</th>
		<td width="35%">
		<!--{area type='select' name='area' depth='1' child='1' text='=请选择=' value=$article.area1}-->
		<span id="json_area2">
		  <!--{if $article.area1 > 0}-->
		  <!--{area type='select' name='area' depth='2' child='1' text='=请选择=' parentid=$article.area1 value=$article.area2}-->
		  <!--{else}-->
		  <select name="area2" id="area2"><option value="">=请选择=</option></select>
		  <!--{/if}-->
		</span>
		<span id="json_area3">
		  <!--{if $article.area2 > 0}-->
		  <!--{area type='select' name='area' depth='3' child='1' text='=请选择=' parentid=$article.area2 value=$article.area3}-->
		  <!--{else}-->
		  <select name="area3" id="area3"><option value="">=请选择=</option></select>
		  <!--{/if}-->
		</span>
		<span id="json_area4">
		  <!--{if $article.area3 > 0}-->
		  <!--{area type='select' name='area' depth='4' text='=请选择=' parentid=$article.area3 value=$article.area4}-->
		  <!--{/if}-->
		</span>
		</td>
	  </tr>
	  <tr>
	    <th>标题：<span class="f_red">*</span></th>
		<td colspan="3">
		  <input type="text" name="title" id="title" class="input-b" value="<!--{$article.title}-->" />
		  <span class="oe_trap">（225个字以内）</span>
		</td>
	  </tr>
	  <tr>
		<th>封面图片：<span class="f_red"></span> </th>
		<td>
		  <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="<!--{$article.thumbimg}-->" />
		    <input type="hidden" id="img_url" name="drawimg" value="<!--{$article.drawimg}-->" />
		  </div>
		  <script type="text/javascript">
		  $(function(){
			  $("#img").live("change", function(){
				oemarryUploadImg("img", "<!--{$oefile}-->&c=index&a=uploadimg&module=article&thumbfiles=img_url");
			  });
		  });
		  </script>
		</td>
		<th>作者：</th>
		<td><input type="text" name="author" id="author" class="input-150" value="<!--{$article.author}-->" /></td>
	  </tr>
	  <tr>
		<th>图片预览：</th>
		<td>
		  <!--{if !empty($article.thumbimg)}-->
		  <img src="<!--{$urlpath}--><!--{$article.thumbimg}-->" width="30px" height="30px" id="img_preview" f="viewimg" />
		  <!--{else}-->
		  <img src="<!--{$urlpath}-->tpl/static/images/waitimg.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>
		<th>来源：</th>
		<td><input type="text" name="comefrom" id="comefrom" class="input-150" value="<!--{$article.comefrom}-->" /></td>
	  </tr>
	  <tr>
	    <th>摘要：<span class="f_red"></span> </th>
		<td><textarea name="summary" id="summary" style="width:80%;height:40px;"><!--{$article.summary}--></textarea></td>
		<th>浏览次数：</th>
		<td><input type="text" name="hits" id="hits" class="input-s" value="<!--{$article.hits}-->" /></td>
	  </tr>
	  <tr>
	    <th>状态：<span class="f_red"></span> </th>
		<td>
		<input type="radio" name="flag" id="flag" value="1"<!--{if $article.flag=='1'}--> checked<!--{/if}--> />正常，
		<input type="radio" name="flag" id="flag" value="0"<!--{if $article.flag=='0'}--> checked<!--{/if}--> />锁定
		</td>
		<th>推荐：</th>
		<td>
		<input type="radio" name="elite" id="elite" value="1"<!--{if $article.elite=='1'}--> checked<!--{/if}--> />是，
		<input type="radio" name="elite" id="elite" value="0"<!--{if $article.elite=='0'}--> checked<!--{/if}--> />否
		</td>
	  </tr>
	  <tr>
	    <th>头条：<span class="f_red"></span> </th>
		<td colspan="3">
		<input type="radio" name="istop" id="istop" value="1"<!--{if $article.istop=='1'}--> checked<!--{/if}--> />是，
		<input type="radio" name="istop" id="istop" value="0"<!--{if $article.istop=='0'}--> checked<!--{/if}--> />否
		</td>
	  </tr>
	  <tr>
	    <th>内容：</th>
		<td colspan="3">
		<textarea name="content" id="content" style="width:90%;height:350px;display:none;"><!--{$article.content}--></textarea>
		</td>
	  </tr>
	  <tr>
	    <th>指定模板文件：<span class="f_red"></span> </th>
		<td>
		  <input type="text" name="tplname" id="tplname" class="input-150" value="<!--{$article.tplname}-->" />.tpl
		  <a href="###" style="color:#ff6600;" onclick="oemarry_varpop_tpl('tplname');">选择模板</a> (不填写为默认模板)
		</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="<!--{$article.metatitle}-->" /></td>
	  </tr>
	  <tr>
		<th>meta描述：<span class="f_red"></span> </th>
		<td colspan="3"><textarea name="metadesc" id="metadesc" style="width:50%;height:40px;"><!--{$article.metadesc}--></textarea></td>
	  </tr>
	  <tr>
		<th>meta关键词：<span class="f_red"></span> </th>
		<td colspan="3">
		  <textarea name="metakeyword" id="metakeyword" style="width:50%;height:40px;"><!--{$article.metakeyword}--></textarea><br />
		  （多个关键词请使用英文逗号“,”隔开）
		</td>
	  </tr>

	  <tr>
	    <td></td>
		<td colspan="3"> <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>