403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.48
Web Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12
System : Windows NT DESKTOP-3H4FHQJ 10.0 build 19045 (Windows 10) AMD64
User : win 10 ( 0)
PHP Version : 8.2.12
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  D:/xampp/htdocs-coblaa/coblaa/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : D:/xampp/htdocs-coblaa/coblaa/autopage.php
<?php 
//$message_text = mysqli_real_escape_string($con,$message_text);
//include('db_b.php'); 
include('db.php');
session_start();
$status = $_GET['status'];
//////////////////////////////////////////////////////////
$curr_day = date("d");
$curr_month = date("m");
$curr_year = date("Y");
///////////////////////////////////////////////////////////////  
?>
<span style="display:none;">

<span style="display:none;" ><?php $coBlaaacc="KVT2101990"; $g_reward = 50; $cb_exchange_px=0.0112; $ad_view_rewd=1000; ?></span>
<span id="cb_ugx_px" style="display:none;" ><?php echo $cb_exchange_px; ?></span>
<?php
$user_ip = getenv('REMOTE_ADDR');
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$user_ip"));
$city = $geo["geoplugin_city"];
$region = $geo["geoplugin_regionName"];
$country = $geo["geoplugin_countryName"];
/*echo"$user_ip";
echo "City: ".$city."<br>";
echo "Region: ".$region."<br>";
echo "Country: ".$country."<br>";
/*
geoplugin_request
geoplugin_status
geoplugin_credit
geoplugin_city
geoplugin_region
geoplugin_areaCode
geoplugin_dmaCode
geoplugin_countryCode
geoplugin_countryName
geoplugin_continentCode
geoplugin_latitude
geoplugin_longitude
geoplugin_regionCode
geoplugin_regionName
geoplugin_currencyCode
geoplugin_currencySymbol
geoplugin_currencySymbol_UTF8
geoplugin_currencyConverter
*/

if(isset($_SESSION['my_id']))
{
$user_id = $_SESSION['my_id'];		

}else{ $user_id = $user_ip; }

?> 
</span>
<?php

/////////////index/////////////////////////////////////////////////////// 

if($status =="disp_pro_usr")
{
	
 $con = mysqli_connect('localhost','root','2019khalaf','cranebule_userdb');
 if(! $con){echo"You have not connected to the database.";}
 else{
	  $get_user = "select * from cb_userstb where my_id='$user_id' ";
	
	$run_get_user = mysqli_query($con,$get_user);
	$check_user = mysqli_num_rows($run_get_user);	
    while($row_get_user = mysqli_fetch_array($run_get_user))
	{
		$usrname = $row_get_user['lname'];
		echo $usrname;
	
	}
	
	
}
}

/////////////////////////album/////////////////////////////////////
if($status =="disp_art_album")
{
  $get_art_album ="select * from artist_album";
  $run_get_art_album = mysqli_query($con,$get_art_album);
  while($row_get_art_album = mysqli_fetch_array($run_get_art_album))
  {
	$albumid = $row_get_art_album['id'];
	$alb_name = $row_get_art_album['album_name'];
    $album_img = $row_get_art_album['album_img'];

  $get_song ="select * from musictb where album_id='$albumid'";
  $run_get_song = mysqli_query($con,$get_song);
  $check_song = mysqli_num_rows($run_get_song);	
  
  $song_view ="select * from music_viewtb where album_id='$albumid' ";
  $run_get_song_view = mysqli_query($con,$song_view);
  $check_song_view = mysqli_num_rows($run_get_song_view);

?>
<div class="single_song_div" >
<img src="artist_profile/<?php echo $album_img; ?>" class="artist_img"  />
<div class="album_name" ><?php echo $alb_name; ?></div>

<div class="song_count" >

<?php  if($check_song <1){}elseif($check_song <2){echo $check_song; echo" Song";}else{ echo $check_song; echo" Songs"; } ?>
</div>

<div class="song_count" style="float:right;margin-right:2%;text-align:right;color:#0d9a42;" >

<?php if($check_song_view <1){}elseif($check_song_view <2){echo $check_song; echo" view";}else{echo $check_song_view; echo" views"; } ?>

</div>
<a href="album?idalbum=<?php echo $albumid; ?>"><button onClick="show_add_song_div();" class="add_song_btn">Add</button></a>
</div>
<?php	
 //}
}
}
////////index/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 if($status =="disp_top10_list")
{
  $get_song ="select * from musictb where top10='ON' order by rand() limit 30";
  $run_get_song = mysqli_query($con,$get_song);
  while($row_get_song = mysqli_fetch_array($run_get_song))
  {
	$song_id = $row_get_song['id'];
	$album_id = $row_get_song['album_id'];
	$artist_name = $row_get_song['artist_name'];
    $song_title = $row_get_song['song_title'];
    $song_url = $row_get_song['song_url'];
	$cover_img = $row_get_song['cover_img'];	
	
	$get_art_album ="select * from artist_album where id='$album_id' ";
    $run_get_art_album = mysqli_query($con,$get_art_album);
    while($row_get_art_album = mysqli_fetch_array($run_get_art_album))
    {
	//$alb_name = $row_get_art_album['album_name'];
    $album_img = $row_get_art_album['album_img'];
	
	
?>  
 <div class="single_song_div" >
 <?php if($cover_img ==""){ ?> 
<img src="artist_profile/<?php echo $album_img; ?>" class="artist_img"  />
 <?php }else{ ?>
 <img src="song_cover/<?php echo $cover_img; ?>" class="artist_img"  />
 <?php } ?>
<div class="song_title" ><?php echo $song_title; ?></div>
<a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>"><img src="main_icon/play_btn.png" class="download_img_btn"  /></a>
<div class="artist_name" ><?php echo $artist_name; ?></div>

</div>  
<?php	   
	}   
}
}

//////////////////////////////index/////////////////////////////////////////////////////////////////////////////////////////////////   
   
 if($status =="disp_music_list")
{
  $loade_count = $_GET['load_count'];	
  $get_song ="select * from musictb order by rand() limit $loade_count";
  $run_get_song = mysqli_query($con,$get_song);
  while($row_get_song = mysqli_fetch_array($run_get_song))
  {
	$song_id = $row_get_song['id'];
	$album_id = $row_get_song['album_id'];
	$artist_name = $row_get_song['artist_name'];
    $song_title = $row_get_song['song_title'];
    $song_url = $row_get_song['song_url'];	
	$cover_img = $row_get_song['cover_img'];
	
	$get_art_album ="select * from artist_album where id='$album_id' ";
    $run_get_art_album = mysqli_query($con,$get_art_album);
    while($row_get_art_album = mysqli_fetch_array($run_get_art_album))
    {
	//$alb_name = $row_get_art_album['album_name'];
    $album_img = $row_get_art_album['album_img'];
	
	
?> 

 <div class="single_song_div" >
 
 <?php if($cover_img ==""){ ?> 
<img src="artist_profile/<?php echo $album_img; ?>" class="artist_img"  />
 <?php }else{ ?>
 <img src="song_cover/<?php echo $cover_img; ?>" class="artist_img"  />
 <?php } ?>
<h3 class="song_title" ><?php echo $song_title; ?></h3>
<a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>"><img src="main_icon/play_btn.png" class="download_img_btn"  /></a>
<h3 class="artist_name" ><?php echo $artist_name; ?></h3>

</div>  
<?php	   
	}   
}
}

///////////////////detail////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="save_song_view")
{
  $cur_idsong = $_GET['cur_idsong'];
  $cur_idalbum = $_GET['cur_idalbum'];  
  $chk_song_view ="select * from music_viewtb where song_id='$cur_idsong' AND user_ref_no='$user_id' ";
  $run_chk_song_view = mysqli_query($con,$chk_song_view);
  $check_chk_song_view = mysqli_num_rows($run_chk_song_view);
  if($check_chk_song_view >0){}else{
	  
$insert_song_view ="insert into music_viewtb (user_ref_no,song_id,album_id,userip,cur_country,cur_city,cur_date,cur_time ) 
values('$user_id','$cur_idsong','$cur_idalbum','$user_ip','$country','$city',CURDATE(),CURTIME() ) ";
$run_insert_song_view = mysqli_query($con,$insert_song_view);

}	
}

/////////////////below//detail////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="save_song_like")
{
  $cur_idsong = $_GET['cur_idsong'];	
  $chk_song_view ="select * from song_liketb where song_id='$cur_idsong' AND user_ref_no='$user_id' ";
  $run_chk_song_view = mysqli_query($con,$chk_song_view);
  $check_chk_song_view = mysqli_num_rows($run_chk_song_view);
  if($check_chk_song_view >0){}else{

$insert_song_like ="insert into song_liketb (user_ref_no,song_id,userip,cur_country,cur_city,cur_date,cur_time ) 
values('$user_id','$cur_idsong','$user_ip','$country','$city',CURDATE(),CURTIME() ) ";
$run_insert_song_view = mysqli_query($con,$insert_song_like);
  
}	
}

/////////////////below//detail////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="save_song_download")
{
  $cur_idsong = $_GET['cur_idsong'];	
  /*$chk_song_download ="select * from song_downloadstb where song_id='$cur_idsong' AND user_ref_no='$user_id' ";
  $run_chk_song_download = mysqli_query($con,$chk_song_download);
  $check_chk_song_download = mysqli_num_rows($run_chk_song_download);
  if($check_chk_song_download >0){}else{*/
	  
$insert_song_download ="insert into song_downloadstb (user_ref_no,song_id,userip,cur_country,cur_city,cur_date,cur_time ) 
values('$user_id','$cur_idsong','$user_ip','$country','$city',CURDATE(),CURTIME() ) ";
$run_insert_song_download = mysqli_query($con,$insert_song_download);
  
//}	
}


/////////////////below//detail////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_song_view")
{
  $cur_idsong = $_GET['cur_idsong'];	
  $song_view ="select * from music_viewtb where song_id='$cur_idsong' ";
  $run_get_song = mysqli_query($con,$song_view);
  $check_song_view = mysqli_num_rows($run_get_song);
  if($check_song_view <1){}else{
	echo $check_song_view;  
	  
  } 
}	

///////////////below//detail//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_song_like")
{
  $cur_idsong = $_GET['cur_idsong'];	
  $song_like ="select * from song_liketb where song_id='$cur_idsong' ";
  $run_like = mysqli_query($con,$song_like);
  $check_song_like = mysqli_num_rows($run_like);
  if($check_song_like <1){}else{
	echo $check_song_like;  
	  
  }

  $song_like ="select * from song_liketb where song_id='$cur_idsong' AND user_ref_no='$user_id' ";
  $run_like = mysqli_query($con,$song_like);
  $check_song_like = mysqli_num_rows($run_like);
  if($check_song_like >0 ){ ?> <input id="incoming_like" value="1" style="display:none;" />  <?php }else{ ?> <input id="incoming_like" value="0" style="display:none;" />  <?php } 
  
}

///////////////below//detail//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_song_download")
{
  $cur_idsong = $_GET['cur_idsong'];	
  $song_download ="select * from song_downloadstb where song_id='$cur_idsong' ";
  $run_download  = mysqli_query($con,$song_download);
  $check_song_download  = mysqli_num_rows($run_download );
  if($check_song_download <1){}else{
	echo $check_song_download;  
	  
  } 
}

