<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<title>Tags标签目录树管理</title>
<LINK href="<?=base_url()?>csdj/admin/images/admin.css" type="text/css" rel="stylesheet">
<SCRIPT type="text/javascript" src="<?=base_url()?>csdj/admin/js/admin.js"></script>
<script type="text/javascript" src="<?=base_url()?>csdj/admin/js/dialog.js"></script>
</head>
<BODY style="margin:2px">
<table align="center" border="1" cellspacing="0" cellpadding="5" bordercolor="#A2DAE7" width="100%" style="border-collapse:collapse;">
<tr><td align="center" height="20" colspan="2" class="title">Tags标签管理</td></tr>
<tr>
<td width="20" bgcolor="#F0EFEC">&nbsp;</td>
<td width="99%">
<table width="100%" border="1" cellspacing="0" cellpadding="5" bordercolor="#A2DAE7">
<?php
$cname='';
for($j=1;$j<8;$j++){	
	         switch ($j){
                      case '1':$tname=( ! defined('CS_Tags_1'))?'按年代':CS_Tags_1;break;
                      case '2':$tname=( ! defined('CS_Tags_2'))?'按曲风':CS_Tags_2;break;
                      case '3':$tname=( ! defined('CS_Tags_3'))?'按心情':CS_Tags_3;break;
                      case '4':$tname=( ! defined('CS_Tags_4'))?'按地域':CS_Tags_4;break;
                      case '5':$tname=( ! defined('CS_Tags_5'))?'按场景':CS_Tags_5;break;
                      case '6':$tname=( ! defined('CS_Tags_6'))?'按乐器':CS_Tags_6;break;
                      case '7':$tname=( ! defined('CS_Tags_7'))?'按主题':CS_Tags_7;break;
                 }
                 $cname.='<option value="'.$j.'">'.$tname.'</option>';
                 echo '<form method="post" Name="Form'.$j.'" action="'.site_url('admin/tags/list_save').'">
                          <tr>
                              <td><table border="0" cellspacing="0" cellpadding="0">
                                    <tr align="left"><td width="50"><img src="'.Web_Path.'csdj/admin/images/folder-.gif" width="18" height="18"><img src="'.Web_Path.'csdj/admin/images/folder.gif" align="absmiddle"></td>
                                       <td width="45"><input size="3" name="CS_ID" value="'.$j.'" readonly/>&nbsp;&nbsp;
                                       <td width="355"><input size="25" name="CS_Name" value="'.$tname.'"></td>
                                       <td width="80">&nbsp;&nbsp;<input type="Submit" name="Submit" value="修改" class="italk-st"></td>
                                    </tr>
                                  </table>
                              </td>
                          </tr></form>
                 ';
                 $sqlstr="select CS_ID,CS_Name from ".CS_SqlPrefix."tags where CS_CID=".$j." order by CS_ID desc";
		 $result=$this->db->query($sqlstr);
	         foreach ($result->result() as $row) {
                          echo '
                                <tr>
                                    <td><table border="0" cellspacing="0" cellpadding="0">
                                             <tr align="left"><td width="50">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="'.Web_Path.'csdj/admin/images/folder-.gif" width="18" height="18"></td>
                                                 <td width="45">&nbsp;&nbsp;'.$row->CS_ID.'
                                                 <td width="255">&nbsp;&nbsp;'.$row->CS_Name.'</td>
                                                 <td width="180">&nbsp;&nbsp;<td width="80">&nbsp;&nbsp;<a href="'.site_url('admin/tags/edit/'.$row->CS_ID).'" title="编辑">修改</a>&nbsp;|&nbsp;<a href="'.site_url('admin/tags/del/'.$row->CS_ID).'" title="删除" onClick="return ConfirmDel()">删除</a></td>
                                             </tr>
                                        </table>
                                    </td>
                                </tr>
                           ';
                 }
}
?>
<form method="post" Name="Form'.$j.'" action="<?=site_url('admin/tags/save')?>">
<tr>
    <td><table border="0" cellspacing="0" cellpadding="0">
           <tr align="left">
                <td width="100">新增标签：&nbsp;&nbsp;
                <td width="100"><select name="CS_CID"><?=$cname?></select></td>
                <td width="150"><input size="25" name="CS_Name" value=""></td>
                <td width="80">&nbsp;&nbsp;<input type="Submit" name="Submit" value=" 新增 " class="italk-bt"></td>
           </tr>
       </table>
   </td>
</tr></form>
</table>
<br><br>
</body>
</html>