<?php
# Name: PHP版程氏音乐CMS管理系统 v3.0
# Author: 程氏<web@chshcms.com> [QQ:848769359]
# Homepage:http://www.chshcms.cn/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
header("Cache-Control: no-cache, must-revalidate"); 
header("Pragma: no-cache");
if(!@eregi($_SERVER['SERVER_NAME'],$_SERVER['HTTP_REFERER'])){exit('QQ:848769359');}
include_once("../lib/cs_conn.php");
include_once("../lib/cs_common.php");
$f=CS_Request('f');
global $db;
      $sql1="select * from ".Getdbname('tags')."";
      $results=$db->query($sql1);
        $tags1='';$tags2='';$tags3='';$tags4='';
	if($results){
	   while ($row1=$db->fetch_array($results)){
             if($row1['CS_CID']==1){
                  $tags1.='"'.$row1['CS_Name'].'",';
             }elseif($row1['CS_CID']==2){
                  $tags2.='"'.$row1['CS_Name'].'",';
             }elseif($row1['CS_CID']==3){
                  $tags3.='"'.$row1['CS_Name'].'",';
             }elseif($row1['CS_CID']==4){
                  $tags4.='"'.$row1['CS_Name'].'",';
             }
           }
        }
$tags1=$tags1."]";$tags2=$tags2."]";$tags3=$tags3."]";$tags4=$tags4."]";
$tags1=CS_ReplaceStr($tags1,",]","");$tags2=CS_ReplaceStr($tags2,",]","");$tags3=CS_ReplaceStr($tags3,",]","");$tags4=CS_ReplaceStr($tags4,",]","");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="/www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>选择标签</title>
<link href="css/tags.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/tags.js"></script>
</head>
<body>
<script type="text/javascript">
	var tagarray=Array(
		Array("按年代",<?php echo $tags1?>),Array("按曲风",<?php echo $tags2?>),Array("按心情",<?php echo $tags3?>),Array("按地域",<?php echo $tags4?>)	);
	var html='<div class="popDiyTags-form form-box"><div class="popDiyTags-title"><div class="fl"><h4 class="selected-index">你已经选择了 <span class="red">0</span> 个标签<em>（最多选择5个）</em></h4><ul class="selected-list selected-list01"></ul></div><a class="btn btnTure" href="javascript:void(0);"><span class="btn-wrap"><span class="btn-inner"><span class="btn-txt">添加并返回</span></span></span></a></div>';
	for(var i=0;i<tagarray.length;i++){
		html+='<dl class="popDiyTags-list clearfix">';
		html+='<dt>'+tagarray[i][0]+'</dt>';
		for(var j=1;j<tagarray[i].length;j++){
			html+='<dd><a href="#">'+tagarray[i][j]+'</a></dd>';
		}
		html+="</dl>";
	}
	html+='<div class="popDiyTags-title"><div class="fl"><h4 class="selected-index">你已经选择了 <span class="red">0</span> 个标签<em>（最多选择5个）</em></h4><ul class="selected-list selected-list02"></ul></div><a class="btn btnTure" href="javascript:void(0);"><span class="btn-wrap"><span class="btn-inner"><span class="btn-txt">添加并返回</span></span></span></a></div></div></div>';

	document.writeln(html);

	function ReturnValue(reimg){
		window.parent.document.<?php echo $f?>.value=reimg;
		this.parent.$('.webox').css({display:'none'});
		this.parent.$('.background').css({display:'none'});
	}

	function popclose(){
		this.parent.$('.webox').css({display:'none'});
		this.parent.$('.background').css({display:'none'});
	}
</script>
</body>
</html>