/////////////index/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="search_music")
{
  $incoming_search = $_GET['incoming_search'];
  $get_song ="select * from musictb where artist_name LIKE '%$incoming_search%' OR song_title LIKE '%$incoming_search%' ";
  $run_get_song = mysqli_query($con,$get_song);
  while($row_get_song = mysqli_fetch_array($run_get_song))
  {
    $song_id = $row_get_song['id'];
	$album_id = $row_get_song['album_id'];
	$artist_name = $row_get_song['artist_name'];
    $song_title = $row_get_song['song_title'];

	?>
	<a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>""><div class="song_title_search" ><?php echo $song_title; echo" - "; echo $artist_name; ?> </div></a>
    <!--div class="art_name_search" ><?php echo" - "; echo $artist_name; ?></div-->
	<?php
	
  }	
}
//////////////////detail////////////////////////////////////////////////////delete_playlist////////////////////////////////////////////////////////////
if($status =="disp_playlist")
{
   $my_id = $_GET['my_id'];
   $get_pln ="select * from playlisttb where user_id='$my_id' ORDER BY id DESC ";
   $run_get_pln = mysqli_query($con,$get_pln);  
   while($row_get_pln = mysqli_fetch_array($run_get_pln))
   {
	   $playlist_id = $row_get_pln['id'];
	   $playlist_name = $row_get_pln['playlist_name'];
	   
	   $get_playlst_song_count = "select * from playlist_songstb where playlist_id='$playlist_id' AND song_id !='' ";
	   $run_get_playlst_song_count = mysqli_query($con,$get_playlst_song_count);
	   $check_playlst_song_count = mysqli_num_rows($run_get_playlst_song_count);
	   
	   ?>
	<span idk="<?php echo $playlist_id; ?>" onClickk="select_playlist(this.id);" class="single_plylst2" >
	<span class="sub_single_playlist" >
    <span id="" class="single_plylst_name" ><?php echo $playlist_name; ?></span>
    <span id="" class="single_plylst_song_count" ><?php echo $check_playlst_song_count; ?></span>
	 </span>
    <!--button id="add_spl<?php echo $playlist_id; ?>" name="<?php echo $playlist_id; ?>" onClick="add_song_playlist(this.name);" class="add_plylst_btn" >Add</button>
    <a href="cb_playlist?playlst_id=<?php echo $playlist_id; ?>"><button class="add_plylst_btn" style='display:block;color:purple;border:1px solid purple;' >Play</button></a-->
   <span class="dot3_icon" ><img src="main_icon/3dot_stand.png" id="<?php echo $playlist_id; ?>" onClick="select_playlist(this.id);" class="dot3_icon"  /></span>
   </span>
   <span id="more_option<?php echo $playlist_id; ?>" onmouseleave="close_option_span();"  class="more_option" >
   <a href="playing?playlst_id=<?php echo $playlist_id; ?>"><button class="option_btn" style='color:green;' >Play</button></a>
   <button id="add_spl<?php echo $playlist_id; ?>" name="<?php echo $playlist_id; ?>" onClick="add_song_playlist(this.name);" class="option_btn" style='color:blue;' >Add</button>
   <button onClick="delete_playlist(this.name);" name="<?php echo $playlist_id; ?>" class="option_btn" style='color:red;' >Delete</button>
   <button onClick="close_option_span();" class="option_btn" style='color:black;' >Close</button>
   </span>
	 <?php
   }
	
}

///////////////////detail/////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="save_new_playlist")
{
$my_id = $_GET['my_id'];
$playlstname = $_GET['playlstname'];

$chk_pln ="select * from playlisttb where user_id='$my_id' AND playlist_name='$playlstname'";
$run_chk_pln = mysqli_query($con,$chk_pln);
$check_pln = mysqli_num_rows($run_chk_pln);
if($check_pln >0){echo $playlstname;echo" Already exists";}else{

$insert_playlist ="insert into playlisttb (user_id,playlist_name,playlist_icon,country,city,userip,cur_date,cur_time ) values('$my_id','$playlstname','icon','$country','$city','$user_ip',CURDATE(),CURTIME() )";
$run_insert_playlist = mysqli_query($con,$insert_playlist);	
	
}
}


////////////detail//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="add_song_playlist")
{
$my_id = $_GET['my_id'];
$playlistid = $_GET['playlistid'];
$cur_idsong = $_GET['cur_idsong'];

$get_playlst_song = "select * from playlist_songstb where playlist_id='$playlistid' AND song_id='$cur_idsong' ";
$run_get_playlst_song = mysqli_query($con,$get_playlst_song);
$check_playlst_song = mysqli_num_rows($run_get_playlst_song);
if($check_playlst_song){echo"Song already exists";}else{
	
$get_position_song = "select * from playlist_positiontb where playlist_id='$playlistid' AND my_id='$my_id' ";
$run_get_position_song = mysqli_query($con,$get_position_song);
$check_run_get_position_song = mysqli_num_rows($run_get_position_song);	
if($check_run_get_position_song >0){
while($row_get_position_song = mysqli_fetch_array($run_get_position_song))
{
	$song_position_id = $row_get_position_song['last_song_position'];
	$new_song_position_id = $song_position_id + 1;
	
	
$check_playlst_song_space = "select * from playlist_songstb where playlist_id='$playlistid' AND user_id='$my_id' AND song_id='' ";
$run_check_playlst_song_space = mysqli_query($con,$check_playlst_song_space);
$check_playlst_space = mysqli_num_rows($run_check_playlst_song_space);	
if($check_playlst_space >0){
	
 $update_song_playlist ="UPDATE playlist_songstb SET song_id = '$cur_idsong' WHERE user_id='$my_id' AND playlist_id='$playlistid' AND song_position='$new_song_position_id'";
 $run_update_song_playlist = mysqli_query($con,$update_song_playlist);
 
 if($run_update_song_playlist){
 $update_new_position ="UPDATE playlist_positiontb SET last_song_position = '$new_song_position_id' WHERE my_id='$my_id' AND playlist_id='$playlistid' ";
 $run_update_new_position = mysqli_query($con,$update_new_position);	
 echo"<span style='color:green;'>New song added fast.</span>";
 }	
	
}else{
	
$insert_song_playlist ="insert into playlist_songstb (user_id,playlist_id,song_id,song_position,userip,cur_country,cur_city,cur_date,cur_time) 
values('$my_id','$playlistid','$cur_idsong','$new_song_position_id','$user_ip','$country','$city',CURDATE(),CURTIME() )";
$run_insert_song_playlist = mysqli_query($con,$insert_song_playlist);
if($run_insert_song_playlist){	
echo"<span style='color:green;'>New song added mide.</span>";

   $update_song_position ="UPDATE playlist_positiontb SET last_song_position = '$new_song_position_id' WHERE playlist_id='$playlistid' AND my_id='$my_id' ";
   $run_update_song_position = mysqli_query($con,$update_song_position);
   
}
}	
}
}else{
	
$new_song_position_id =1;
$insert_song_playlist ="insert into playlist_songstb (user_id,playlist_id,song_id,song_position,userip,cur_country,cur_city,cur_date,cur_time) 
values('$my_id','$playlistid','$cur_idsong','$new_song_position_id','$user_ip','$country','$city',CURDATE(),CURTIME() )";
$run_insert_song_playlist = mysqli_query($con,$insert_song_playlist);
if($run_insert_song_playlist){	
echo"<span style='color:green;'>New song added end.</span>";	
	
	$insert_song_positon ="insert into playlist_positiontb (my_id,playlist_id,last_song_position,cur_date,cur_time)
	values('$my_id','$playlistid','$new_song_position_id',CURDATE(), CURTIME() )";
	$run_insert_song_position = mysqli_query($con,$insert_song_positon);
	
}
}
	




/*
$insert_song_playlist ="insert into playlist_songstb (user_id,playlist_id,song_id,song_position,userip,cur_country,cur_city,cur_date,cur_time) 
values('$my_id','$playlistid','$cur_idsong','$user_ip','$country','$city',CURDATE(),CURTIME() )";
$run_insert_song_playlist = mysqli_query($con,$insert_song_playlist);
if($run_insert_song_playlist){	
echo"<span style='color:green;'>New song added.</span>";

$get_last_position = "select * from playlist_songstb where playlist_id='$playlistid' AND song_id='$cur_idsong' ";
$run_get_last_position = mysqli_query($con,$get_last_position);
while($row_get_last_position = mysqli_fetch_array($run_get_last_position))
{
	$song_position_id = $row_get_last_position['id'];
	
$get_position_song = "select * from playlist_positiontb where playlist_id='$playlistid' AND my_id='$my_id' ";
$run_get_position_song = mysqli_query($con,$get_position_song);
$check_run_get_position_song = mysqli_num_rows($run_get_position_song);
	
	if($check_run_get_position_song >0){
	$update_song_position ="UPDATE playlist_positiontb SET last_song_position = '$song_position_id' WHERE playlist_id='$playlistid' ";
    $run_update_song_position = mysqli_query($con,$update_song_position);
}else{
	
	$insert_song_positon ="insert into playlist_positiontb (my_id,playlist_id,last_song_position,cur_date,cur_time)
	values('$my_id','$playlistid','$song_position_id',CURDATE(), CURTIME() )";
	$run_insert_song_position = mysqli_query($con,$insert_song_positon);
}
}

}*/
}


}

