Location: PHPKode > projects > Top Music module > Top Music 3.0.7/html/modules/topMusic/admin/ajax/common_ajax.php
<?php
if($_POST['action']!="")
	$_GET['action']=$_POST['action'];
if($_GET['last']=="" || $_GET['last']=="undefined" || $_GET['last']=='false')
	$last=false;
else
	$last=true;
switch($_GET['action']){
	case "loadAlbums":
		$idartist=$_GET['idartist'];
		$albumDAO=new AlbumAdminDAO($db,$prefix);
		if(is_numeric($idartist) || $idartist=="orphan"){
			$albumList=$albumDAO->getSelectList($idartist,!$last);
		}elseif($idartist=="orphan"){
			$albumList=$albumDAO->getSelectList($idartist,!$last);
		}else{
			$albumList[0][0]="";
			$albumList[0][1]="...";
		}
		//die("<script>alert('hola');</script>")
		if(!$last)
			$on_change="loadSelect('song','".$_GET["selectId"]."','".$_GET["childSelectId"]."','".$_GET["childDivId"]."')";
		GenericAdminView::printSelect($_GET["selectId"],$albumList,"",$on_change);
		break;
	case "loadSongs":
		$idalbum=$_GET['idalbum'];
		if(is_numeric($idalbum) || $idalbum=="orphan"){
			$songDAO=new SongAdminDAO($db,$prefix);
			$songList=$songDAO->getSelectList($idalbum,!$last);
		}else
			$songList[0]="...";	
		GenericAdminView::printSelect($_GET["selectId"],$songList,"","");
		break;
	case "loadAlbumsSubmit":
		$idartist=$_GET['idartist'];
		$albumDAO=new AlbumAdminDAO($db,$prefix);
		if(is_numeric($idartist)){
			$albumList=$albumDAO->getSelectList($idartist,false);
		}elseif($idartist=="orphan"){
			$albumList=$albumDAO->getSelectList("orphan",true);
		}else{
			$albumList[0][0]="";
			$albumList[0][1]="...";
		}
		$on_change=$_GET['function']."()";
		GenericAdminView::printSelect($_GET["selectId"],$albumList,"",$on_change);
		break;
}
?>
Return current item: Top Music module