<!--{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">
	  城市名称：<input type="text" name="sname" id="sname" class="input-150" value="<!--{$sname}-->" />&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="10%">ID</th>
		<th width="20%">城市名称</th>
		<th width="10%">首字母</th>
		<th width="10%">排序</th>
		<th width="8%">状态</th>
		<th width="8%">热门</th>
		<th width="8%">推荐</th>
		<th width="15%">添加时间</th>
		<th>操作</th>
	  </tr>
	  <!--{if empty($city)}-->
	  <tr>
	    <td class="text_center" colspan="9">No data!</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $city as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.cityid}-->" /><!--{$volist.cityid}--></td>
		<td>
		<!--{if empty($volist.cityname)}-->
		<!--{$volist.areaname}-->
		<!--{else}-->
		<!--{$volist.cityname}-->
		<!--{/if}-->
		</td>
		<td class="text_center"><!--{$volist.letter}--></td>
		<td class="text_center"><!--{$volist.orders}--></td>
		<td class="text_center">
		<!--{if $volist.flag=='0'}-->
			<input type="hidden" id="attr_flag<!--{$volist.cityid}-->" value="flagopen" />
			<img id="flag<!--{$volist.cityid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.cityid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$volist.cityid}-->" value="flagclose" />
			<img id="flag<!--{$volist.cityid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.cityid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td class="text_center">
		<!--{if $volist.ishot=='0'}-->
			<input type="hidden" id="attr_hot<!--{$volist.cityid}-->" value="hotopen" />
			<img id="hot<!--{$volist.cityid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('hot', '<!--{$volist.cityid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_hot<!--{$volist.cityid}-->" value="hotclose" />
			<img id="hot<!--{$volist.cityid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('hot', '<!--{$volist.cityid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td class="text_center">
		<!--{if $volist.elite=='0'}-->
			<input type="hidden" id="attr_elite<!--{$volist.cityid}-->" value="eliteopen" />
			<img id="elite<!--{$volist.cityid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('elite', '<!--{$volist.cityid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_elite<!--{$volist.cityid}-->" value="eliteclose" />
			<img id="elite<!--{$volist.cityid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('elite', '<!--{$volist.cityid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</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.cityid}-->&<!--{$comeurl}-->" class="oe_ico_blue">编辑</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.cityid}-->&<!--{$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" />
	<input type="hidden" name="cityid" id="cityid" value="" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">选择城市地区：<span class="f_red">*</span></th>
		<td width="85%">
		<!--{area type='select' name='dist' depth='1' child='1' text='=请选择='}-->
		<span id="json_dist2">
		  <select name="dist2" id="dist2"><option value="">=请选择=</option></select>
		</span>	  
		</td>
	  </tr>
	  <tr>
		<th>名称：</th>
		<td><input type="text" name="cityname" id="cityname" class="input-200" />（不填写以选择的地区为名称）</td>
	  </tr>
	  <tr>
		<th>首字母：<span class="f_red">*</span></th>
		<td><input type="text" name="letter" id="letter" class="input-100" />（城市首字母）</td>
	  </tr>
	  <tr>
		<th>排序：</th>
		<td><input type="text" name="orders" id="orders" class="input-s" value="<!--{$orders}-->" /></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>
	  </tr>
	  <tr>
		<th>热门：</th>
		<td>
		  <input type="radio" name="ishot" id="ishot" value="1" />是，
		  <input type="radio" name="ishot" id="ishot" value="0" checked />否
		</td>
	  </tr>
	  <tr>
		<th>推荐：</th>
		<td>
		  <input type="radio" name="ishot" id="ishot" value="1" />是，
		  <input type="radio" name="ishot" id="ishot" value="0" checked />否
		</td>
	  </tr>

	  <tr>
		<th>Meta标题：<span class="f_red"></span></th>
		<td>
		  <textarea name="metatitle" id="metatitle" style="width:60%;height:50px;"></textarea><br />（支持{sitename}标签）
		</td>
	  </tr>

	  <tr>
		<th>Meta关键词：<span class="f_red"></span></th>
		<td>
		 <textarea name="metakeyword" id="metakeyword" style="width:60%;height:50px;"></textarea><br />（多个关键词用英文逗号隔开，支持{sitename}标签）
		</td>
	  </tr>

	  <tr>
		<th>Meta描述：<span class="f_red"></span></th>
		<td>
		<textarea name="metadesc" id="metadesc" style="width:60%;height:50px;"></textarea><br />（支持{sitename}标签）
		</td>
	  </tr>

	  <tr>
	    <td></td>
		<td>
		<input type="button" id="btn_save" class="button_2" value="添加保存" /> 
	    <span id="submit_tips" class="error"></span>
		</td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){

	$("#btn_save").bind("click", function(){
		$cityid = $("#dist2").find("option:selected").val();
		if ($cityid.length == 0) {
			ToastShow("请选择城市地区");
			return false;
		}
		$("#cityid").val($cityid);

		if ($("#letter").val().length == 0) {
			ToastShow("请填写首字母");
			return false;
		}
		$("#myform").submit();
	});

});
</script>
<!--{/if}-->


