Location: PHPKode > projects > phpMUR Multi User Randomizer > tpl/andreas02/cd_genres.tpl.php
<?php
	if (!isset($_SESSION['opened_tab']['cd_genres'])) {
		?><a onClick="xajax_open_tab('cd_genres',true,'cd_genres.tpl.php','cd_genres');" style="cursor:pointer;">+ Pick From These Genres</a><?php
		return;
	}
?>
<h3><a onClick="xajax_open_tab('cd_genres',false,'cd_genres.tpl.php','cd_genres');" style="cursor:pointer;">-Pick From These Genres</a></h3><?php
	global $db;
	$genres = $db->get_results_assoc("SELECT *, COUNT(f.gid) AS total FROM genres g, files f WHERE f.gid = g.gid GROUP BY f.gid ORDER BY genre",'gid');
	$cols = 2;
	$rows = array_chunk($genres,ceil(count($genres) / $cols), true);
	?><table><?php
	?><tr><?php
	foreach ($rows as $r) {
		?><td valign="top"><?php
		//genre_on_cd($gid, $state)
		foreach ($r as $gid=>$g) {
			echo $html->checkbox(
				array(
					'onClick' => "xajax_genre_on_cd($gid,this.checked)",
					'id' => 'gcid['.$gid.']'
				),
				$g['pick_from_for_cd'],
				$g['genre'],
				$label = true,
				$orient = 'left'),' ('.$g['total'].')<br />';

		}
		?></td><?php
	}
	?></tr><?php
	?></table><?php

?>
Return current item: phpMUR Multi User Randomizer