Location: PHPKode > projects > phpMUR Multi User Randomizer > tpl/andreas02/playlist.tpl.php
<?php
	$_SESSION['open_tab'] = 'Playlist';

	if (is_admin()) {
		ob_start();
		?>
		<script type="text/javascript"><!--
		<?php
			$sh = ob_get_clean();
			ob_start();
			?>
			genres = {};
			genres.open = function (fid, gid) {
				var db_genres = new Array();
				<?php
					$genres = $db->get_results_assoc("SELECT gid, genre FROM genres ORDER BY genre",'gid');
					foreach ($genres as $gid=>$g) {
						?>db_genres[<?php echo $gid; ?>]='<?php eent($g['genre']) ?>';<?php
					}
				?>
				var content = "<select onChange='document.getElementById(\"genre["+fid+"]\").value=this.options[this.options.selectedIndex].value'>";
				for (i in db_genres) {
					if (typeof(db_genres[i]) == "string") {
						content += "<option value='"+db_genres[i]+"'";
						if (i == gid) {
							content += " selected";
						}
						content += ">"+db_genres[i]+"</option>";
					}
				}
				content += "</select>";
				document.getElementById("genre_select["+fid+"]").innerHTML = content;
			};
			genres.save = function (fid, gid) {

			};
			<?php
			$script = ob_get_clean();
			ob_start();
		?>
		//-->
		</script>
		<?php
		$sf = ob_get_clean();
		global $objResponse;
		if ($objResponse) {
			$objResponse->script($script);
		} else {
			echo $sh.$script.$sf;
		}
	}
?>
<div id="playlist" ><?php inc('playlist.contents.tpl.php', $args); ?></div>
Return current item: phpMUR Multi User Randomizer