<!--{if $a == 'edit'}-->
<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="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="85%"><!--{area type="text" value=$city.cityid}--></td>
	  </tr>
	  <tr>
		<th>名称：</th>
		<td><input type="text" name="cityname" id="cityname" class="input-200" value="<!--{$city.cityname}-->" />（不填写以选择的地区为名称）</td>
	  </tr>
	  <tr>
		<th>首字母：<span class="f_red">*</span></th>
		<td><input type="text" name="letter" id="letter" class="input-100" value="<!--{$city.letter}-->" />（城市首字母）</td>
	  </tr>
	  <tr>
		<th>排序：</th>
		<td><input type="text" name="orders" id="orders" class="input-s" value="<!--{$city.orders}-->" /></td>
	  </tr>
	  <tr>
		<th>状态：</th>
		<td>
		  <input type="radio" name="flag" id="flag" value="1"<!--{if $city.flag == '1'}--> checked<!--{/if}--> />是，
		  <input type="radio" name="flag" id="flag" value="0"<!--{if $city.flag == '0'}--> checked<!--{/if}--> />否
		</td>
	  </tr>
	  <tr>
		<th>热门：</th>
		<td>
		  <input type="radio" name="ishot" id="ishot" value="1"<!--{if $city.flag == '1'}--> checked<!--{/if}--> />是，
		  <input type="radio" name="ishot" id="ishot" value="0"<!--{if $city.flag == '0'}--> checked<!--{/if}--> />否
		</td>
	  </tr>
	  <tr>
		<th>推荐：</th>
		<td>
		  <input type="radio" name="elite" id="elite" value="1"<!--{if $city.elite == '1'}--> checked<!--{/if}--> />是，
		  <input type="radio" name="elite" id="elite" value="0"<!--{if $city.elite == '0'}--> checked<!--{/if}--> />否
		</td>
	  </tr>

	  <tr>
		<th>Meta标题：<span class="f_red"></span></th>
		<td>
		  <textarea name="metatitle" id="metatitle" style="width:60%;height:50px;"><!--{$city.metatitle}--></textarea>
		  <br />（支持{sitename}标签）
		</td>
	  </tr>

	  <tr>
		<th>Meta关键词：<span class="f_red"></span></th>
		<td>
		 <textarea name="metakeyword" id="metakeyword" style="width:60%;height:50px;"><!--{$city.metakeyword}--></textarea><br />
		（多个关键词用英文逗号隔开，支持{sitename}标签）
		</td>
	  </tr>

	  <tr>
		<th>Meta描述：<span class="f_red"></span></th>
		<td>
		<textarea name="metadesc" id="metadesc" style="width:60%;height:50px;"><!--{$city.metadesc}--></textarea><br />
		（支持{sitename}标签）
		</td>
	  </tr>

	  <tr>
	    <td></td>
		<td>
		<input type="button" id="btn_save" class="button_2" value="编辑保存" /> 
	    <span id="submit_tips" class="error"></span>
		</td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){
	$("#btn_save").bind("click", function(){
		if ($("#letter").val().length == 0) {
			ToastShow("请填写首字母");
			return false;
		}
		$("#myform").submit();
	});
});
</script>
<!--{/if}-->
</body>
</html>