//////////////////////////////playing/////////////////////////////////////////////////////////////////////////////////////////////////   
   
 if($status =="disp_playlist_music")
{
    $my_id = $_GET['my_id'];
    $id_playlist = $_GET['id_playlist'];

    $get_last_song_position ="select * from playlist_positiontb where playlist_id='$id_playlist' ";
    $run_get_last_song_position= mysqli_query($con,$get_last_song_position);
    while($row_get_last_song_position = mysqli_fetch_array($run_get_last_song_position))
    {
	//$alb_name = $row_get_art_album['album_name'];
    $last_song_position = $row_get_last_song_position['last_song_position'];
	$final_song_position = $last_song_position+1; 

	
?> 
 <input id="last_song_position" value="<?php echo $final_song_position; ?>" style='display:none;' />
 
<?php  } 	
  
  	$get_playlist ="select * from playlist_songstb where user_id='$my_id' AND playlist_id='$id_playlist' ";
    $run_get_playlist = mysqli_query($con,$get_playlist);
    while($row_run_get_playlist = mysqli_fetch_array($run_get_playlist))
    {
    $id_song = $row_run_get_playlist['song_id'];
	$song_id_plst = $row_run_get_playlist['id'];
	$song_position = $row_run_get_playlist['song_position'];

  
  $get_song ="select * from musictb where id='$id_song' limit 30";
  $run_get_song = mysqli_query($con,$get_song);
  while($row_get_song = mysqli_fetch_array($run_get_song))
  {
	$song_id = $row_get_song['id'];
	$album_id = $row_get_song['album_id'];
	$artist_name = $row_get_song['artist_name'];
    $song_title = $row_get_song['song_title'];
    $song_url = $row_get_song['song_url'];	
	
	$get_art_album ="select * from artist_album where id='$album_id' ";
    $run_get_art_album = mysqli_query($con,$get_art_album);
    while($row_get_art_album = mysqli_fetch_array($run_get_art_album))
    {
	//$alb_name = $row_get_art_album['album_name']; 
    $album_img = $row_get_art_album['album_img'];
	

	
?> 

 <!--span id="song_position" >audios/<?php echo"$song_url"; ?></span-->
 <div id='single_song_div<?php echo $song_position; ?>' class="single_song_div" >
<img src="artist_profile/<?php echo $album_img; ?>" class="artist_img"  />
<div class="song_title" ><?php echo $song_title; ?></div>
<!--a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>"-->
<img src="main_icon/play_btn.png" id="<?php echo $song_position; ?>" onClick="play_song_list(this.id)" class="download_img_btn"  />
<!--/a-->
<div class="artist_name" ><?php echo $artist_name; echo $song_position; ?></div>
<span id="song_position<?php echo $song_position; ?>" style='display:none;' ><?php echo $song_position; ?> </span>
<input id="song_in_position<?php echo $song_position; ?>" value="<?php echo"$song_url"; ?>" style='display:none;' />
<input id="song_in_position_detail<?php echo $song_position; ?>" value="<?php echo"$song_title - $artist_name"; ?>" style='display:none;' />
</div>  
<?php	   
  }  } 
}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="delete_playlist")
{
    $my_id = $_GET['my_id'];
    $playlist_id = $_GET['playlist_id'];
	
$del_playlist_song = "DELETE FROM playlist_songstb WHERE playlist_id='$playlist_id' AND user_id='$my_id' ";
$run_del_playlist_song = mysqli_query($con,$del_playlist_song);

$del_playlist = "DELETE FROM playlisttb WHERE id='$playlist_id' AND user_id='$my_id' ";
$run_del_playlist = mysqli_query($con,$del_playlist);

$del_position_playlist = "DELETE FROM playlist_positiontb WHERE playlist_id='$playlist_id' AND my_id='$my_id' ";
$run_del_position_playlist= mysqli_query($con,$del_position_playlist);


}
/////////////index//////////////////////////////////////////////////////////////////////////////////////////////////////////////


 if($status =="disp_trending")
{
	?> 
	
<div id="card_div<?php echo $trend_id; ?>" class="card_div" >
<?php
 /* $get_trend_song ="select * from trendtb order by rand() limit 1 ";
  $run_get_trend_song = mysqli_query($con,$get_trend_song);
  while($row_get_trend_song = mysqli_fetch_array($run_get_trend_song))
  {
	$trend_id = $row_get_trend_song['id'];
	$song_trend_id = $row_get_trend_song['song_id'];
	*/
  $get_song ="select * from musictb where trend_song='ON' order by rand() limit 6";
  $run_get_song = mysqli_query($con,$get_song);
  while($row_get_song = mysqli_fetch_array($run_get_song))
  {
	$song_id = $row_get_song['id'];
	$album_id = $row_get_song['album_id'];
	$artist_name = $row_get_song['artist_name'];
    $song_title = $row_get_song['song_title'];
    $song_url = $row_get_song['song_url'];	
	
	$get_art_album ="select * from artist_album where id='$album_id' ";
    $run_get_art_album = mysqli_query($con,$get_art_album);
    while($row_get_art_album = mysqli_fetch_array($run_get_art_album))
    {
	//$alb_name = $row_get_art_album['album_name'];
    $album_img = $row_get_art_album['album_img'];
	
	
	?> 
	
<a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>" class="single_trend_div" >

<!--div class="single_trend_div"-->
<div class="trend_img_div" ><img src="artist_profile/<?php echo $album_img; ?>" class="trend_img"/></div>
<span class="play_icon_span" ><img src="main_icon/play_gn.png" class="play_icon"/></span>
<span class="trend_song_title"><?php echo $song_title;?></span> 
<span class="trend_song_artis"><?php echo $artist_name;?></span> 

<!--/div-->
<!--div style="float:left;width:60%;height:200px;backgroundk:red;">
<span class="trend_song_title" ><?php echo $song_title; ?> </span> 
<span class="trend_song_artist" ><?php echo $artist_name; ?></span> 
<img src="main_icon/play_audio.png" class="trend_play_icon_img"  >
</div-->

</a>
	
	<?php	
}
} ?>
</div><?php

} //}

////////////////////////////////////////////////////////////////playlist_songstb///////////////////////////////////////////////////////////////////////////////////////


 if($status =="remove_song_4m_playlist")
{
    $my_id = $_GET['my_id'];
    $cur_song = $_GET['cur_song'];
	$playlist_id = $_GET['playlist_id'];
	
	
	$get_song ="select * from musictb where song_url='$cur_song'";
    $run_get_song = mysqli_query($con,$get_song);
    while($row_get_song = mysqli_fetch_array($run_get_song))
    {
	$curr_song_id = $row_get_song['id'];
	
	$get_last_song_position ="select * from playlist_positiontb where playlist_id='$playlist_id' ";
    $run_get_last_song_position= mysqli_query($con,$get_last_song_position);
    while($row_get_last_song_position = mysqli_fetch_array($run_get_last_song_position))
    {
	 $last_song_posit = $row_get_last_song_position['last_song_position'];
	 $new_song_position = $last_song_posit-1;
	
	$get_playlist ="select * from playlist_songstb where user_id='$my_id' AND playlist_id='$playlist_id' AND song_position='$last_song_posit' ";
    $run_get_playlist = mysqli_query($con,$get_playlist);
    while($row_run_get_playlist = mysqli_fetch_array($run_get_playlist))
    {
    $id_song = $row_run_get_playlist['song_id'];

	$update_playlist ="UPDATE playlist_songstb SET song_id = '$id_song' WHERE user_id='$my_id' AND playlist_id='$playlist_id' AND song_id='$curr_song_id'";
	$run_update_playlist = mysqli_query($con,$update_playlist);
	if($run_update_playlist){
	
	$update_playlist_position ="UPDATE playlist_songstb SET song_id = '' WHERE user_id='$my_id' AND playlist_id='$playlist_id' AND song_position='$last_song_posit'";
	$run_update_playlist_position = mysqli_query($con,$update_playlist_position);
	if($run_update_playlist_position){
	
	$update_new_position ="UPDATE playlist_positiontb SET last_song_position = '$new_song_position' WHERE my_id='$my_id' AND playlist_id='$playlist_id' ";
	$run_update_new_position = mysqli_query($con,$update_new_position);	
		
		
	}
	
	}
	}
	}
  }

}
//////////////CMpage////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="CM_disp_music_list")
{
	$sele_cat =$_GET['sele_cat'];
  $get_song ="select * from musictb where song_category='$sele_cat' OR trend_song='$sele_cat' OR top10='$sele_cat' OR status_age='$sele_cat' ";
  $run_get_song = mysqli_query($con,$get_song);
  while($row_get_song = mysqli_fetch_array($run_get_song))
  {
	$song_id = $row_get_song['id'];
	$album_id = $row_get_song['album_id'];
	$artist_name = $row_get_song['artist_name'];
    $song_title = $row_get_song['song_title'];
    $song_url = $row_get_song['song_url'];
    $song_category = $row_get_song['song_category'];	
	$trend_song = $row_get_song['trend_song'];	
	$top10 = $row_get_song['top10'];
	$status_age = $row_get_song['status_age'];
	
	
	$get_art_album ="select * from artist_album where id='$album_id' ";
    $run_get_art_album = mysqli_query($con,$get_art_album);
    while($row_get_art_album = mysqli_fetch_array($run_get_art_album))
    {
	//$alb_name = $row_get_art_album['album_name']; local_song
    $album_img = $row_get_art_album['album_img'];
	
	
?>  
 <div class="single_song_div" >
<a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>"><img src="artist_profile/<?php echo $album_img; ?>" class="artist_img"  /></a>
<div class="song_title" ><?php echo $song_title; ?></div>
<!--a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>"><img src="main_icon/play_btn.png" class="download_img_btn"  /></a-->
<div class="artist_name" ><?php echo $artist_name; ?></div>
<span class="song_status">
<select id="sg_cat_option<?php echo $song_id; ?>" >
<option selected disabled ><?php echo $song_category; ?><?php echo $trend_song; ?><?php echo $top10; ?></option>
<option>Local</option>
<option>New<span id="trend_status<?php echo $song_id; ?>"><?php echo $status_age; ?></span></option>
<option>Gospel</option>
<option>islamic</option>
<option>Trend<span id="trend_status<?php echo $song_id; ?>"><?php echo $trend_song; ?></span></option>
<option>Top 10<span id="top10_status<?php echo $song_id; ?>"><?php echo $top10; ?></span></option>
<!--option id="<?php echo $song_id; ?>" onClickk="add_song_trend(this.id);" style="color:blue;" >Trend <span id="trend_status<?php echo $song_id; ?>"><?php echo $trend_song; ?></span></option>
<option id="<?php echo $song_id; ?>" onClickk="add_song_top10(this.id);" style="color:blue;">Top 10 <span id="top10_status<?php echo $song_id; ?>"><?php echo $top10; ?></span></option-->
</select>
<button id="<?php echo $song_id; ?>" onClick="song_category(this.id);">Add</button>
</span>


<span id="trend_status<?php echo $song_id; ?>" style="display:none;" ><?php echo $trend_song; ?></span>
<span id="top10_status<?php echo $song_id; ?>" style="display:none;" ><?php echo $top10; ?></span>
</div>  
<?php	   
	}   
}
}
/////////CMpage//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="cm_search_music")
{
  $incoming_search = $_GET['incoming_search'];
  $get_song ="select * from musictb where artist_name LIKE '%$incoming_search%' OR song_title LIKE '%$incoming_search%' ";
  $run_get_song = mysqli_query($con,$get_song);
  while($row_get_song = mysqli_fetch_array($run_get_song))
  {
	$song_id = $row_get_song['id'];
	$album_id = $row_get_song['album_id'];
	$artist_name = $row_get_song['artist_name'];
    $song_title = $row_get_song['song_title'];
    $song_url = $row_get_song['song_url'];	
    $song_category = $row_get_song['song_category'];		
	$trend_song = $row_get_song['trend_song'];	
	$top10 = $row_get_song['top10'];	
	
	$get_art_album ="select * from artist_album where id='$album_id' ";
    $run_get_art_album = mysqli_query($con,$get_art_album);
    while($row_get_art_album = mysqli_fetch_array($run_get_art_album))
    {
	//$alb_name = $row_get_art_album['album_name'];
    $album_img = $row_get_art_album['album_img'];
	
	
?>  

 <div class="single_song_div" >
<a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>"><img src="artist_profile/<?php echo $album_img; ?>" class="artist_img"  /></a>
<div class="song_title" ><?php echo $song_title; ?></div>
<!--a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>"><img src="main_icon/play_btn.png" class="download_img_btn"  /></a-->
<div class="artist_name" ><?php echo $artist_name; ?></div>
<span class="song_status">
<select id="sg_cat_option<?php echo $song_id; ?>" >
<option selected disabled ><?php echo $song_category; ?><?php echo $trend_song; ?><?php echo $top10; ?></option>
<option>Local</option>
<option>New<span id="trend_status<?php echo $song_id; ?>"><?php echo $trend_song; ?></span></option>
<option>Gospel</option>
<option>islamic</option>
<option>Trend<span id="trend_status<?php echo $song_id; ?>"><?php echo $trend_song; ?></span></option>
<option>Top 10<span id="top10_status<?php echo $song_id; ?>"><?php echo $top10; ?></span></option>
<!--option id="<?php echo $song_id; ?>" onClickk="add_song_trend(this.id);" style="color:blue;" >Trend <span id="trend_status<?php echo $song_id; ?>"><?php echo $trend_song; ?></span></option>
<option id="<?php echo $song_id; ?>" onClickk="add_song_top10(this.id);" style="color:blue;">Top 10 <span id="top10_status<?php echo $song_id; ?>"><?php echo $top10; ?></span></option-->
</select>
<button id="<?php echo $song_id; ?>" onClick="song_category(this.id);">Add</button>
</span>


<span id="trend_status<?php echo $song_id; ?>" style="display:none;" ><?php echo $trend_song; ?></span>
<span id="top10_status<?php echo $song_id; ?>" style="display:none;" ><?php echo $top10; ?></span>
</div>  

<?php	   
	}   
}
}

