Location: PHPKode > projects > Top Music module > Top Music 3.0.7/html/modules/topMusic/admin/editArtist.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");
?>
<script language="javascript" type="text/javascript">
function changeLang(form){
	form.action='admin.php?op=topmusic&action=editArtist&idartist=<?=$_GET['idartist']?>&newlang='+form.lang.options[form.lang.selectedIndex].value;
	form.method='post';
	form.submit();
}
function delItem(idartist){
	if(confirm('<?=_TOPMUSIC_SUREARTIST?>')){
		document.artistEditForm.action='admin.php?op=topmusic&action=delArtist&idartist='+idartist;
		document.artistEditForm.submit();
	}
}
function checkForumURL(url){
	if(isNaN(url))
		window.open(url,'CheckForumURL');
	else
		window.open('modules.php?name=Forums&file=viewforum&f='+url,'CheckForumURL');
}
function unlinkRelated(id){
	form=document.getElementById('artistEditForm');
	form.unlink.value=id;
	if(confirm('Unlinking this artist will also submit the form changes.'))
		form.submit();
}
</script>
	<table cellspacing="0" cellpadding="0" border="0">
	<form name="artistEditForm" id="artistEditForm" method="post" action="admin.php?op=topmusic&action=editArtist&idartist=<?=$_GET['idartist']?>" enctype="multipart/form-data">
	<input type="hidden" name="actiondel" id="actiondel">
	<?php if($message!=""){ ?>
	<tr>
	<td colspan="2"><font color="red"><?=$message?></font></td>
	</tr>
	<?php } ?>
	<tr>
	<td><strong><?=_TOPMUSIC_NAME?></strong>:</td><td><input type="text" name="name" value="<?=$artist->getName()?>">&nbsp;&nbsp;<a href="#" onClick="window.open('modules/topMusic/admin/musicmoz_updateartist.php?artist=<?=$artist->getName()?>','updatefrommusicmoz','width=600,height=600,toolbar=yes,scrollbars=yes')"><?=_TOPMUSIC_UPDATEFROM?> MusicMoz</a></td>
	</tr>
	<tr>
	<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td><strong><?=_TOPMUSIC_BORNYEAR?></strong>:</td><td><input type="text" name="bornyear" value="<?=$artist->getBornYear()?>"></td>
	</tr>
	<tr>
	<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td><strong><?=_TOPMUSIC_DEADYEAR?></strong>:</td><td><input type="text" name="deadyear" value="<?=$artist->getDeadYear()?>"></td>
	</tr>
	<tr>
	<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td><strong><?=_TOPMUSIC_GENRE?></strong>:</td><td>
	<?php
	GenericAdminView::printSelect("genre",$genreList,$artist->getGenreid(),"");
	?>
	</td>
	</tr>
	<tr>
	<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td valign="top"><strong><?=_TOPMUSIC_WEB?></strong>:</td><td><input type="text" name="web" value="<?=$artist->getWeb()?>">&nbsp;<a href="#top" onClick="javascript:window.open(document.artistEditForm.web.value,'CheckWebURL')"><?=_TOPMUSIC_CHECK?></a></td>
	</tr>
	<tr>
	<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td valign="top"><strong><?=_TOPMUSIC_FORUM?></strong>:</td><td><input type="text" name="forum" value="<?=$artist->getForum()?>">&nbsp;<a href="#top" onClick="javascript:checkForumURL(document.artistEditForm.forum.value)"><?=_TOPMUSIC_CHECK?></a><img src="modules/topMusic/images/question.gif" hspace="4" align="middle" title="<?=_TOPMUSIC_HELPFORUM?>"></td>
	</tr>
	<tr>
	<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
	<td valign="top"><strong><?=_TOPMUSIC_PHOTO_URL?></strong>:</td><td><input type="text" name="photo" value="<?=$artist->getPhoto()?>">&nbsp;<a href="#top" onClick="javascript:CheckImageUrl(document.artistEditForm.photo.value);"><?=_TOPMUSIC_CHECK?></a></td>
	</tr>
	<tr>
	<td colspan="2">&nbsp;</td>
	</tr>
	<?php if($configAdmin->upload){ ?>
	<tr>
		<td valign="top"><strong><?=_TOPMUSIC_PHOTO_FILE?></strong>:</td>
		<td><?php if($artist->getPhotoFile()!=""){ ?>
			<img src="modules/<?=_TOPMUSIC_MODULENAME?>/photos/<?=$artist->getPhotoFile()?>" width="100" title="<?=$artist->getName()?>">&nbsp;<input type="button" name="Delete" value="<?=_TOPMUSIC_DELETE?>" onClick="document.getElementById('artistEditForm').actiondel.value='deletePhoto';document.getElementById('artistEditForm').submit()"><br>
			<?php } ?>
	 		 <input type="file" name="photo_upload" value=""/>&nbsp;
		</td>
	</tr>
	<tr>
	<td colspan="2">&nbsp;</td>
	</tr>
	<?php } ?>
	<tr>
	<td valign="top" algin="left"><strong><?=_TOPMUSIC_VIEWS?></strong>:</td><td><input type="text" name="views" size="5" value="<?=$artist->getCount()?>"></td>
	</tr>
	<tr>
	<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
		<td valign="top"><strong><?=_TOPMUSIC_MEMBERS?></strong>:</td><td><textarea name="members" cols="70" rows="8"><?=$artist->getMembers()?></textarea> </td>
	</tr>
	<tr>
	<td colspan="2">&nbsp;</td>
	</tr>
	<?php
		if(count($artistFields)>0){ 
			foreach($artistFields as $field){?>
			<tr>
				<td valign="top"><strong><i><?=$field->description?> (<?=$field->type?>)</i></strong>:</td><td> <?=GenericAdminView::printCustomField($field)?> </td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
	<?		}
		}?>
	<tr>
	<td valign="top"><strong><?=_TOPMUSIC_BIOGRAPHY?> (<?=$currentlang?>):</td><td><textarea name="biography" id="biography" cols="70" rows="15"><?=$artist->biography?></textarea>
	<?php
	GenericAdminView::printSelect("languagesel",$languageList,$currentlang,"onChange=\"changeLang(document.artistEditForm);\"");
    ?>
    <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_ARTISTS?></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=editArtist&idartist=".$rel->getId()."\">".$rel->getName()."</a></td>
							<td><input type=\"button\" name=\"deleteRelated\" value=\""._TOPMUSIC_UNLINK."\" onClick=\"unlinkRelated(".$rel->getId().")\"></td>";
					echo "</tr>";
					
				}
			}
			?>
		</table>
		</td>
	</tr>
	<tr>
		<td></td>
		<td><?php
			$genericView=new GenericAdminView();
			$genericView->printSelect("related",$artistList);
			?>&nbsp;<input type="submit" name="addRelated" value="<?=_TOPMUSIC_LINK?>"></td>
	</tr>
	<tr>
	<td>&nbsp;</td><td>
	<input type="hidden" name="unlink">
	<input type="submit" name="submit1" value="<?=_TOPMUSIC_SAVE?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" name="button" value="<?=_TOPMUSIC_DELETE?>" onclick="delItem(<?=$_GET['idartist']?>)"></td>
	</tr>
	</form>
	</table>
	<?php
} else {
	OpenTable();
    echo "Access Denied";
    CloseTable();
}
?>
Return current item: Top Music module