{:tpl head}

<table cellpadding="0" cellspacing="1" class="table_list">

 <caption>专题管理</caption>

  <tr>

   <td>

    <strong>管理选项：</strong>

    <a href="?file={:$file}&action=add">添加专题</a>&nbsp;|&nbsp;

    <a href="?file={:$file}&action=manage">管理专题</a>

   </td>

  </tr>

</table>

<!--{:if $a == 'add' || $a == 'edit'}-->

<script language = 'javascript'>

// 表单提交检测

function doCheck(obj){

   // 检测表单的有效性

   // 如：标题不能为空，内容不能为空，等等....

   if(obj.name.value==''){

      alert("请输入名称！");

      obj.name.focus();

      return false;

   }

   if(obj.title.value==''){

      alert("请输入标题");

      obj.title.focus();

      return false;

   }

   return true;

}

</script>

<table cellpadding="0" cellspacing="1" class="table_form">

 <caption>{:if $a == 'add'}添加{:else}修改{:/if}专题</caption>

 <form name="myform" action="?file={:$file}&action={:$a}" method="post" onsubmit="return doCheck(this);">

 <input type="hidden" name="specialid" value="{:$specialid}" />

 <tr>

  <td width="160" align="right">名 称：</td>

  <td>

   <input name="name" type="text" value="{:$name}" size="20"> 

   文件保存的名称，不可重复，一般是英文（拼音）</td>

 </tr>

 <tr>

  <td align="right">标 题：</td>

  <td>

   <input name="title" type="text" value="{:$title}" size="40"></td>

 </tr>

 <tr>

  <td align="right">Seotitle(标题)：</td>

  <td>

   <input name="seotitle" type="text" value="{:$seotitle}" size="40"></td>

 </tr>

 <tr>

  <td align="right">Meta Keywords(关键字)：</td>

  <td>

   <input name="keywords" type="text" value="{:$keywords}" size="55" />

  </td>

 </tr>

 <tr>

  <td align="right">Meta Description(描述)：</td>

  <td><input name="description" type="text" value="{:$description}" size="60" /></td>

 </tr>

 <tr>

  <td align="right">模 板：</td>

  <td>

  <select name="tpl"> 

  {:loop $specialtpl $v}<option value="{:$v}"{:tag_isselected($tpl,$v)}>{:$v}</option>{:/loop}

  </select>

  </td>

 </tr>

 <tr>

  <td colspan="2" height="30" align="center"><button type="submit" value="submit" name="submit">提交</button></td>

 </tr>

 </form>

</table>

<!--{:elseif $a == 'manage'}-->

<table cellpadding="0" cellspacing="1" class="table_list">

 <caption>管理专题</caption>

 <form name="myform" action="?file={:$file}&action={:$a}" method="post">

 <input type="hidden" value='' name="selids" />

 <tr align=center>

  <th width="4%"><input name="checkbox" type="checkbox" onclick="checkorno(this,this.form.names)" /></th>

  <th width="4%">ID</th>

  <th width="10%">名称</th>

  <th>标题</th>

  <th width="10%">栏目</th>

  <th>Seotitle(标题)</th>

  <th>Meta Keywords(关键字)</th>

  <th>Meta Description(描述)</th>

  <th width="10%">管理操作</th>

 </tr>

 {:loop $data $v}

 <tr>

  <td class="align_c"><input name="ids" type="checkbox" value="{:$v['specialid']}" /></td>

  <td class="align_c">{:$v['specialid']}</td>

  <td class="align_c">{:$v['name']}</td>

  <td>{:$v['title']}</td>

  <td class="align_c">{:$gcat_s[$v['catid']]['name']}</td>

  <td>{:$v['seotitle']}</td>

  <td>{:$v['keywords']}</td>

  <td>{:tag_cut($v['description'],100)}</td>

  <td class="align_c"><a href="?file=special&action=edit&specialid={:$v['specialid']}">修改</a>&nbsp;|&nbsp;<a href="?file=special&action=del&selids={:$v['specialid']}">删除</a></td>

 </tr>

 {:/loop}

 <tr>

  <td height="20" colspan="9" align="center">

   <button name="select1" onclick="selAll(this.form.ids)" type="button">全选</button>

   <button name="select2" onclick="noSelAll(this.form.ids)" type="button">反选</button>

   <button name="submitsc" type="button" onClick="subform(this.form,this.form.ids,'?file=special&action=del','确认删除吗？此操作不可恢复。')">删除</button>

  </td>

 </tr>

 </form>

</table>

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

{:if $pages}<div class="pages">{:$pages}</div>{:/if}

{:tpl foot}