<?php
require "../e/class/connect.php";
require "../e/class/db_sql.php";
require "../e/member/class/user.php";
$link=db_connect();
$empire=new mysqlquery;
require "class/fun.php";
$ur=user_returnlogin();
$userid=$ur[userid];
$usercheck=checklogin($userid);
$username=$ur[username];
$nickname=getnickname($ur[userid]);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>我的云播放 - 会员中心 -<?=$public_r[sitename]?></title>
<? include_once "temp/header.php"; ?>
<div id="content" class="layout">
  <div class="ui-box ui-qire fn-clear" id="i-box">
<? include_once "temp/left.php"; ?>
    <div class="i-box-cnt" id="i-cnt">
      <div id="i-history">
        <div class="ui-title i-tab-nav-box fn-clear">
          <ul class="i-tab-nav">
            <li class="current">播放记录</li>
          </ul>
          <a class="ui-edit ui-edit-short cleanup fav-cancel" href="javascript:;" data="class/ajax.php?action=delallplaylog">全部清空</a></div>
        <div class="ui-cnt">
          <ul class="user-txt-list his-list fn-clear" id="xlist">
            <li class="loading"><img src="temp/images/loading.gif"/>正在努力为您加载中... </li>
          </ul>
          <!-- // i-intro End -->
          <div class="ui-page fn-clear" id="xpage"></div>
          <!-- // list-page End -->
        </div>
      </div>
      <!-- // ui-box End -->
    </div>
    <!-- // i-cnt End -->
    <script type="text/javascript">
			function pagegoo(url){
					if(navigator.userAgent.indexOf('MSIE 6.0')>0||navigator.userAgent.indexOf('MSIE 9.0')>0){
				url=url+"&t="+Math.random();
		           }
				//$("#xlist").html('<img src="/static/images/loading.gif"/>');
				$.ajax({ url: url,  success: function(data){
					if('' != data.ajaxtxt )
				   {
					$("#xlist").html(data.ajaxtxt);
					$("#xpage").html(data.pages);
					$("#xpage a").click(function (e){
						pagegoo(e.target);
						return false;}
					);
					$(".del").click(function(){
						var parents=$(this).parent('li');
						$(this).ajaxdel({
							onsucc:function(data){
								if(parseInt(data.rcode)==1)
								{
									parents.remove();
								}
							}
						});
					});
				
					// his-list li
					$(".his-list li").hover(function(){
						$(this).find(".ui-del").show();
						$(this).addClass("hover");
					},function(){
						$(this).find(".ui-del").hide();
						$(this).removeClass("hover");
					});	
					
				  }
				  else 
				     {
					   	$("#xlist").html("<li class='kong'>您当前没有播放记录!</span></li>");
					 }
				},dataType:'json'});
				return false;				
			}
			
			pagegoo("class/ajax.php?action=getmyplaylog");
			
			$(".fav-cancel").click(function(event){
				//var parents=$(this).parents('li');
				$.showfloatdiv({
					wantclose:2,
					succdo:function(r){
						//parents.remove();
						if(parseInt(r.rcode)==1)
						{
						$("#xlist").html('<li class="kong">暂无历史记录</li>');
						$("#xpage").html('');
						}
					},txt:'确认删除?'
				});
			});
		</script>
  </div>
  <!-- // maxBox End -->
</div>
<? include_once "temp/footer.php"; ?>
</body>
</html>