{include file="header.tpl" page_name=$page_name sys_name=$sys_name}
{literal}
<script language = "JavaScript">
	function chkForm() {
		var channel_name = document.getElementById("channel_name");
		if (channel_name.value == "") {
			alert('频道名称不能为空！');
			return false;
		}
	}
</script>
{/literal}
<div align="center">
{$admin_nav}
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="adminMenu g-margin" align="center">
	<tr>
		<td><b>管理菜单：</b> <a href="?action={$action}&channel_type={$channel_type}">频道列表</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="?action={$action}&channel_type={$channel_type}&do=add">添加频道</a></td>
	</tr>
</table>
{if $task eq 'channel_list'}
{if $data}
	<table width="98%" border="0" cellpadding="0" cellspacing="0" class="tableborder tableborder_line">
	<tr class="header">
	<td colspan="2" width="10%">编号</td>
	<td colspan="2">频道名称</td>
    <td colspan="2" nowrap="nowrap">查看分类</td>
    <td colspan="2" nowrap="nowrap">查看文章</td>
	<td colspan="2">导航显示</td>
    <td colspan="2">分类文章显示条数</td>
    <td colspan="2">所属模块</td>
	<td colspan="2">操作时间</td>
	<td colspan="2">管理选项</td>
	</tr>
	<tbody>
	{foreach from=$data item=list}
		<tr>
		<td colspan="2">{$list.channel_id}</td>
       
		<td colspan="2" align="center">{$list.channel_name}</td>
        <td class="center" colspan="2"><a href="admincp.php?action=category&channel_id={$list.channel_id}&channel_type={$list.channel_type}">查看</a></td>
        <td class="center" colspan="2"><a href="admincp.php?action=model_operate&task=list&channel_type={$list.channel_type}&channel_id={$list.channel_id}">查看</a></td>
		<td colspan="2" class="center">{if $list.menu_show==1}显示</a>{else}<font color=red>不显示</font>{/if}</td>
        <td colspan="2" class="center">{$list.display_num}</td>
        <td colspan="2"  class="center">{$list.cn_name}</td>
		<td colspan="2" align="center">{$list.opt_time|date_format:"%Y-%m-%d %H:%M:%S"}</td>
		<td colspan="2"  style="cursor:pointer;"><a href="?action=channel&channel_type={$list.channel_type}&do=modify&channel_id={$list.channel_id}">编辑</a> | <span><a href="admincp.php?action=channel&do=delete&channel_id={$list.channel_id}">删除</a></span></td>
		</tr>
	{/foreach}
	</table>
    {else}
    <div class="notice_msg">无可用频道,请添加</div>
    {/if}
{/if}
{if $task eq 'add_channel' || $task eq 'edit_channel' }
<form action="admincp.php?action=channel" method="post" name="frm"  autocomplete="off">
{if $task eq 'edit_channel'}
	<input type="hidden" value="{$data.channel_id}" name="channel_id" />
{/if}
<input type="hidden" value="{$task}" name="task" />
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tbody>
	<tr>
		<td width="19%" class="one">频道名称：</td>
		<td width="81%"><input type="text" name="data[channel_name]" maxlength="100" size=50 id="channel_name" 
        value="{if $se_data.channel_name}{$se_data.channel_name}{else}{$data.channel_name}{/if}" />		  &nbsp;&nbsp;<font color=red>*</font></td>
	</tr>
	<tr>
		<td class="one">所属模型：</td>
		<td>
        {if $channel_type eq ''}
        	<select name="data[channel_type]" id="channel_type">
            	{foreach from=$model_list item=c}
                	<option value="{$c.id}">{$c.cn_name}</option>
                {/foreach}
			</select>
            {else}
            <input value="{$channel_type}" type="hidden" name="data[channel_type]"/>
            <select disabled="disabled">
            <option disabled="disabled" selected="selected">{$channel_type_name}</option>
            </select>
          {/if}
            &nbsp;&nbsp;<font color=red>*</font>
		</td>
	</tr>
	<tr>
		<td class="one">外部连接：</td>
		<td>
        <input type="text" value="{if $data.out_link}{$data.out_link}{else}{$se_data.out_link}{/if}"  style=" width:300px;" name="data[out_link]" /> (若填写此内容,当访问该频道时页面将跳转到您填写的地址上去)
		</td>
	</tr>
    <tr>
    	<td class="one">频道下分类文章显示条数:</td>
        <td><input type="text" value="{if $data.display_num}{$data.display_num}{else}10{/if}" name="display_num" /></td>
    </tr>
    <tr>
    	<td class="one">自定义模板:</td>
        <td>
        <input type="text" value="{$data.channel_tpl_name}"  name="channel_tpl_name"/> 系统允许您自定义指定频道的模板,若不存在将使用系统默认
        </td>
    </tr>
	<tr>
		<td class="one">频道简介：</td>
		<td valign="top">{$description}</td>
	</tr>
	<tr>
		<td class="one">权重选项：</td>
		<td>
			<input {if $data.menu_show == 1}  checked="checked"{/if} type="checkbox" name="data[menu_show]" value="1"> 导航显示
			<!--<input {if $data.is_hidden == 1}  checked="checked" {/if} type="checkbox" name="data[is_hidden]" value="1"> 是否启用-->
		</td>
	</tr>
	<tr>
		<td class="one">频道排序：</td>
		<td><input type="text" name="data[order_num]" value="{if $data.order_num}{$data.order_num}{else}0{/if}" size="2"> </td>
	</tr>
	<tr>
		<td colspan="2"><div align="center"><input type="submit" value=" 提交 "></div></td>
	</tr>
</tbody>
</table>
</form>
{/if}
</div>
{include file="footer.tpl"}
