<?php
/*
'**************************************************************************************************
' 程序名称: CCTVAI开源音乐管理系统
' 官方网站: http://www.cctvai.com
' 联系 Q Q: 1542367792
' QQ交流群：136687984
' 版本：(终结版)
' 备注：未经书面授权，不得向任何第三方提供本软件系统！
' 功能，模板，插件，扩展，定制请联系QQ：1542367792
'**************************************************************************************************
*/
error_reporting(0); 
include "../include/cctvai.conn.php";
$id=SafeRequest("id", "get");
if(cd_mobile=="no"){header("Location:".LinkUrl("dj", 1, 1, $id)."");exit();}
if(cd_mobilepc=="no"){if (!isMobile()){header("Location:".LinkUrl("dj", 1, 1, $id)."");exit();}}
$error="您访问的Url页面不存在，请检查Url是否正确或包含非法字符！";
if(!IsNumID($id)) {exit(include _cctvai_root_ . "/include/error/content_error.php");}
$dj=$db->getrow('select * from ' . tname('dj') . " where CD_ID='" . $id . "'");
$db->query('update ' . tname('dj') . " set CD_DayHits=CD_DayHits+1,CD_WeekHits=CD_WeekHits+1,CD_MonthHits=CD_MonthHits+1,CD_Hits=CD_Hits+1 where CD_ID='" . $id . "'");
$form=strtolower(trim(substr(strrchr($dj['CD_Url'], "."), 1)));
$zan=$dj['CD_uHits']+1;
$cang=$dj['CD_FavHits']+1;