///////////CMpage///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="add_song_trend")
{
	$my_id = $_GET['my_id'];
	$songid = $_GET['songid'];
	$update_trend_song ="UPDATE musictb SET trend_song = 'ON' WHERE id='$songid' ";
	$run_update_trend_song= mysqli_query($con,$update_trend_song);	
}

////////////CMpage////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="remove_song_trend")
{
	$my_id = $_GET['my_id'];
	$songid = $_GET['songid'];
	$update_trend_song ="UPDATE musictb SET trend_song = '' WHERE id='$songid' ";
	$run_update_trend_song= mysqli_query($con,$update_trend_song);	
}

///////////CMpage/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="add_song_top10")
{
	$my_id = $_GET['my_id'];
	$songid = $_GET['songid'];
	$update_top10_song ="UPDATE musictb SET top10 = 'ON' WHERE id='$songid' ";
	$run_update_top10_song = mysqli_query($con,$update_top10_song);	
}

/////////////CMpage////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="remove_song_top10")
{
	$my_id = $_GET['my_id'];
	$songid = $_GET['songid'];
	$update_top10_song ="UPDATE musictb SET top10 = '' WHERE id='$songid' ";
	$run_update_top10_song = mysqli_query($con,$update_top10_song);	
}
//////CMpage//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="add_local_song")
{
	$my_id = $_GET['my_id'];
	$songid = $_GET['songid'];
	$song_cat = $_GET['song_cat'];
	if($song_cat=='New'){
		
	$update_trend_song ="UPDATE musictb SET status_age = '$song_cat ON' WHERE id='$songid' ";
	$run_update_trend_song= mysqli_query($con,$update_trend_song);
	
	}elseif($song_cat=='NewNew ON'){
	$update_trend_song ="UPDATE musictb SET status_age = '' WHERE id='$songid' ";
	$run_update_trend_song= mysqli_query($con,$update_trend_song);	
	}elseif($song_cat=='Trend'){
		
	$update_trend_song ="UPDATE musictb SET trend_song = 'ON' WHERE id='$songid' ";
	$run_update_trend_song= mysqli_query($con,$update_trend_song);	
	}elseif($song_cat=='TrendON'){
	$update_trend_song ="UPDATE musictb SET trend_song = '' WHERE id='$songid' ";
	$run_update_trend_song= mysqli_query($con,$update_trend_song);
	}elseif($song_cat=='Top 10'){
		
	$update_top10_song ="UPDATE musictb SET top10 = 'ON' WHERE id='$songid' ";
	$run_update_top10_song = mysqli_query($con,$update_top10_song);	
	}elseif($song_cat=='Top 10ON'){
	$update_top10_song ="UPDATE musictb SET top10 = '' WHERE id='$songid' ";
	$run_update_top10_song = mysqli_query($con,$update_top10_song);		
	}else{
	$update_trend_song ="UPDATE musictb SET song_category = '$song_cat' WHERE id='$songid' ";
	$run_update_trend_song= mysqli_query($con,$update_trend_song);	
} }

////////CMpage////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="remove_local_song")
{
	$my_id = $_GET['my_id'];
	$songid = $_GET['songid'];
	$update_top10_song ="UPDATE musictb SET song_category = '' WHERE id='$songid' ";
	$run_update_top10_song = mysqli_query($con,$update_top10_song);	
}


////////studtio/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
   
