Location: PHPKode > projects > Top Music module > Top Music 3.0.7/html/modules/topMusic/admin/lib/com/sergids/topmusic/view/AlbumAdminView.php
<?php
class AlbumAdminView{
	function printAlbumList($albumList) {
		echo "<script language=\"javascript\" type=\"text/javascript\">\n";
		echo "function delItem(idartist,idalbum){\n";
		echo "	if(confirm('"._TOPMUSIC_SUREALBUM."')){\n";
		echo "		document.delForm.action='admin.php?op=topmusic&action=delAlbum&idartist='+idartist+'&idalbum='+idalbum;\n";
		echo "		document.delForm.submit();\n";
		echo "	}\n";
		echo "}\n";
		echo "</script>\n";
		echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\">\n";
		echo "<form name=\"delForm\" method=\"post\" action=\"\">\n";
		echo "	<tr><td><b>"._TOPMUSIC_TITLE."</b></td><td>&nbsp;</td><td><b>"._TOPMUSIC_YEAR."</b></td><td>&nbsp;</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td></tr>\n";
		for($i=0;$i<count($albumList);$i++){
			$albumO=$albumList[$i];
			echo "	<tr>\n";
			echo "		<td>".$albumO->getTitle()."</td><td>&nbsp;</td>\n";
			echo "		<td>".$albumO->getYeardate()."</td><td>&nbsp;</td>\n";
			echo "		<td><a href=\"admin.php?op=topmusic&action=editAlbum&idartist=".$albumO->getIdartist()."&idalbum=".$albumO->getId()."\"><img src=\"images/edit.gif\" border=\"0\"></a></td>\n";
			echo "		<td>&nbsp</td>";
			echo "		<td><a href=\"javascript:delItem(".$albumO->getIdartist().",".$albumO->getId().")\"><img src=\"images/delete.gif\" border=\"0\"></a></td>\n";
			echo "	</tr>\n";
		}
		echo "</form>\n";
		echo "</table>\n";
	}
	function printOrphanAlbumList($albumList) {
		echo "<script language=\"javascript\" type=\"text/javascript\">\n";
		echo "function delItem(idalbum){\n";
		echo "	if(confirm('"._TOPMUSIC_SUREALBUM."')){\n";
		echo "		document.delForm.action='admin.php?op=topmusic&action=delAlbum&idartist=&idalbum='+idalbum;\n";
		echo "		document.delForm.submit();\n";
		echo "	}\n";
		echo "}\n";
		echo "</script>\n";
		echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\">\n";
		echo "<form name=\"delForm\" method=\"post\" action=\"\">\n";
		echo "	<tr><td><b>"._TOPMUSIC_TITLE."</b></td><td>&nbsp;</td><td><b>"._TOPMUSIC_YEAR."</b></td><td>&nbsp;</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td></tr>\n";
		for($i=0;$i<count($albumList);$i++){
			$albumO=$albumList[$i];
			echo "	<tr>\n";
			echo "		<td>".$albumO->getTitle()."</td><td>&nbsp;</td>\n";
			echo "		<td>".$albumO->getYeardate()."</td><td>&nbsp;</td>\n";
			echo "		<td><a href=\"admin.php?op=topmusic&action=editAlbum&idartist=".$albumO->getIdartist()."&idalbum=".$albumO->getId()."\"><img src=\"images/edit.gif\" border=\"0\"></a></td>\n";
			echo "		<td>&nbsp</td>";
			echo "		<td><a href=\"javascript:delItem(".$albumO->getId().")\"><img src=\"images/delete.gif\" border=\"0\"></a></td>\n";
			echo "	</tr>\n";
		}
		echo "</form>\n";
		echo "</table>\n";
	}
	function printAlbumResult($albumList,$page=1) {
		echo "<script language=\"javascript\" type=\"text/javascript\">\n";
		echo "function changePage(page){\n";
		echo "		document.searchForm.page.value=page;\n";
		echo "		document.searchForm.method='post';\n";
		echo "		document.searchForm.action='admin.php?op=topmusic&action=search';\n";
		echo "		document.searchForm.submit();\n";
		echo "}\n";
		echo "function delItem(idartist,idalbum){\n";
		echo "	if(confirm('"._TOPMUSIC_SUREALBUM."')){\n";
		echo "		document.searchForm.action='admin.php?op=topmusic&action=delAlbum&idartist='+idartist+'&idalbum='+idalbum;\n";
		echo "		document.searchForm.submit();\n";
		echo "	}\n";
		echo "}\n";
		echo "</script>\n";
		echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\">\n";
		echo "	<tr><td><b>"._TOPMUSIC_TITLE."</b></td><td>&nbsp;</td><td><b>"._TOPMUSIC_ARTIST."</b></td><td>&nbsp;</td><td><b>"._TOPMUSIC_YEAR."</b></td><td>&nbsp;</td><td></td></tr>\n";
		for($i=0;$i<count($albumList);$i++){
			$albumO=$albumList[$i];
			echo "	<tr>\n";
			echo "		<td>".$albumO->getTitle()."</td><td>&nbsp;</td>\n";
			echo "		<td>".$albumO->getArtistname()."</td><td>&nbsp;</td>\n";
			echo "		<td>".$albumO->getYeardate()."</td><td>&nbsp;</td>\n";
			echo "		<td><a href=\"admin.php?op=topmusic&action=editAlbum&idartist=".$albumO->getIdartist()."&idalbum=".$albumO->getId()."\"><img src=\"images/edit.gif\" border=\"0\"></a></td>\n";
			echo "		<td>&nbsp;</td>\n";
			echo "		<td><a href=\"javascript:delItem(".$albumO->getIdartist().",".$albumO->getId().")\"><img src=\"images/delete.gif\" border=\"0\"></a></td>\n";
			echo "	</tr>\n";
		}
		echo "</table>\n<br>\n";

		$num=$albumO->getCount();
        if($page>1){
	    	echo " <a href=\"javascript:changePage(".($page-1).")\">&lt; "._TOPMUSIC_PREVIOUS."</a> ";
        }
      	if($page>0)
      		echo " ". $page." ";
     	else
      		echo " 1 "; 
  		echo " "._TOPMUSIC_OF." ";
        echo " ".(ceil($num/10))." ";
                  
        if($page<ceil($num/10))
          	echo " <a href=\"javascript:changePage(".($page+1).")\"> "._TOPMUSIC_NEXT." &gt;</a> ";

	}
	
}

?>
Return current item: Top Music module