$server=$db->getrow("select * from " . tname('server') . " where CD_ID=" . $dj['CD_Server'] . "");
$playurl=$server['CD_Url'] . $dj['CD_Url'];
$playid=str_replace('.'.$form,'',$dj['CD_Url']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head> 
  <meta http-equiv="Content-Type" content="text/html; charset=gbk" /> 
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" /> 
  <meta name="apple-mobile-web-app-capable" content="yes" /> 
  <meta name="apple-mobile-web-app-status-bar-style" content="black" /> 
  <meta name="format-detection" content="telephone=no" /> 
  <title><?php echo $dj['CD_Name'];?>在线试听MP3下载-<?php echo cd_webname?>手机版</title> 
  <meta name="keywords" content="<?php echo $dj['CD_Name'];?>" /> 
  <meta name="description" content="<?php echo $dj['CD_Name'];?>" /> 
  <link rel="stylesheet" href="css/style.css" type="text/css" />
  <link rel="stylesheet" href="css/play.css" type="text/css" />
  <script type="text/javascript" src="js/jquery.js"></script>
 </head> 
 <body> 
<?php include "nav.php";?>
  <div class="x5_wap"> 
   <header class="x5_heads"> 
    <a href="singer/index.php?id=<?php echo GetAlias("cctvai_user", "cd_id", "cd_name", $dj['CD_User'])?>">
	<img src="<?php echo linkuserphoto(GetAlias("cctvai_user", "cd_id", "cd_name", $dj['CD_User']), 48)?>" class="head-bg-blur" /> 
    <div class="pabg"></div> 
    <img src="<?php echo linkuserphoto(GetAlias("cctvai_user", "cd_id", "cd_name", $dj['CD_User']), 48)?>" class="head-avatar" /> 
    <p class="head-name box ellipsis txt-shadow"><?php echo GetAlias("cctvai_user", "cd_nicheng", "cd_name", $dj['CD_User'])?>&nbsp;个人空间&nbsp;<span style="font-size: 12px;"></span></p> 
    <div class="head-sign box ellipsis txt-shadow"> 
     <p class="ellipsis"><?php echo GetAlias("cctvai_user", "cd_sex", "cd_name", $dj['CD_User'])?>&nbsp;&nbsp;分享：<?php echo GetAlias("cctvai_user", "cd_djmub", "cd_name", $dj['CD_User'])?>个作品&nbsp;&nbsp;粉丝：<?php echo GetAlias("cctvai_user", "cd_ufans", "cd_name", $dj['CD_User'])?></p> 
    </div> </a>
   </header> 
<div class="x5_weizhi"><a href="play.php" title="音乐">音乐</a> &gt; <a href="play_list.php?id=<?php echo $dj["CD_ClassID"]?>"><?php echo GetAlias("cctvai_class", "CD_Name", "CD_ID", $dj['CD_ClassID'])?></a> &gt; 在线播放</div>
<div class="play-info">
    <div class="title"><h1><?php echo $dj["CD_Name"]?></h1></div> 
	<div class="down">
		<div class="audiojs" id="audiojs_wrapper">
			<audio src="<?php echo $playurl?>" loop="loop" id="myPlayer"></audio>
			<div class="play-pause">
				<p class="play"></p>
				<p class="pause"></p>
				<p class="loading"></p>
				<p class="error"></p>
			</div>
			<div class="scrubber">
				<div class="progress"></div>
				<div class="loaded"></div>
			</div>
			<div class="time">
				<em class="played">00:00</em>/<strong class="duration">00:00</strong>
			</div>
			<div class="error-message"></div>
		</div>
	<a href="play_down.php?id=<?php echo $dj['CD_ID']?>" target="_blank" class="d"><span>下载<?php echo $form?>文件</span></a>
	<em class="t" onclick="up_down(<?php echo $dj['CD_ID']?>, 'good', 'dj')"><span>推荐</span>(<span id="uhits"><?php echo $dj['CD_uHits']?></span>)</em>
	</div> 
    <div class="cDGray"> 
       <ul> 
        <li>文件格式：<span><?php echo $form?></span></li> 
        <li>文件大小：<span><?php echo $dj['CD_Siz']?></span></li>  
        <li>播放时长：<span><?php echo $dj['CD_Playtime']?></span></li> 
        <li>所属歌手：<span><a href="artist_p.php?id=<?php echo $dj['CD_Singer']?>" target="_blank"><?php echo GetAlias('cctvai_singer', 'CD_Name', 'CD_ID', $dj['CD_Singer'])?></a></span></li>
        <li>文件码率：<span><?php echo $dj['CD_Bitkbps']?></span></li> 
		<li>所属分类：<span><a href="play_list.php?id=<?php echo $dj['CD_ClassID']?>" target="_blank"><?php echo GetAlias("cctvai_class", "CD_Name", "CD_ID", $dj['CD_ClassID'])?></a></span></li> 
        <li>下载人气：<span><?php echo $dj['CD_DownHits']?></span></li> 
        <li>播放人气：<span><?php echo $dj['CD_Hits']?></span></li> 
        <li onclick="up_fav(<?php echo $dj['CD_ID']?>,'dj')">收藏人数：<span id="favhits"><?php echo $dj['CD_FavHits']?></span>&nbsp;<a>收藏</a></li> 
        <li>更新时间：<span><?php echo date('Y-m-d',strtotime($dj["CD_AddTime"]))?></span></li> 
       </ul>
    </div> 
	<div class="word">音乐介绍：<?php echo str_checkhtml($dj['CD_Word'])?></div>
</div> 
<!-- Baidu Button BEGIN -->
<div style="padding: 10px;">
<div id="share_label" style="border-bottom: none"><span>分享到 : </span></div>
  <div class="bdsharebuttonbox">
   <a href="#" class="bds_more" data-cmd="more"></a>
   <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
   <a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a>
   <a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
   <a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
   <a class="bds_count" data-cmd="count"> </a>
  </div> 
  <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"32"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
</div>
<!-- Baidu Button END -->
   <div class="dance-list"> 
   <div class="head"><strong>推荐试听</strong></div> 
    <ul class="musicList"> 
<?php 
$sql="select CD_User,CD_ID,CD_Name from ".tname('dj')." where CD_Deleted=0 and CD_Passed=0 and CD_ClassID='".$dj['CD_ClassID']."' order by UNIX_TIMESTAMP(CD_AddTime) desc LIMIT 0,5";
$result=mysql_query($sql);
while($dj=mysql_fetch_array($result)){
echo '<li><a href="play_p.php?id='.$dj['CD_ID'].'"> <span class="t-i"><img src="'.linkuserphoto(GetAlias("cctvai_user", "cd_id", "cd_name", $dj['CD_User']), 48).'" /></span> <span class="t-t"><strong>'.$dj['CD_Name'].'</strong><em>'.GetAlias("cctvai_user", "cd_nicheng", "cd_name", $dj['CD_User']).'</em></span> <span class="t-z"></span></a> </li>';
} 
?>
    </ul> 
    <div class="head" style="margin-top: 10px;"><strong>评论</strong></div> 
	<div class="comments">留言板代码</div>
   </div>

  </div> 
<script src="js/andy.html5.player.js"></script>
<script type="text/javascript">
if (/i(Phone|P(o|a)d)/.test(navigator.userAgent)) {
	
    }else{
		myControl.mainControl();
	}
var Paudio = document.getElementById("myPlayer"); 
function createXMLHttpRequest() {
	if (window.XMLHttpRequest) { //x5mp3.com
		XMLHttpReq = new XMLHttpRequest();
	} else if (window.ActiveXObject) { //IE 浏览器
		try {
			XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				XMLHttpReq = new ActiveXObject("Micrsost.XMLHTTP");
			} catch (e) {}
		}
	}
}
var cache = new Array();
function getHttpObject() {
	var objType = false;
	try {
		objType = new ActiveXObject('Msxml2.XMLHTTP');
	} catch (e) {
		try {
			objType = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (e) {
			objType = new XMLHttpRequest();
		}
	}
	return objType;
}
function up_down(_id, _do, _type) {
	createXMLHttpRequest();
	XMLHttpReq.open("GET", "ajax.php?action=doHits&type=" + _type + "&id=" + _id + "&dowhat=" + _do, true);
	XMLHttpReq.onreadystatechange = function () {
		if (XMLHttpReq.readyState == 4) {
			if (XMLHttpReq.status == 200) {
				if (XMLHttpReq.responseText == "up_001") {
					document.getElementById('uhits').innerHTML = '<?php echo $zan?>';
					alert("感谢支持！");
				}
				if (XMLHttpReq.responseText == "up_002") {
					alert("干嘛不喜欢我！");
				}
				if (XMLHttpReq.responseText == "up_003") {
					alert("休息会吧，您已经评价过了！");
				}
				if (XMLHttpReq.responseText == "up_004") {
					alert("参数错误！");
				}
			} else
				alert("网络异常，请稍后再试。");
		}
	}
	XMLHttpReq.send(null);
}
//收藏
function up_fav(_id, _type) {
	createXMLHttpRequest();
	XMLHttpReq.open("GET", "ajax.php?action=dofav&type=" + _type + "&id=" + _id, true);
	XMLHttpReq.onreadystatechange = function () {
		if (XMLHttpReq.readyState == 4) {
			if (XMLHttpReq.status == 200) {
				if (XMLHttpReq.responseText == "upfav_001") {
					document.getElementById('favhits').innerHTML = '<?php echo $cang?>';
					alert("收藏成功!");
				}
				if (XMLHttpReq.responseText == "upfav_002") {
					alert("请先登录！");
				}
				if (XMLHttpReq.responseText == "upfav_003") {
					alert("收藏的内容不存在！");
				}
				if (XMLHttpReq.responseText == "upfav_004") {
					alert("已经收藏过了！");
				}
				if (XMLHttpReq.responseText == "upfav_005") {
					alert("参数错误");
				}
				getdoHits(_id, _type);
			} else
				alert("网络异常，请稍后再试。");
		}
	}
	XMLHttpReq.send(null);
}
  </script>
<?php include "bottom.php";?>
 </body>
</html>