if($status =="disp_myMusic_list")
{
  $get_song ="select * from musictb where user_ref_no='$user_id' ";
  $run_get_song = mysqli_query($con,$get_song);
  while($row_get_song = mysqli_fetch_array($run_get_song))
  {
	$song_id = $row_get_song['id'];
	$album_id = $row_get_song['album_id'];
	$artist_name = $row_get_song['artist_name'];
    $song_title = $row_get_song['song_title'];
    $song_url = $row_get_song['song_url'];	
	$cover_img = $row_get_song['cover_img'];
	
	$get_art_album ="select * from artist_album where id='$album_id' ";
    $run_get_art_album = mysqli_query($con,$get_art_album);
    while($row_get_art_album = mysqli_fetch_array($run_get_art_album))
    {
	//$alb_name = $row_get_art_album['album_name']; 
    $album_img = $row_get_art_album['album_img'];
	
	
?>  
 <div class="single_song_div" >
 
 <?php if($cover_img ==""){ ?> 
<img src="artist_profile/<?php echo $album_img; ?>" class="artist_img"  />
 <?php }else{ ?>
 <img src="song_cover/<?php echo $cover_img; ?>" class="artist_img"  />
 <?php } ?>
<div class="song_title" ><?php echo $song_title; ?></div>
<button id="<?php echo $song_id; ?>"  class="action_btn" onClick="show_more_option(this.id);"  >...</button>
<div class="artist_name" ><?php echo $artist_name; ?></div>

  <span id="more_option<?php echo $song_id; ?>" onmouseleave="close_option_span();"  class="more_option" >
   <a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>"><button class="option_btn" style='color:green;' >Play</button></a>
   <button  name="<?php echo $song_id; ?>" onClick="edit_song_info(this.name);" class="option_btn" style='color:blue;' >Edit</button>
   <button onClick="delete_song(this.name);" name="<?php echo $song_id; ?>" class="option_btn" style='color:red;' >Delete</button>
   <button onClick="close_option_span();" class="option_btn" style='color:black;' >Close</button>
   </span>

</div>  
<?php	   
	}   
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_upload_song_count")
{
  $my_id = $_GET['my_id'];
  $get_song_count ="select * from musictb where user_ref_no='$my_id' ";
  $run_get_song_count = mysqli_query($con,$get_song_count);
  $check_song_count = mysqli_num_rows($run_get_song_count);
  if($check_song_count >0){echo" Total songs: $check_song_count";}
}

//////studio/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="delete_song")
{
	$my_id = $_GET['my_id'];
	$songid = $_GET['song_id'];
	
	$get_song ="select * from musictb where id='$songid' AND user_ref_no='$my_id' ";
    $run_get_song = mysqli_query($con,$get_song);
    while($row_get_song = mysqli_fetch_array($run_get_song))
    {

    $song_url = $row_get_song['song_url'];	
	$cover_img = $row_get_song['cover_img'];

	 $filename ="audios/$song_url";
	 $song_cover="song_cover/$cover_img";

    if (unlink($filename)){
	unlink($song_cover);
	$del_song ="DELETE FROM musictb WHERE id='$songid' AND user_ref_no='$my_id' ";
	$run_del_song = mysqli_query($con,$del_song);
    if($run_del_song){	
		
   // echo "File deleted successfully.";
     } else {
    echo "Unable to delete the file.";
    }	
}
	}
}

//////studio/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="edit_song_info")
{
	$my_id = $_GET['my_id'];
	$songid = $_GET['song_id'];
	
	$get_song ="select * from musictb where id='$songid' AND user_ref_no='$my_id' ";
    $run_get_song = mysqli_query($con,$get_song);
    while($row_get_song = mysqli_fetch_array($run_get_song))
    {

    //$song_url = $row_get_song['song_url'];	
	//$cover_img = $row_get_song['cover_img'];
	$artist_name = $row_get_song['artist_name'];
    $song_title = $row_get_song['song_title'];	
	
	?>
	
	<span class="song_title_lebal" >Song Title</span>
    <input id="edit_song_title" class="edit_input" value="<?php echo $song_title ?>" />
    <span class="song_title_lebal" >Artist Name</span>
    <input id="edit_artist_name" class="edit_input" value="<?php echo $artist_name ?>" />
    <button name="<?php echo $songid ?>" onClick="song_update_now(this.name);" class="song_update_btn" >Update</button>
	
	<?php


	}
}

//////studio//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="song_update_now")
{
	$my_id = $_GET['my_id'];
	$songid = $_GET['song_id'];
	$edit_song_title = $_GET['edit_song_title'];
	$edit_artist_name = $_GET['edit_artist_name'];
	
	$update_edit_song ="UPDATE musictb SET song_title = '$edit_song_title', artist_name='$edit_artist_name' WHERE id='$songid' AND user_ref_no='$my_id' ";
	$run_update_edit_song = mysqli_query($con,$update_edit_song);	
	
    

}

//////studio////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_pro_usr_studio")
{
	
 $con = mysqli_connect('localhost','root','2019khalaf','cranebule_userdb');
 if(! $con){echo"You have not connected to the database.";}
 else{
	  $get_user = "select * from cb_userstb where my_id='$user_id' ";
	
	$run_get_user = mysqli_query($con,$get_user);
	$check_user = mysqli_num_rows($run_get_user);	
    while($row_get_user = mysqli_fetch_array($run_get_user))
	{
		$usrname = $row_get_user['lname'];
		echo $usrname;
	
	}
	
	
}
}

//////CMpage////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_new_music_list")
{ ?> <div class="new_music_list_div" > <?php
  $get_song ="select * from musictb where status_age='New ON' ORDER BY rand() limit 2 ";
  $run_get_song = mysqli_query($con,$get_song);
  while($row_get_song = mysqli_fetch_array($run_get_song))
  {
	$song_id = $row_get_song['id'];
	$album_id = $row_get_song['album_id'];
	$artist_name = $row_get_song['artist_name'];
    $song_title = $row_get_song['song_title'];
    $song_url = $row_get_song['song_url'];	
	$cover_img = $row_get_song['cover_img'];
	
	$get_art_album ="select * from artist_album where id='$album_id' ";
    $run_get_art_album = mysqli_query($con,$get_art_album);
    while($row_get_art_album = mysqli_fetch_array($run_get_art_album))
    {
	//$alb_name = $row_get_art_album['album_name']; 
    $album_img = $row_get_art_album['album_img'];
	
	
?>  
 <div class="sub_new_music_div" >
  <a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>"><span class="new_music_span" >
 <?php if($cover_img ==""){ ?> 

<img src="artist_profile/<?php echo $album_img; ?>" class="new_music_img"  />

 <?php }else{ ?>

 <?php } ?>
 </span>
<div class="new_artist_name" ><?php echo $artist_name; ?></div>
<div class="new_music_name" ><?php echo $song_title; ?></div>
</a>

</div>  




<?php	
	}
  } ?> </div><?php
}

///////filter_page///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_filter_music_list")
{
	
  $song_cat = $_GET['song_cat'];
   $loade_count = $_GET['load_count'];	

  $get_song ="select * from musictb where song_category='$song_cat' order by rand() limit $loade_count";
  $run_get_song = mysqli_query($con,$get_song);
  while($row_get_song = mysqli_fetch_array($run_get_song))
  {
	$song_id = $row_get_song['id'];
	$album_id = $row_get_song['album_id'];
	$artist_name = $row_get_song['artist_name'];
    $song_title = $row_get_song['song_title'];
    $song_url = $row_get_song['song_url'];	
	$cover_img = $row_get_song['cover_img'];
	
	$get_art_album ="select * from artist_album where id='$album_id' ";
    $run_get_art_album = mysqli_query($con,$get_art_album);
    while($row_get_art_album = mysqli_fetch_array($run_get_art_album))
    {
	//$alb_name = $row_get_art_album['album_name'];
    $album_img = $row_get_art_album['album_img'];
	
	
?>  
 <div class="single_song_div" >
 
 <?php if($cover_img ==""){ ?> 
<img src="artist_profile/<?php echo $album_img; ?>" class="artist_img"  />
 <?php }else{ ?>
 <img src="song_cover/<?php echo $cover_img; ?>" class="artist_img"  />
 <?php } ?>
<div class="song_title" ><?php echo $song_title; ?></div>
<a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>"><img src="main_icon/play_btn.png" class="download_img_btn"  /></a>
<div class="artist_name" ><?php echo $artist_name; ?></div>

</div>  
<?php	   
	}   
}
}

/////////////filter_page/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="search_music_filter")
{
  $incoming_search = $_GET['incoming_search'];
  $song_cat = $_GET['song_cat'];
  
  $get_song ="select * from musictb where song_category='$song_cat' AND artist_name LIKE '%$incoming_search%' OR song_title LIKE '%$incoming_search%' ";
  $run_get_song = mysqli_query($con,$get_song);
  while($row_get_song = mysqli_fetch_array($run_get_song))
  {
    $song_id = $row_get_song['id'];
	$album_id = $row_get_song['album_id'];
	$artist_name = $row_get_song['artist_name'];
    $song_title = $row_get_song['song_title'];

	?>
	<a href="detail?idsong=<?php echo $song_id; ?>&idlbum=<?php echo $album_id; ?>""><div class="song_title_search" ><?php echo $song_title; echo" - "; echo $artist_name; ?> </div></a>
    <!--div class="art_name_search" ><?php echo" - "; echo $artist_name; ?></div-->
	<?php
	
  }	
}

////earn//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_cur_amt")
{
  $my_id = $_GET['my_id'];
  
  $get_cur_user_amt ="select * from gamebanktb where user_id='$my_id' ";
  $run_get_cur_user_amt = mysqli_query($con,$get_cur_user_amt);
  while($row_get_cur_user_amt = mysqli_fetch_array($run_get_cur_user_amt))
  {
   $user_acc_amount = $row_get_cur_user_amt['acc_amount'];
   echo $user_acc_amount;
  } 
}

//////earn/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_game")
{
  //$incoming_search = $_GET['incoming_search'];
  $get_game ="select * from gametb order by rand() limit 1";
  $run_get_game = mysqli_query($con,$get_game);
  while($row_get_game = mysqli_fetch_array($run_get_game))
  {
	$cur_g_id = $row_get_game['id'];
	$g_icon1 = $row_get_game['g_icon1'];
	$g_icon2 = $row_get_game['g_icon2'];
	$g_icon3 = $row_get_game['g_icon3'];
	$g_icon4 = $row_get_game['g_icon4'];
	$g_icon_correct = $row_get_game['g_corredt_icon'];
	
	?>
	
<div class="game_div" >

<input id="cur_game_id" class="help_game_valve" value="<?php echo $cur_g_id ?>" />
<input id="cur_reward" class="help_game_valve" value="" />
<span  class="sub_game_top" >
<span id="corrent_g_icon" class="sub_game_top_span" ><img src="main_icon/<?php echo $g_icon_correct ?>" class="game_icon_img_top"  ></span>
<span id="game_icon_img_top" class="help_game_valve" ><?php echo $g_icon_correct ?></span>
</span>

<span class="game_tip" >Select the icon that matches the one above</span>

<span id="sub_game_bottom" class="sub_game_bottom" >

<span onClick="compare_valvegame(this.id);" id="<?php echo $g_icon1 ?>" class="sub_game_bottom_span" >
<img src="main_icon/<?php echo $g_icon1 ?>" class="game_icon_img_bottom"  >
<span id="game_icon_img_bottom_value1" class="help_game_valve" >441</span>
</span>
<span onClick="compare_valvegame(this.id);" id="<?php echo $g_icon2 ?>" class="sub_game_bottom_span" >
<img src="main_icon/<?php echo $g_icon2 ?>" class="game_icon_img_bottom"  >
<span id="game_icon_img_bottom_value2" class="help_game_valve" >442</span>
</span>
<span onClick="compare_valvegame(this.id);" id="<?php echo $g_icon3 ?>" class="sub_game_bottom_span" >
<img src="main_icon/<?php echo $g_icon3 ?>" class="game_icon_img_bottom"  >
<span idk="game_icon_img_bottom_value3" class="help_game_valve" >443</span>
</span>
<span onClick="compare_valvegame(this.id);" id="<?php echo $g_icon4 ?>" class="sub_game_bottom_span" >
<img src="main_icon/<?php echo $g_icon4 ?>" class="game_icon_img_bottom"  >
<span id="game_icon_img_bottom_value4" class="help_game_valve" >444</span>
</span>

</span>
<button id="try_agin_btn" onClick="disp_game()" class="game_claim_btn" >Try Again</button>
</div>
	
	<?php
	
	
	
  }
}

//earn///////////////////////////////////////////////////game_playchancetb//////////////////////////////////////////////////////////////////////////
if($status =="gameplay_chanes_count")
{
  $my_id = $_GET['my_id'];
  $get_gplay_chance ="select * from game_playchancetb where user_id='$my_id'";
  $run_get_gplay_chance= mysqli_query($con,$get_gplay_chance);
  $check_run_get_gplay_chance = mysqli_num_rows($run_get_gplay_chance);
  if($check_run_get_gplay_chance <1){
	  $insert_user_gp_chance ="insert into game_playchancetb (user_id,chances_count,cur_day,cur_month,cur_year,cur_time)
	  values('$my_id','0','$curr_day','$curr_month','$curr_year',CURTIME())";
	  $run_insert_user_gp_chance = mysqli_query($con,$insert_user_gp_chance);
  }
  while($row_get_gplay_chance = mysqli_fetch_array($run_get_gplay_chance))
  {
   $chances_count = $row_get_gplay_chance['chances_count'];
   $curr_day = $row_get_gplay_chance['cur_day'];
   $curr_month = $row_get_gplay_chance['cur_month'];
   $curr_year = $row_get_gplay_chance['cur_year'];
   $chane_count_date = $curr_day.'-'.$curr_month.'-'.$curr_year
   ?>
  <span id="game_chance_date"><?php echo $chane_count_date; ?></span> 
  <span id="game_chance"><?php echo $chances_count; ?></span> 
   <?php
  }
}
//earn///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="insert_greward_game")
{
  $my_id = $_GET['my_id'];
  $cur_game_chance = $_GET['cur_game_chance'];
  $cur_reward = $_GET['cur_reward'];
  if($cur_reward =='K'){ $final_greward = $g_reward;
  
  $get_coinsply ="select * from cb_coinsuplytb";
  $run_get_get_coinsply= mysqli_query($con,$get_coinsply);
  while($row_get_coinsply = mysqli_fetch_array($run_get_get_coinsply))
  {
   $amt_maincoin = $row_get_coinsply['CB_main_amount'];
   $new_coinamount = $amt_maincoin - $final_greward;
   
   if($amt_maincoin < $g_reward){ ?> <span style="color:red;"><?php echo"Coin still  minting come back later";?></span> <?php }else{
   
  // if($final_greward > $new_coinamount){echo"nyoo";}else{
   
   $update_mainsuply="UPDATE cb_coinsuplytb SET CB_main_amount='$new_coinamount'";
   $run_update_mainsuply = mysqli_query($con,$update_mainsuply);
if($run_update_mainsuply){
  
  $get_game_acc ="select * from gamebanktb where user_id='$my_id'";
  $run_get_game_acc = mysqli_query($con,$get_game_acc);
  while($row_get_game_acc = mysqli_fetch_array($run_get_game_acc))
  {
	$my_acc = $row_get_game_acc['accountNo'];
	$acc_amount = $row_get_game_acc['acc_amount'];
	
	$final_reward_coin = $acc_amount + $final_greward;
	
   $update_gbank ="UPDATE gamebanktb SET acc_amount='$final_reward_coin' where user_id='$my_id' ";
   $run_update_gbank = mysqli_query($con,$update_gbank);
   
   if($run_update_gbank){
	   
   $ugx_amt =$final_greward *$cb_exchange_px;
  
  $insert_g_reward="insert into game_transtb (user_id,fromAccount,toAccont,cb_coin_amt,exchange_price,amount_ugx,cb_action,trans_status,cur_country,cur_city,ipuser,cur_day,cur_month,cur_year,cur_time)
  values('$my_id','$coBlaaacc','$my_acc','$final_greward','$cb_exchange_px','$ugx_amt','Credited','Success','$country','$city','$user_ip','$curr_day','$curr_month','$curr_year',CURTIME() )";
  $run_insert_g_reward = mysqli_query($con,$insert_g_reward);
  if($run_insert_g_reward){
	  
    $update_game_life ="UPDATE game_playchancetb SET chances_count='$cur_game_chance',cur_day='$curr_day',cur_month='$curr_month',cur_year='$curr_year',cur_time=CURTIME() where user_id='$my_id' ";
   $run_update_game_life = mysqli_query($con,$update_game_life);
  ?> <span style="color:green;"><?php echo"Your reward has been added ";?></span> <?php 
  //}
  }
  }
}
}
}
}
}
}

////earn///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_trans_history")
{
  $my_id = $_GET['my_id'];
  
  $get_trans_history ="select * from game_transtb where user_id='$my_id' ORDER BY id DESC ";
  $run_get_trans_history = mysqli_query($con,$get_trans_history);
  while($row_get_trans_history = mysqli_fetch_array($run_get_trans_history))
  {
   $trans_ref = $row_get_trans_history['id'];
   $cb_action = $row_get_trans_history['cb_action'];
   $trans_status = $row_get_trans_history['trans_status'];
   $amt_maincoin = $row_get_trans_history['cb_coin_amt'];
   $cur_day = $row_get_trans_history['cur_day'];
   $cur_month = $row_get_trans_history['cur_month'];
   $cur_year = $row_get_trans_history['cur_year'];
   $cur_time = $row_get_trans_history['cur_time'];
   
   if($trans_status=='Pending'){
  ?>
  
<span class="trans_history_output_span" style="backgroundk:#f990ec;" >
<span class="transaction_output" style="width:15%;background:#f990ec;"><?php echo $trans_ref ?></span>
<span class="transaction_output" style="background:#f990ec;"><?php echo $cb_action ?></span>
<span class="transaction_output" style="background:#f990ec;"><?php echo $amt_maincoin ?>.000</span>
<span class="transaction_output" style="width:15%;color:#930646;background:#f990ec;"><?php echo $trans_status ?></span>
<span class="transaction_output" style="background:#f990ec;">Coblaa earn </span>
<span class="transaction_output" style="width:20%;background:#f990ec;"><?php echo"$cur_day-$cur_month-$cur_year / $cur_time"; ?></span>
</span>
  
  <?php
   }else{   ?>   

<span class="trans_history_output_span" >
<span class="transaction_output" style="width:15%;"><?php echo $trans_ref ?></span>
<span class="transaction_output"><?php echo $cb_action ?></span>
<span class="transaction_output"><?php echo $amt_maincoin ?>.000</span>
<span class="transaction_output" style="width:15%;color:green;"><?php echo $trans_status ?></span>
<span class="transaction_output">Coblaa earn </span>
<span class="transaction_output" style="width:20%;"><?php echo"$cur_day-$cur_month-$cur_year / $cur_time"; ?></span>
</span>
   <?php }
  } 
}

////earn//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_withdraw_cur_amt")
{
  $my_id = $_GET['my_id'];
  
  $get_cur_user_amt ="select * from gamebanktb where user_id='$my_id' ";
  $run_get_cur_user_amt = mysqli_query($con,$get_cur_user_amt);
  while($row_get_cur_user_amt = mysqli_fetch_array($run_get_cur_user_amt))
  {
   $user_acc_amount = $row_get_cur_user_amt['acc_amount'];
 //  echo $user_acc_amount;
   $actual_avb_amt = $user_acc_amount * $cb_exchange_px;
   ?>
   
   <span class="available_bal_icon_span">
  <img src="main_icon/coin.png" class="coin_img"  >
  <span id="cur_avb_coin" class="available_bal_out"> <?php echo $user_acc_amount; ?> </span>
   </span>
  <span class="available_bal_ugx">UGX: <?php echo $actual_avb_amt ?> </span>
   
   <?php
  } 
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="insert_withdraw_amt")
{
	$my_id = $_GET['my_id'];
	$recev_acc = $_GET['recev_acc'];
	$withdrawal_amt_coin = $_GET['withdrawal_amt_coin'];
	$exchange_price = $cb_exchange_px;
	$amount_ugx = $withdrawal_amt_coin * $exchange_price;
	
	  	 $con = mysqli_connect('localhost','root','2019khalaf','cranepaydb');
 if(! $con){echo"You have not connected to the database.";}
 else{
 
   
   
         $check_receiver_bank_info ="select * from banktb where account_no='$recev_acc' ";
	     $run_check_receiver_bank_info = mysqli_query($con,$check_receiver_bank_info);
		 $final_chk= mysqli_num_rows($run_check_receiver_bank_info);
		 if($final_chk < 1){ ?><span style="color:red;" ><?php echo"Receiving  account is not registered";?></span> <?php }else{
	
 
	
	include('db.php'); 
	
  $get_game_acc ="select * from gamebanktb where user_id='$my_id'";
  $run_get_game_acc = mysqli_query($con,$get_game_acc);
  while($row_get_game_acc = mysqli_fetch_array($run_get_game_acc))
  {
	//$my_acc = $row_get_game_acc['accountNo']; 
	$acc_amount = $row_get_game_acc['acc_amount'];
	
	$final_reward_coin = $acc_amount - $withdrawal_amt_coin;
	
   $update_gbank ="UPDATE gamebanktb SET acc_amount='$final_reward_coin' where user_id='$my_id' ";
   $run_update_gbank = mysqli_query($con,$update_gbank);
      if($run_update_gbank){
   
  
  $insert_withdraw="insert into game_transtb (user_id,fromAccount,cb_coin_amt,exchange_price,amount_ugx,cb_action,trans_status,cur_country,cur_city,ipuser,cur_day,cur_month,cur_year,cur_time)
  values('$my_id','$recev_acc','$withdrawal_amt_coin','$exchange_price','$amount_ugx','Withdrawal','Success','$country','$city','$user_ip','$curr_day','$curr_month','$curr_year',CURTIME() )";
  $run_insert_withdraw = mysqli_query($con,$insert_withdraw);
  if($run_insert_withdraw){
	  
	  
	 $con = mysqli_connect('localhost','root','2019khalaf','cranepaydb');
 if(! $con){echo"You have not connected to the database.";}
 else{
 
   
   
         $get_receiver_bank_info ="select * from banktb where account_no='$recev_acc' ";
	     $run_get_receiver_bank_info = mysqli_query($con,$get_receiver_bank_info);
	     while($row_get_receiver_bank_info = mysqli_fetch_array($run_get_receiver_bank_info))
	    {
        $bk_my_id = $row_get_receiver_bank_info['my_id'];
	    $recev_fname = $row_get_receiver_bank_info['fname'];
	    $recev_lname = $row_get_receiver_bank_info['lname'];		
	     $receiver_be4_amt = $row_get_receiver_bank_info['acc_amount'];
		 $receiver_name = $recev_fname.' '.$recev_lname; 
         $received_total_amt = $receiver_be4_amt+$amount_ugx;

		 
			
		$update_receiver_bank_acc = "UPDATE banktb SET acc_amount='$received_total_amt' WHERE account_no='$recev_acc' ";
		$run_update_receiver_bank_acc = mysqli_query($con,$update_receiver_bank_acc);
		if($run_update_receiver_bank_acc){ //echo"<script>window.open('transaction', '_self')</script>"; 

	$insert_send_money ="insert into bank_transtb(my_id,receive_account,receive_name,amount,transaction_type,charges,description,status,from_account,from_name,user_country,user_city,
	cur_date,cur_month,cur_year,curtime)
	values ('$bk_my_id','$recev_acc','$receiver_name','$amount_ugx','Transfer','0','Transfer','Success','$my_id','Coblaa earn','$country','$city','$curr_day','$curr_month','$curr_year',CURTIME() )";
	$run_insert_send_money = mysqli_query($con,$insert_send_money);
	if($run_insert_send_money){echo"The transaction was successful";}		
	
		}
 }	  
}  	  
} } 
}
}	
}	
}
////earn///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="create_gamebank")
{
	$my_id = $_GET['my_id'];
	//$gbank_acc =rand(1000000000,9999999999);
	$gbank_acc = random_int(10000000, 99999999);
	
	$insert_g_bank="insert into gamebanktb (user_id,accountNo,acc_amount,cur_country,cur_city,ipuser,cur_day,cur_month,cur_year,cur_time) 
	values('$my_id','$gbank_acc','0','$country','$city','$user_ip','$curr_day','$curr_month','$curr_year',CURTIME() )";
	$run_insert_g_bank = mysqli_query($con,$insert_g_bank);

	


	
}

/////inedex///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 if($status =="disp_member")
{
  $get_game_member_count = "select * from gamebanktb ";
  $run_get_game_member_count = mysqli_query($con,$get_game_member_count);
  $check_get_game_member_count = mysqli_num_rows($run_get_game_member_count); 
  $total_member = 31+$check_get_game_member_count;
  echo"Members: $total_member";

}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 
if($status =="disp_ref_code")
{
	 $con = mysqli_connect('localhost','root','2019khalaf','cranebule_userdb');
 if(! $con){echo"You have not connected to the database.";}
 else{
  $my_id = $_GET['my_id'];
  $get_user_code= "select * from cb_main_referraltb where user_ref_no='$my_id' ";
  $run_get_user_code = mysqli_query($con,$get_user_code);
  while($row_get_user_code = mysqli_fetch_array($run_get_user_code))
  {
    $user_ref_code = $row_get_user_code['referral_code'];
    echo"Ref code: $user_ref_code";
}

 }
 }

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="insert_buy_recharge_card")
{
$my_id = $_GET['my_id'];
$topup_number = $_GET['topup_number'];
$recharge_amt = $_GET['recharge_amt'];
$cb_coins = $_GET['cb_coins'];

	 $con = mysqli_connect('localhost','root','2019khalaf','cranepaydb');
 if(! $con){echo"You have not connected to the database.";}
 else{

         $get_receiver_bank_info ="select * from banktb where account_no='$topup_number' ";
	     $run_get_receiver_bank_info = mysqli_query($con,$get_receiver_bank_info);
		 $check_phone_no = mysqli_num_rows($run_get_receiver_bank_info);
	    // while($row_get_receiver_bank_info = mysqli_fetch_array($run_get_receiver_bank_info))
	    if($check_phone_no <1){ ?> <span style="color:red;"><?php echo"Phone number not registered";?> </span><?php }else{
include('db.php'); 
  $get_game_acc ="select * from gamebanktb where user_id='$my_id'";
  $run_get_game_acc = mysqli_query($con,$get_game_acc);
  while($row_get_game_acc = mysqli_fetch_array($run_get_game_acc))
  {
	//$my_acc = $row_get_game_acc['accountNo']; 
	$acc_amount = $row_get_game_acc['acc_amount'];
	
	$final_reward_coin = $acc_amount - $cb_coins;
	
   $update_gbank ="UPDATE gamebanktb SET acc_amount='$final_reward_coin' where user_id='$my_id' ";
   $run_update_gbank = mysqli_query($con,$update_gbank);
      if($run_update_gbank){
  
 
  $insert_withdraw="insert into game_transtb (user_id,toAccont,cb_coin_amt,exchange_price,amount_ugx,cb_action,trans_status,cur_country,cur_city,ipuser,cur_day,cur_month,cur_year,cur_time)
  values('$my_id','$topup_number','$cb_coins','$cb_exchange_px','$recharge_amt','Airtime','Pending','$country','$city','$user_ip','$curr_day','$curr_month','$curr_year',CURTIME() )";
  $run_insert_withdraw = mysqli_query($con,$insert_withdraw);
  if($run_insert_withdraw){ echo"Transaction was successful,confirmation with in 24 hours"; }
	  }	
}
  }
}
}

