<!--{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='city' type='select' name='scityid' text='=请选择=' value=$scityid}-->&nbsp;
	  网站名称：<input type="text" name="sname" id="sname" class="input-150" value="<!--{$sname}-->" />&nbsp;
	  网站URL：<input type="text" name="surl" id="surl" class="input-150" value="<!--{$surl}-->" />&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;&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="13%">网站名称</th>
		<th width="18%">网站URL</th>
		<th width="8%">所属城市</th>
		<th width="8%">排序</th>
		<th width="8%">状态</th>
		<th width="13%">添加时间</th>
		<th width="12%">备注说明</th>
		<th>操作</th>
	  </tr>
	  <!--{if empty($friendlink)}-->
	  <tr>
	    <td class="text_center" colspan="9">No data!</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $friendlink as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.linkid}-->" /><!--{$volist.linkid}--></td>
		<td><!--{$volist.name}--></td>
		<td><!--{$volist.url}--></td>
		<td>
		  <!--{if $volist.cityid == '0'}-->
		  ~~
		  <!--{else}-->
		  <!--{$volist.cityname}-->
		  <!--{/if}-->
		</td>
		<td class="text_center"><!--{$volist.orders}--></td>
		<td class="text_center">
		<!--{if $volist.flag == '1'}-->
		<font color="green">正常</font>
		<!--{else}-->
		<font color="red">锁定</font>
		<!--{/if}-->
		</td>
		<td><!--{$volist.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
		<td><!--{$volist.remark}--></td>
		<td class="text_center">
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.linkid}-->&<!--{$comeurl}-->" class="oe_ico_blue">编辑</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.linkid}-->&<!--{$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>所属城市：<span class="f_red"></span></th>
		<td><!--{hook mod="city" type="select" name="cityid" text="=不限="}--></td>
	  </tr>
	  <tr>
	    <th width="15%">网站名称：<span class="f_red">*</span></th>
		<td width="85%"><input type="text" name="name" id="name" class="input-b" /></td>
	  </tr>
	  <tr>
	    <th>网站URL：<span class="f_red">*</span></th>
		<td><input type="text" name="url" id="url" class="input-b" /></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="text" name="orders" id="orders" class="input-s" value="<!--{$orders}-->" /></td>
	  </tr>
	  <tr>
	    <th>备注说明：</th>
		<td colspan="3"><textarea name="remark" id="remark" style="width:50%;height:60px;"></textarea></td>
	  </tr>
	</table>
	<div class="oe_button_layout">
	  <input type="button" id="btn_save" class="button_2" value="添加保存" /> 
	  <span id="submit_tips" class="error"></span>
	</div>
	</form>
  </div>
</div>
<!--{/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>所属城市：<span class="f_red"></span></th>
		<td><!--{hook mod="city" type="select" name="cityid" text="=不限=" value=$friendlink.cityid}--></td>
	  </tr>
	  <tr>
	    <th width="15%">网站名称：<span class="f_red">*</span></th>
		<td width="85%"><input type="text" name="name" id="name" class="input-b" value="<!--{$friendlink.name}-->" /></td>
	  </tr>
	  <tr>
	    <th>网站URL：<span class="f_red">*</span></th>
		<td><input type="text" name="url" id="url" class="input-b" value="<!--{$friendlink.url}-->" /></td>
	  </tr>
	  <tr>
		<th>状态：</th>
		<td>
		<input type="radio" name="flag" id="flag" value="1"<!--{if $friendlink.flag == '1'}--> checked<!--{/if}--> />正常，
		<input type="radio" name="flag" id="flag" value="0"<!--{if $friendlink.flag == '0'}--> checked<!--{/if}--> />锁定
		</td>
	  </tr>
	  <tr>
		<th>排序：</th>
		<td><input type="text" name="orders" id="orders" class="input-s" value="<!--{$friendlink.orders}-->" /></td>
	  </tr>
	  <tr>
	    <th>备注说明：</th>
		<td colspan="3"><textarea name="remark" id="remark" style="width:50%;height:60px;"><!--{$friendlink.remark}--></textarea></td>
	  </tr>
	</table>
	<div class="oe_button_layout">
	  <input type="button" id="btn_save" class="button_2" value="编辑保存" /> 
	  <span id="submit_tips" class="error"></span>
	</div>
	</form>
  </div>
</div>
<!--{/if}-->

<script type="text/javascript">
$(function(){
	$("#btn_save").bind("click", function(){ //添加保存
		if ($("#name").val().length == 0) {
			ToastShow("网站名称不能为空", "name");
			return false;
		}
		if ($("#url").val().length == 0) {
			ToastShow("网站URL不能为空", "url");
			return false;
		}
		$("#myform").submit();
	});
});
</script>
</body>
</html>