Location: PHPKode > projects > Top Music module > Top Music 3.0.7/html/modules/topMusic/admin/editAlbum.php
<?php
/************************************************************************/
/* Top Music: Administration Module                                     */
/* ================================                                     */
/*                                                                      */
/* Copyright (c) 2004 by SergiDs.com                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
$aid = trim($aid);
$result = mysql_query("select radminsuper from ".$prefix."_authors where aid='$aid'");
list($radminsuper) = mysql_fetch_row($result);
if ($radminsuper==1) {
	
	//require_once("lib/com/sergids/topmusic/view/GenericAdminView.php");
	//require_once("lib/com/sergids/topmusic/model/GenericAdminDAO.php");
?>
<script language="javascript" type="text/javascript">
function changeLang(form){
	form.action='admin.php?op=topmusic&action=editAlbum&idartist=<?=$_GET['idartist']?>&idalbum=<?=$_GET['idalbum']?>&newlang='+form.lang.options[form.lang.selectedIndex].value;
	form.method='post';
	form.submit();
}
function unlinkRelated(id){
	form=document.getElementById('albumEditForm');
	form.unlink.value=id;
	if(confirm('Unlinking this album will also submit the form changes.'))
		form.submit();
}
</script>
	<table cellspacing="0" cellpadding="0" border="0">
	<form name="albumEditForm" id="albumEditForm" method="post" action="admin.php?op=topmusic&action=editAlbum&idartist=<?=$_GET['idartist']?>&idalbum=<?=$_GET['idalbum']?>" enctype="multipart/form-data">
	<input type="hidden" name="actiondel">
	<?php if($message!=""){ ?>
	<tr>
	<td colspan="2"><font color="red"><?=$message?></font></td>
	</tr>
	<?php } ?>
	<tr>
	<td><?=_TOPMUSIC_ARTIST?>:</td>
	<td>
		<?php
			$genericView=new GenericAdminView();
			$genericView->printSelect("artist",$artistList,$artist);
		?>
	</td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td><?=_TOPMUSIC_TITLE?>:</td><td><input type="text" name="title" value="<?=$album->getTitle()?>">&nbsp;&nbsp;<a href="#" onClick="window.open('modules/topMusic/admin/musicmoz_updatealbum.php?artist=<?=$album->getArtistname()?>&album=<?=$album->getTitle()?>','updatefrommusicmoz','width=600,height=600,toolbar=yes,scrollbars=yes')"><?=_TOPMUSIC_UPDATEFROM?> MusicMoz</a></td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<tr>
	<td><?=_TOPMUSIC_DATE?>:</td><td><input type="text" name="yeardate" value="<?=$album->getYeardate()?>"></td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td><?=_TOPMUSIC_GENRE?>:</td><td>
	<?php
	$genericView=new GenericAdminView();
	$genericView->printSelect("genre",$genreList,$album->getGenreid(),"");
	?>
	</td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<?php
	if(count($albumFields)>0){ 
		foreach($albumFields as $field){?>
		<tr>
			<td valign="top"><strong><i><?=$field->description?></i></strong>:</td><td> <?=GenericAdminView::printCustomField($field)?> </td>
		</tr>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
	<?	}
	}?>
	<?php if($configAdmin->upload){ ?>
	<tr>
	<td valign="top"><?=_TOPMUSIC_FRONTCOVER_FILE?>:</td><td>
	<? if($album->frontcover_file){ ?>
		<img src="modules/<?=_TOPMUSIC_MODULENAME?>/photos/albums/<?=$album->frontcover_file?>" width="100" title="<?=$album->getTitle()?>">&nbsp;<input type="button" name="Delete" value="<?=_TOPMUSIC_DELETE?>" onClick="document.getElementById('albumEditForm').actiondel.value='Front';document.getElementById('albumEditForm').submit()"><br>
	<? } ?>
	<input type="file" name="frontcover_file"></td>
	</tr>
	<?php } ?>
	<tr>
	<td valign="top"><?=_TOPMUSIC_FRONTCOVER_URL?>:</td><td><input type="text" name="frontcover_url" value="<?=$album->getFrontcoverUrl()?>">&nbsp;<a href="#top" onClick="javascript:window.open(document.albumEditForm.frontcover_url.value,'CheckCoverURL','width=500,height=400,toolbar=no, scrollbars=yes,titlebar=no, statusbar=no')"><?=_TOPMUSIC_CHECK?></a><img src="modules/topMusic/images/question.gif" hspace="4" align="middle" title="<?=_TOPMUSIC_HELPCOVER?>">  <input type="button" name="getcoverfromamazon" value="Get Cover" onClick="window.open('modules/topMusic/admin/amazon_cover.php?title=<?=urlencode($album->title)?>&artist=<?=urlencode($album->artistname)?>','amazoncovers','scrollbars=yes,width=400,height=400')">
  
  </td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<?php if($configAdmin->upload){ ?>
	<tr>
	<td valign="top"><?=_TOPMUSIC_BACKCOVER_FILE?>:</td><td>
	<? if($album->backcover_file){ ?>
		<img src="modules/<?=_TOPMUSIC_MODULENAME?>/photos/albums/<?=$album->getBackcoverFile()?>" width="100" title="<?=$album->getTitle()?>">&nbsp;<input type="button" name="Delete" value="<?=_TOPMUSIC_DELETE?>" onClick="document.getElementById('albumEditForm').actiondel.value='Back';document.getElementById('albumEditForm').submit()"><br>
	<? } ?>
	<input type="file" name="backcover_file"></td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<?php } ?>
	<tr>
	<td valign="top"><?=_TOPMUSIC_BACKCOVER_URL?>:</td><td><input type="text" name="backcover_url" value="<?=$album->getBackcoverUrl()?>">&nbsp;<a href="#top" onClick="javascript:window.open(document.albumEditForm.backcover_url.value,'CheckCoverURL','width=500,height=400,toolbar=no, scrollbars=yes,titlebar=no, statusbar=no')"><?=_TOPMUSIC_CHECK?></a><img src="modules/topMusic/images/question.gif" hspace="4" align="middle" title="<?=_TOPMUSIC_HELPCOVER?>"></td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td valign="top"><?=_TOPMUSIC_SHOPURL?>:</td><td><input type="text" name="amazonid" value="<?=$album->getShopurl()?>">&nbsp;<a href="#top" onClick="javascript:window.open(document.albumEditForm.amazonid.value,'CheckAmazonURL')"><?=_TOPMUSIC_CHECK?></a><img src="modules/topMusic/images/question.gif" hspace="4" align="middle" title="<?=_TOPMUSIC_HELPAMAZON?>"></td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td valign="top" algin="left"><?=_TOPMUSIC_VIEWS?>:</td><td><input type="text" name="views" size="5" value="<?=$album->getCount()?>"></td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td valign="top"><?=_TOPMUSIC_COMMENTS?> (<?=$currentlang?>):</td><td><textarea name="comments" cols="70" rows="15"><?=$album->getComments()?></textarea>
	<?php
	AdminTopView::printLanguageSelect($languageList,$currentlang,"onChange=\"changeLang(document.albumEditForm);\"");
    ?>
    <img src="modules/topMusic/images/question.gif" hspace="4" align="middle" title="<?=_TOPMUSIC_HELPLANG?>">
    </td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td valign="top"><strong><?=_TOPMUSIC_RELATED_ALBUMS?></strong>:</td>
	<td></td>
	</tr>
	<tr><td></td>
		<td>
		<table>
			<?php
			if(count($relatedList)>0){
				foreach($relatedList as $rel){
					echo "<tr>";
					echo "	<td><a href=\"admin.php?op=topmusic&action=editAlbum&idartist=".$rel->getIdartist()."&idalbum=".$rel->getId()."\">".$rel->getTitle()."</a></td>
							<td><input type=\"button\" name=\"deleteRelated\" value=\""._TOPMUSIC_UNLINK."\" onClick=\"unlinkRelated(".$rel->getId().")\"></td>";
					echo "</tr>";
				}
			}
			?>
		</table>
		</td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
		<td></td>
		<td>1. Select an artist: <?php
	//Initial status
	$relAlbumList[0]="...";
	$genericView=new GenericAdminView();
	$genericView->printSelect("artist_rel",$artistList,"","loadSelect('album','artist_rel','related','albumSelectDiv',true);");?>
	<br>2. Select an album <div id="albumSelectDiv"><?php
	$genericView->printSelect("related",$relAlbumList);
	?></div>&nbsp;<input type="submit" name="addRelated" value="<?=_TOPMUSIC_LINK?>"></td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td>&nbsp;</td><td>
	<input type="hidden" name="unlink">
	<input type="submit" name="submit1" value="<?=_TOPMUSIC_SAVE?>"></td>
	</tr>
	</form>
	</table>
	<?php
} else {
	OpenTable();
    echo "Access Denied";
    CloseTable();
}
?>
Return current item: Top Music module