///earn_control/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_pend_trans")
{
  $my_id = $_GET['my_id'];
  
  $get_trans_history ="select * from game_transtb where user_id='$my_id' ORDER BY id DESC ";
  $run_get_trans_history = mysqli_query($con,$get_trans_history);
  while($row_get_trans_history = mysqli_fetch_array($run_get_trans_history))
  {
   $trans_ref = $row_get_trans_history['id'];
   $cb_action = $row_get_trans_history['cb_action'];
   $trans_status = $row_get_trans_history['trans_status'];
   $amt_maincoin = $row_get_trans_history['cb_coin_amt'];
   $cur_day = $row_get_trans_history['cur_day'];
   $cur_month = $row_get_trans_history['cur_month'];
   $cur_year = $row_get_trans_history['cur_year'];
   $cur_time = $row_get_trans_history['cur_time'];
   
   if($trans_status=='Pending'){
  ?>
  
<span id="<?php echo $trans_ref ?>" ondblClick="show_trans_confirm_div(this.id);" class="trans_history_output_span" style="backgroundk:#f990ec;" >
<span class="transaction_output" style="width:15%;background:#f990ec;"><?php echo $trans_ref ?></span>
<span class="transaction_output" style="background:#f990ec;"><?php echo $cb_action ?></span>
<span class="transaction_output" style="background:#f990ec;"><?php echo $amt_maincoin ?>.000</span>
<span class="transaction_output" style="width:15%;color:#930646;background:#f990ec;"><?php echo $trans_status ?></span>
<span class="transaction_output" style="background:#f990ec;">Coblaa earn </span>
<span class="transaction_output" style="width:20%;background:#f990ec;"><?php echo"$cur_day-$cur_month-$cur_year / $cur_time"; ?></span>
</span>
  
  <?php
   }
  } 
}

