<?php
include('config.php');
 include("headertop.php"); ?>
<!doctype html>
<html><head>
    <!-- flowplayer javascript component -->
    <script src="http://releases.flowplayer.org/js/flowplayer-3.2.13.min.js"></script>
    </head><body>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"
    type="text/javascript" charset="utf-8"></script>
<script src="http://releases.flowplayer.org/js/flowplayer.playlist-3.2.11.min.js"
    type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="playlist.css"/>
<style>
    /* container has a background image */
a.player {
    display:block;
    width:98%;
    height:480px;
    text-align:center;
    color:#fff;
    text-decoration:none;
    cursor:pointer;
    background:#000 url(logo.png) repeat-x 0 0;
    background:-moz-linear-gradient(top,
                                    rgba(55, 102, 152, 0.9),
                                    rgba(6, 6, 6, 0.9));
    -moz-box-shadow:0 0 40px rgba(100, 118, 173, 0.5);
}
a.player:hover {
    background:-moz-linear-gradient(center top,
                                    rgba(73, 122, 173, 0.898),
                                    rgba(6, 6, 6, 0.898));
}
</style>
<?php //splash image
$my=str_replace("%20"," ",$_SERVER["REQUEST_URI"]);
$strcut=strstr($my, '=');
$ok=str_replace("=","",$strcut);
echo '<centeR><script>
// wait for the DOM to load using jQuery
$(function() {
    // set up player normally
    $f("player1", "http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf", {

        // clip properties common to all playlist entries
        clip: {
            baseUrl: '. "'". $site. "songs/'". ',
            subTitle: '. "'". 'a melero video'. "'". ',
        },

        // our playlist
        playlist: ['; 
mysql_connect($dbloc, $dbuser, $dbpass);
//Show all Songs Listed under selected Genre
mysql_select_db('$db');
//List all Playlist videos here
$getplist=$_COOKIE['username'].$ok;
$resultm = mysql_query("SELECT * FROM $getplist");

   $dept = array();
    while($row=mysql_fetch_array($resultm))
    {
      //echo $row['allgenreid'];
$myid=$row['allgenreid'];

$resultmn = mysql_query("SELECT * FROM allgenres where id=$myid");
   $depts = array();
    while($rowmn=mysql_fetch_array($resultmn))
    {
$url=$rowmn['6'];
$title=$rowmn['3'];
$description=$rowmn['10'];
echo '
      {
                url: '. "'". $url. "'". ',
                title:  '. "'". $title. "'". ',
                subTitle:  '. "'". $description. "'". '
            },';

     }

     }

?>
        ],
        // show playlist buttons in controlbar
        plugins: {
            controls: {
                playlist: true
            }
        }
    });
    // here comes the magic plugin. It uses first div.clips element as the
    // root for as playlist entries. loop parameter makes clips play
    // from the beginning to the end.

    $f("player1").playlist("div.clips:first", {loop:true});
});

</script>
<table width=90% align=center border=0 cellpadding=0 cellspacing=0>
<td width=60% align=center><bR>
<table width=100% bgcolor=white>
<td valign=top>
<!-- the player using splash image -->
<a class="player plain" id="player1" style="float:middle">
</a>
<!-- let rest of the page float normally -->
</td></table>
<P><br><P>
<table width=100% bgcolor=white>
<tR><td>
<?php
echo '<table width=99% align=center>';
/////////mySQL Connect////////////////
mysql_connect($dbloc, $dbuser, $dbpass);
mysql_select_db($db);

$result = mysql_query("SELECT * FROM allgenres order by id desc limit 0, 15");
// keeps getting the next rowz until there are no more to get
$cols = 4; # Number of columns to display 
$colCtr = 0; 
while($rowz = mysql_fetch_array( $result )) {
echo '<script>
function openWin'. $rowz['id']. '()
{
window.open("stream.php?='. $rowz['id']. '","_blank");
}
</script>';
$sname = substr($rowz['vname'], 0, 50);
if($rowz['image']==''){
$rowz['image']='nophoto.png';
}
echo '<tR><td width=25% valign=top><a onclick="openWin'. $rowz['id']. '()"><img src="thumbs/'. $rowz['image']. '" width=160 height=90 alt="'. $sname. '" title="'. $sname. '"><P></td><td valign=top><font size=4><br><b>'. $sname. '</a><P></td>'; 
if($rowz['id']=15){ 
end($rowz);
}
$colCtr++; 
}
?>
</td></table>
</table>
</td>
<td width=40% valign=top><b><font color=white size=4>Playlist</b><br>
<div class="clips" style="float:left">
    <!-- single playlist entry as an "template" -->
    <a href="${url}">
        ${title} <span>${subTitle}</span>
    </a>
</div></td>
</td></table>
</body></html>
<?php include("headerbottom.php"); ?>