Location: PHPKode > projects > Online TV Database > thetvdb/genres.php
	include ('include.php');
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

	<title>Genres Selector</title>
	<link rel=stylesheet href="/pngHack/pngHack.css" type="text/css">
	<link rel="stylesheet" type="text/css" href="/default.css">
	<script type="text/javascript" src="/xfade2.js"></script>
	<script type="text/javascript" src="/niftycube.js"></script>
	<script type="text/javascript">
	<script type="text/javascript">
		function copygenre() {
			var genlist=""
				$query = "SELECT count(*) AS amount FROM genres";
				$result = mysql_query($query) or die('Query failed: ' . mysql_error());
				$max = mysql_fetch_object($result)->amount;
				while ($max != $counter){
					echo "			if (document.genresform.chkgenres[$counter].checked== true){genlist = genlist+\"|\"+document.genresform.chkgenres[$counter].value}\n";
			if (genlist.length>1){genlist = genlist+"|"} 
			if (genlist.length>99){
				alert("You have selected too many genres.")
				opener.document.seriesform.Genre.value = genlist;
				opener.document.seriesform.Genrefake.value = genlist;
			return false;
<table width="95%" cellspacing="0" cellpadding="0" border="0" align="center">
	<div class="titlesection">
		<h3>Please select the genres for <?=$SeriesName?>.</h3>

	<div class="section">

			<form action="#" method="POST" name="genresform" onSubmit="return false">
				<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" id="datatablelist">
				$query = "SELECT * FROM genres";
				$result = mysql_query($query) or die('Query failed: ' . mysql_error());
				$tr = 1;								
				while ($genres = mysql_fetch_object($result)) {
					if ($tr == 1){echo "				<tr>\n";}
					<td><?=$genres->genre?>: </td>
					<td><INPUT TYPE="checkbox" NAME="chkgenres" VALUE="<?=$genres->genre?>" <?if (strstr($Genre,"$genres->genre")){echo "checked";}?>></td>
					if ($tr == 2){echo "				</tr>\n"; $tr = 1;}else{$tr = 2;}
					<td style="text-align: right" colspan="4">
						<input type="submit" name="function" value="Accept" class="submit" onClick="return copygenre()">
Return current item: Online TV Database