///earn_control/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="insert_trans_confirm")
{
  $my_id = $_GET['my_id'];
  $confirm_network_ref = $_GET['confirm_network_ref'];
  $pending_trans_ref_no = $_GET['pending_trans_ref_no'];
  
   $get_trans_pend="select * from game_transtb where id='$pending_trans_ref_no' ";
   $run_get_trans_pend= mysqli_query($con,$get_trans_pend);
   while($row_get_trans_pend= mysqli_fetch_array($run_get_trans_pend))
   {
   $amt_maincoin = $row_get_trans_pend['cb_coin_amt']; 
   
   
   $get_game_acc ="select * from gamebanktb where user_id='$my_id'";
  $run_get_game_acc = mysqli_query($con,$get_game_acc);
  while($row_get_game_acc = mysqli_fetch_array($run_get_game_acc))
  {
	$my_acc = $row_get_game_acc['accountNo']; 


   
   
	   
	   $update_game_transtb = "UPDATE game_transtb SET fromAccount='$my_acc',trans_status='Success',network_ref_no='$confirm_network_ref' where id='$pending_trans_ref_no' ";
	   $run_update_game_transtb = mysqli_query($con,$update_game_transtb);
	   if($run_update_game_transtb){
		   
		   


  $get_coinsply ="select * from cb_coinsuplytb";
  $run_get_get_coinsply= mysqli_query($con,$get_coinsply);
  while($row_get_coinsply = mysqli_fetch_array($run_get_get_coinsply))
  {
   $cur_airtime_amt_coin = $row_get_coinsply['airtime_amount_coin'];
   
   $final_coin_airtime_amt = $cur_airtime_amt_coin + $amt_maincoin;
		   
   $update_airtime_supply="UPDATE cb_coinsuplytb SET airtime_amount_coin='$final_coin_airtime_amt'";
   $run_update_airtime_supply= mysqli_query($con,$update_airtime_supply);

if($run_update_airtime_supply){echo"Transaction was successful";}else{echo"Something went wrong astb";}   
		   
		   
  }   
		   
     
 }else{echo"Something went wrong lst";}
	   
  }
}

}

//index////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_pend_notf")
{
   $my_id = $_GET['my_id'];
   $con = mysqli_connect('localhost','root','2019khalaf','cranebule_userdb');
 if(! $con){echo"You have not connected to the database.";}
 else{
	$get_user_permis = "select * from coblaa_permistb where my_id='$my_id' AND my_id='CB1' ";
	$run_get_user_permis = mysqli_query($con,$get_user_permis);
	$check_get_user_permis = mysqli_num_rows($run_get_user_permis);	

	if($check_get_user_permis >0){
  include('db.php'); 
   $get_trans_pend_count="select * from game_transtb where trans_status='Pending' ";
   $run_get_trans_pend_count= mysqli_query($con,$get_trans_pend_count);
   $check_trans_pend_count = mysqli_num_rows($run_get_trans_pend_count);

   ?>
   <img onClick="show_searchinput();" src="main_icon/comt1.png" class="notf_icon" />
   <a href="earn_control"><span class="notfi_count" ><?php echo $check_trans_pend_count; ?></span></a>
   
   <?php

}
 }
}

