<?php include('config.php');
include("headertop.php"); ?>
<title>My Videos</title>
<P><table bgcolor=white width=95% width=90% align=center>
<td width=100%><br>
<b>My Videos
</td></table>
<table bgcolor=white width=95% width=90% align=center>
<?php
mysql_connect($dbloc, $dbuser, $dbpass);
mysql_select_db($db); 
if(@$_POST['delete']){
$duser=$_POST['delete'];
//Get Allgenre info
$result = mysql_query("SELECT id, fname, image, category FROM allgenres WHERE id = '$duser'"); 
$rowz = mysql_fetch_row($result); 
$category=$rowz['3'];
mysql_query("DELETE FROM allgenres WHERE id = '$duser'");
mysql_query("DELETE FROM $category WHERE nextid = '$duser'");
unlink("songs/". $rowz['1']);
unlink("thumbs/". $rowz['2']);
}
$result = mysql_query("SELECT * FROM allgenres"); 
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
////////////////
$theuser=$row['user'];
$results = mysql_query("SELECT * FROM allgenres WHERE user = '$theuser'");
while($rows = @mysql_fetch_array($results))
  {
$_SESSION['ptotal']=$rows['ptotal'];
  }
////////////////
$cols = 4; # Number of columns to display 
$colCtr = 0; 
while($row = mysql_fetch_array( $result )) {
echo '<script>
function openWin'. $row['id']. '()
{
window.open("stream.php?='. $row['id']. '","_blank");
}
</script>';
$sname = substr($row['vname'], 0, 50);
if($row['image']==''){
$row['image']='nophoto.png';
}
echo '<td width=25% height=200 valign=top bgcolor=white><a href=stream.php?='. $row['id']. '><img src="thumbs/'. $row['image']. '" width=100% height=150 alt="'. $sname. '" title="'. $sname. '"><font size=2><br><b>'. $sname. '<b></a>
<br><font size=1> '. $row['downloads'].  ' views '. $row['date'].
'<form action="myvideos.php" METHOD="post">
<input type=hidden name=delete value='. $row['id']. '>
<input type=hidden name=nextid value='. $row['nextid']. '>
</select><input type=submit value="Delete"></form>
<form action="myvideosedit.php" METHOD="post">
<input type=hidden name=edit value='. $row['id']. '>
</select><input type=submit value="Edit"></form></td>'; 
if($colCtr %$cols == 3){ 
echo '</table><table width=100% border=0 cellpadding=2 cellspacing=0><tr><td bgcolor=#F5F5F5 width=100% height=1></td></table><table width=95% bgcolor=white align=center><tr>'; 
}else{}
if($row['id']=15){ 
end($row);
}
$colCtr++; 
}
$_SESSION['ptotal']=false;
}
//////////Login End///////////////
?>
</table>
<P><table border=0 cellpadding=0 cellspacing=0 align=center width=85%>
<td></td></table>
<?php include("headerbottom.php"); ?>
