<?php 
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
@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');}
class Real extends CI_Controller {

	function __construct(){
		    parent::__construct();
        	$this->load->helper('url');
            $this->load->library('session'); //加载session
		    $this->load->model('CsdjDB');
		    $this->load->model('CsdjSkins');
	        $this->load->model('CsdjUser');
	}

    //主页播放器歌曲
	public function index()
	{
                $lists='';
	            $sql_string = "SELECT CS_ID,CS_FID,CS_Name,CS_UID,CS_User,CS_PlayUrl FROM ".CS_SqlPrefix."dance where cs_yid=0 and cs_reco=5 order by CS_AddTime desc limit 100";
	             $query = $this->db->query($sql_string); 
                 $i=0;

				 
                 foreach ($query->result() as $row) {

                    $list['uid']         = $row->CS_User;
                    $list['ulink']       = $this->CsdjSkins->userlink('index',0,$row->CS_User);
                    $list['face']        = $this->CsdjSkins->getuser('logo',$row->CS_UID,$row->CS_User);
                    $list['nickname']    = $this->CsdjSkins->getuser('nichen',$row->CS_UID,$row->CS_User);
                    $list['id']          = $row->CS_ID;
                    $list['name']        = $row->CS_Name;
                    $list['purl']        = $this->CsdjSkins->playqurl($row->CS_PlayUrl,$row->CS_FID);
                    $list['i']           = $i;
					$lists[]=$list;

                    $i=$i+1;
                 }
                 echo 'var Music='.json_encode($lists);
	}
}