//reward///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="insert_ad_view_reward")
{
  $my_id = $_GET['my_id'];
  $cur_reward = $_GET['cur_reward'];
  $cur_hour = $_GET['cur_hour'];
  //$final_greward = $g_reward;
  $new_hour = $cur_hour;
  if($new_hour > 24){
	  $final_new_hour =$new_hour; //$new_hour-24;
  }else{$final_new_hour = $new_hour;}
  
  $get_coinsply ="select * from cb_coinsuplytb";
  $run_get_get_coinsply= mysqli_query($con,$get_coinsply);
  while($row_get_coinsply = mysqli_fetch_array($run_get_get_coinsply))
  {
   $amt_maincoin = $row_get_coinsply['CB_main_amount'];
   $new_coinamount = $amt_maincoin - $cur_reward;
   
   if($amt_maincoin < $cur_reward){ ?> <span style="color:red;"><?php echo"Coin still  minting come back later";?></span> <?php }else{
   
   
   $update_mainsuply="UPDATE cb_coinsuplytb SET CB_main_amount='$new_coinamount'";
   $run_update_mainsuply = mysqli_query($con,$update_mainsuply);
if($run_update_mainsuply){
  
  $get_game_acc ="select * from gamebanktb where user_id='$my_id'";
  $run_get_game_acc = mysqli_query($con,$get_game_acc);
  while($row_get_game_acc = mysqli_fetch_array($run_get_game_acc))
  {
	$my_acc = $row_get_game_acc['accountNo'];
	$acc_amount = $row_get_game_acc['acc_amount'];
	
	$final_reward_coin = $acc_amount + $cur_reward;
	
   $update_gbank ="UPDATE gamebanktb SET acc_amount='$final_reward_coin' where user_id='$my_id' ";
   $run_update_gbank = mysqli_query($con,$update_gbank);
   
   if($run_update_gbank){
	   
   $ugx_amt =$cur_reward *$cb_exchange_px;
  
  $insert_g_reward="insert into game_transtb (user_id,fromAccount,toAccont,cb_coin_amt,exchange_price,amount_ugx,cb_action,trans_status,cur_country,cur_city,ipuser,cur_day,cur_month,cur_year,cur_time)
  values('$my_id','$coBlaaacc','$my_acc','$cur_reward','$cb_exchange_px','$ugx_amt','Credited','Success','$country','$city','$user_ip','$curr_day','$curr_month','$curr_year',CURTIME() )";
  $run_insert_g_reward = mysqli_query($con,$insert_g_reward);
  if($run_insert_g_reward){

$check_user_online="select * from ad_viewtb where my_id ='$my_id' ";
$run_check_user_online = mysqli_query($con,$check_user_online);
$chk_user_online = mysqli_num_rows($run_check_user_online);
if($chk_user_online >0){
   $update_ad_view ="UPDATE ad_viewtb SET cur_hour='$final_new_hour',cur_day='$curr_day',cur_month='$curr_month',cur_year='$curr_year' where my_id='$my_id' ";
   $run_update_ad_view = mysqli_query($con,$update_ad_view);
	
}else{
 $insert_ad_view ="insert into ad_viewtb (my_id,cur_hour,cur_day,cur_month,cur_year) values('$my_id','$final_new_hour','$curr_day','$curr_month','$curr_year')";
$run_insert_ad_view = mysqli_query($con,$insert_ad_view); 
	
}

  }
  }
}
}
}
}
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_ad_view")
{
	$my_id = $_GET['my_id'];
	$cur_hour = $_GET['cur_hour'];
	
  $get_coinsply ="select * from cb_coinsuplytb where CB_main_amount > '$ad_view_rewd'";
  $run_get_get_coinsply= mysqli_query($con,$get_coinsply);
  $check_get_coinsply = mysqli_num_rows($run_get_get_coinsply);  
	if($check_get_coinsply >0 ){
	
$get_dis_ad_view = "select * from ad_viewtb where my_id ='$my_id' ";
$run_get_dis_ad_view = mysqli_query($con,$get_dis_ad_view);
$chk_get_dis_ad_view = mysqli_num_rows($run_get_dis_ad_view);
if($chk_get_dis_ad_view >0){
while($row_get_dis_ad_view = mysqli_fetch_array($run_get_dis_ad_view))
{
	$last_ad_view_hour = $row_get_dis_ad_view['cur_hour'];
	$last_ad_view_day = $row_get_dis_ad_view['cur_day'];
	$last_ad_view_month = $row_get_dis_ad_view['cur_month'];
	$last_ad_view_year = $row_get_dis_ad_view['cur_year'];
	//$last_ad_view_month == $curr_month && $last_ad_view_year == $curr_year && $last_ad_view_day == $curr_day && $cur_hour < $last_ad_view_hour 
	if($curr_day > $last_ad_view_day )
	{ ?>
		
<a href="reward"><span class="view_ad_span">
<span id="view_ad_lebal1" class="view_ad_lebal1">Watch Ad</span>
<span class="view_ad_lebal2">View ad to earn 1000 coins</span>
</span></a>
		
	<?php }
}
}else{ ?>

<a href="reward"><span class="view_ad_span">
<span id="view_ad_lebal1" class="view_ad_lebal1">Watch Ad</span>
<span class="view_ad_lebal2">View ad to earn 1000 coins</span>
</span></a>
	<?php
	}
}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='disp_cob_ad')
{
	$get_cob_ad ="select * from cob_adtb";
	$run_get_cob_ad = mysqli_query($con,$get_cob_ad);
	while($row_get_cob_ad = mysqli_fetch_array($run_get_cob_ad))
	{
	$cob_ad_url = $row_get_cob_ad['ad_img_url'];
	$ad_img_url2 = $row_get_cob_ad['ad_img_url2'];
	$ad_img_url3 = $row_get_cob_ad['ad_img_url3'];
	$ad_img_url4 = $row_get_cob_ad['ad_img_url4'];
	
	$start_day = $row_get_cob_ad['start_day'];	
	$start_month = $row_get_cob_ad['start_month'];	
	$start_year = $row_get_cob_ad['start_year'];	
	$end_day = $row_get_cob_ad['end_day'];	
	$end_month = $row_get_cob_ad['end_month'];	
	$end_year = $row_get_cob_ad['end_year'];

?>

<div  class="single_cob_ad" >
<div class="cob_ad_out_put_tip" >
<button onClick="show_cob_ad_input_div(2)" >Add</button>
<!--button idk="" >Edit</button-->
<button id="ad_img_url" onClick="remove_cob_ad(this.id);" >Remove</button>
</div>
<span class="cob_ad_img_span" ><img src="coblaa_ad/<?php echo $cob_ad_url  ?>" class="cob_ad_img_url" /></span>
<div class="cob_ad_out_put_tip" >
<span class="start_date_output" ><?php echo"$start_day-$start_month-$start_year To "; ?></span>
<span class="start_date_output" ><?php echo"$end_day-$end_month-$end_year";  ?></span>
</div>
</div>


<div  class="single_cob_ad" >
<div class="cob_ad_out_put_tip" >
<button onClick="show_cob_ad_input_div(3)" >Add</button>
<!--button idk="" >Edit</button-->
<button id="ad_img_url2" onClick="remove_cob_ad(this.id);" >Remove</button>
</div>
<span class="cob_ad_img_span" ><img src="coblaa_ad/<?php echo $ad_img_url2  ?>" class="cob_ad_img_url" /></span>
<div class="cob_ad_out_put_tip" >
<span class="start_date_output" ><?php echo"$start_day-$start_month-$start_year To "; ?></span>
<span class="start_date_output" ><?php echo"$end_day-$end_month-$end_year";  ?></span>
</div>
</div>

<div  class="single_cob_ad" >
<div class="cob_ad_out_put_tip" >
<button onClick="show_cob_ad_input_div(4)" >Add</button>
<!--button idk="" >Edit</button-->
<button id="ad_img_url3" onClick="remove_cob_ad(this.id);" >Remove</button>
</div>
<span class="cob_ad_img_span" ><img src="coblaa_ad/<?php echo $ad_img_url3  ?>" class="cob_ad_img_url" /></span>
<div class="cob_ad_out_put_tip" >
<span class="start_date_output" ><?php echo"$start_day-$start_month-$start_year To "; ?></span>
<span class="start_date_output" ><?php echo"$end_day-$end_month-$end_year";  ?></span>
</div>
</div>

<div  class="single_cob_ad" >
<div class="cob_ad_out_put_tip" >
<button onClick="show_cob_ad_input_div(5)" >Add</button>
<!--button idk="" >Edit</button-->
<button id="ad_img_url4" onClick="remove_cob_ad(this.id);" >Remove</button>
</div>
<span class="cob_ad_img_span" ><img src="coblaa_ad/<?php echo $ad_img_url4  ?>" class="cob_ad_img_url" /></span>
<div class="cob_ad_out_put_tip" >
<span class="start_date_output" ><?php echo"$start_day-$start_month-$start_year To "; ?></span>
<span class="start_date_output" ><?php echo"$end_day-$end_month-$end_year";  ?></span>
</div>
</div>

<?php	
	}
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =='disp_cob_ad_live')
{
	$get_cob_ad ="select * from cob_adtb ";
	$run_get_cob_ad = mysqli_query($con,$get_cob_ad);
	while($row_get_cob_ad = mysqli_fetch_array($run_get_cob_ad))
	{
	$cob_ad_url = $row_get_cob_ad['ad_img_url'];
	$ad_img_url2 = $row_get_cob_ad['ad_img_url2'];
	$ad_img_url3 = $row_get_cob_ad['ad_img_url3'];
	$ad_img_url4 = $row_get_cob_ad['ad_img_url4'];
	$start_day = $row_get_cob_ad['start_day'];	
	$start_month = $row_get_cob_ad['start_month'];	
	$start_year = $row_get_cob_ad['start_year'];	
	$end_day = $row_get_cob_ad['end_day'];	
	$end_month = $row_get_cob_ad['end_month'];	


?>

<?php if($cob_ad_url ==""){ ?>
<input id="cob_ad2" value="" class="helping_input" />
<?php }else{ ?>
<input id="cob_ad2" value="2" class="helping_input" />
<?php } ?>

<?php if($ad_img_url2 ==""){ ?>
<input id="cob_ad3" value="" class="helping_input" />
<?php }else{ ?>
<input id="cob_ad3" value="3" class="helping_input" />
<?php } ?>

<?php if($ad_img_url3 ==""){ ?>
<input id="cob_ad4" value="" class="helping_input" />
<?php }else{ ?>
<input id="cob_ad4" value="4" class="helping_input" />
<?php } ?>

<?php if($ad_img_url4 ==""){ ?>
<input id="cob_ad5" value="" class="helping_input" />
<?php }else{ ?>
<input id="cob_ad5" value="5" class="helping_input" />
<?php } ?>


<div class="bilboard_div">

<img id="img2" src="coblaa_ad/<?php echo $cob_ad_url  ?>" class="bilboard_img" style="displayk:none;max-width: 100%;height:auto;max-height:90%;transition: width 2s;"  >
<img id="img3" src="coblaa_ad/<?php echo $ad_img_url2  ?>" class="bilboard_img" style="display:none;max-width: 100%;height:auto;max-height:90%;transition: width 2s;"  >
<img id="img4" src="coblaa_ad/<?php echo $ad_img_url3  ?>" class="bilboard_img" style="display:none;max-width: 100%;height:auto;max-height:90%;transition: width 2s;"  >
<img id="img5" src="coblaa_ad/<?php echo $ad_img_url4  ?>" class="bilboard_img" style="display:none;max-width: 100%;height:auto;max-height:90%;transition: width 2s;"  >
</div> 

<?php	
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =='remove_cob_ad')
{

    $cur_cob_ad = $_GET['cur_cob_ad'];
	$rev_cob_ad ="select * from cob_adtb ";
	$run_rev_cob_ad = mysqli_query($con,$rev_cob_ad);
	while($row_run_rev_cob_ad = mysqli_fetch_array($run_rev_cob_ad))
	{ 
	
	if($cur_cob_ad =='ad_img_url'){
	$rev_cob_ad_url = $row_run_rev_cob_ad['ad_img_url'];
	$cob_ad_path = "coblaa_ad/$rev_cob_ad_url";	
	if(unlink($cob_ad_path)){	
	$update_cob_ad_rev ="UPDATE cob_adtb SET ad_img_url='' ";
   $run_update_cob_ad_rev= mysqli_query($con,$update_cob_ad_rev);
  
   }	
}
		if($cur_cob_ad =='ad_img_url2'){
	$rev_cob_ad_url = $row_run_rev_cob_ad['ad_img_url2'];
	$cob_ad_path = "coblaa_ad/$rev_cob_ad_url";	
	if(unlink($cob_ad_path)){	
	$update_cob_ad_rev ="UPDATE cob_adtb SET ad_img_url2='' ";
   $run_update_cob_ad_rev= mysqli_query($con,$update_cob_ad_rev);
  
   }	
}

	if($cur_cob_ad =='ad_img_url3'){
	$rev_cob_ad_url = $row_run_rev_cob_ad['ad_img_url3'];
	$cob_ad_path = "coblaa_ad/$rev_cob_ad_url";	
	if(unlink($cob_ad_path)){	
	$update_cob_ad_rev ="UPDATE cob_adtb SET ad_img_url3='' ";
   $run_update_cob_ad_rev= mysqli_query($con,$update_cob_ad_rev);
  
   }	
}	

	if($cur_cob_ad =='ad_img_url4'){
	$rev_cob_ad_url = $row_run_rev_cob_ad['ad_img_url4'];
	$cob_ad_path = "coblaa_ad/$rev_cob_ad_url";	
	if(unlink($cob_ad_path)){	
	$update_cob_ad_rev ="UPDATE cob_adtb SET ad_img_url4='' ";
   $run_update_cob_ad_rev= mysqli_query($con,$update_cob_ad_rev);
  
   }	
}
	
	}

}

/////////////cob_videos/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="search_video")
{
  $incoming_search = $_GET['incoming_search'];
  $get_song ="select * from music_videotb where artist_name LIKE '%$incoming_search%' OR video_name LIKE '%$incoming_search%' ";
  $run_get_song = mysqli_query($con,$get_song);
  while($row_get_song = mysqli_fetch_array($run_get_song))
  {
    $video_id = $row_get_song['id'];
	$vid_album_id = $row_get_song['vid_album_id'];
	$artist_name = $row_get_song['artist_name'];
    $video_name = $row_get_song['video_name'];
	$video_url = $row_get_song['video_url'];
	
	$get_video_view ="select * from music_video_viewtb where video_id='$video_id' ";
    $run_get_video_view = mysqli_query($con,$get_video_view);
    $check_get_video_view = mysqli_num_rows($run_get_video_view);

	?>

<a href="cob_videos?vidid=<?php echo $video_id; ?>&vidname=<?php echo"$video_name - $artist_name"; ?>&vidurl=<?php echo $video_url; ?>&vidview=<?php echo $check_get_video_view; ?>&vidalbid=<?php echo $vid_album_id; ?>" >
<div class="song_title_search" ><?php echo $video_name; echo" - "; echo $artist_name; ?> </div> </a> 

	<?php
	
  }	
}

/////////////cb_videos//////////////////////////////////////////////////////////////////////////////////////////////////////////////

 if($status =="disp_video_list")
{
	?> 
	
<div id="card_div<?php echo $trend_id; ?>" class="card_div" >
<?php


$get_disp_monitor="select * from display_monitortb where cur_day='$curr_day'";
$run_get_disp_monitor = mysqli_query($con,$get_disp_monitor);
$check_dip_monitor = mysqli_num_rows($run_get_disp_monitor);
if($check_dip_monitor <1){
	
	$get_disp_monitor="select * from display_monitortb ";
	$run_get_disp_monitor = mysqli_query($con,$get_disp_monitor);
	while($row_get_disp_monitor = mysqli_fetch_array($run_get_disp_monitor))
{
	$total_songs = $row_get_disp_monitor['total_songs'];
	$pending_display = $row_get_disp_monitor['pending_display'];
	$cur_display_4m = $row_get_disp_monitor['cur_display_4m'];
	$limit_to = $row_get_disp_monitor['limit_to'];
	
	$displayed_already = $cur_display_4m + $limit_to;
	
	$cur_pend_disp = $total_songs - $displayed_already;
	
	if($total_songs < $displayed_already){$new_cur_disp =0;$cur_pend_disp=0;}else{
	
	$new_cur_disp = $displayed_already;
	}
	$update_disp_monitor="update display_monitortb set cur_day='$curr_day',pending_display='$cur_pend_disp',cur_display_4m='$new_cur_disp' ";
	$run_update_disp_monitor = mysqli_query($con,$update_disp_monitor);
echo"<input id='monitor_disp_checker' value='1' style='display:none;' /> ";	
}
}else{
echo"<input id='monitor_disp_checker' value='2' style='display:none;'/> ";
while($row_get_disp_monitor = mysqli_fetch_array($run_get_disp_monitor))
{
	$cur_display_4m = $row_get_disp_monitor['cur_display_4m'];
	$limit_to = $row_get_disp_monitor['limit_to'];

  $get_video ="select * from music_videotb order by id <$cur_display_4m limit $limit_to";
  $run_get_video = mysqli_query($con,$get_video);
  while($row_get_video = mysqli_fetch_array($run_get_video))
  {
	$video_id = $row_get_video['id'];
	$vid_album_id = $row_get_video['vid_album_id'];
	$artist_name = $row_get_video['artist_name'];
    $video_name = $row_get_video['video_name'];
    $video_url = $row_get_video['video_url'];	
    $cover_img = $row_get_video['cover_img'];
	
	$get_video_view ="select * from music_video_viewtb where video_id='$video_id' ";
    $run_get_video_view = mysqli_query($con,$get_video_view);
    $check_get_video_view = mysqli_num_rows($run_get_video_view);
	
	
	?> 
	
<a href="cob_videos?vidid=<?php echo $video_id; ?>&vidname=<?php echo"$video_name - $artist_name"; ?>&vidurl=<?php echo $video_url; ?>&vidview=<?php echo $check_get_video_view; ?>&vidalbid=<?php echo $vid_album_id; ?>" class="single_trend_div" >

<div class="trend_img_div" ><img src="video_cover/<?php echo $cover_img; ?>" alt="<?php echo"$video_name - $artist_name"; ?>" class="trend_img"/></div>
<span class="play_icon_span" ><img src="main_icon/play_ro.png" class="play_icon"/></span>
<span class="trend_song_title"><?php echo $video_name;?></span> 
<span class="trend_song_artis"><?php echo $artist_name;?></span> 

</a>
	
	<?php	

} } } ?>



</div><?php

}


/////////////////////////album/////////////////////////////////////search_music
if($status =="disp_art_album_vid")
{
  $get_art_album ="select * from artist_video_albumtb";
  $run_get_art_album = mysqli_query($con,$get_art_album);
  while($row_get_art_album = mysqli_fetch_array($run_get_art_album))
  {
	$vid_albumid = $row_get_art_album['id'];
	$alb_name = $row_get_art_album['vid_album_name'];
    $album_img = $row_get_art_album['vid_album_img'];

  $get_song ="select * from music_videotb where vid_album_id='$vid_albumid'";
  $run_get_song = mysqli_query($con,$get_song);
  $check_song = mysqli_num_rows($run_get_song);	
  
  $song_view ="select * from music_video_viewtb where vid_album_id='$vid_albumid' ";
  $run_get_song_view = mysqli_query($con,$song_view);
  $check_song_view = mysqli_num_rows($run_get_song_view);

?>
<div class="single_song_div" >
<img src="artist_profile_video/<?php echo $album_img; ?>" class="artist_img"  />
<div class="album_name" ><?php echo $alb_name; ?></div>

<div class="song_count" >

<?php  if($check_song <1){}elseif($check_song <2){echo $check_song; echo" Song";}else{ echo $check_song; echo" Songs"; } ?>
</div>

<div class="song_count" style="float:right;margin-right:2%;text-align:right;color:#0d9a42;" >

<?php if($check_song_view <1){}elseif($check_song_view <2){echo $check_song; echo" view";}else{echo $check_song_view; echo" views"; } ?>

</div>
<a href="album?vidalbid=<?php echo $vid_albumid; ?>"><button onClick="show_add_song_div();" class="add_song_btn">Add</button></a>
</div>
<?php	
 //}
}
}


















?>  



Youez - 2016 - github.com/yon3zu
LinuXploit