Location: PHPKode > projects > TVEz - Media Library > tvez-0.2.1/html/movies/views/print_rating.php
<?php

# ------------------------------------------------------------------------------
#
# Print the rating select
#
# ------------------------------------------------------------------------------
#
# Copyright (C) 2003 Christian Eheim and Alex Pachikov
#                                                                               
# This file is part of TVEz (tvez.sourceforge.net).
#                                                                               
# TVEz 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, or
# (at your option) any later version.
#                                                                               
# TVEz is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#                                                                               
# You should have received a copy of the GNU General Public License
# along with TVEz; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#                                                                               
# ------------------------------------------------------------------------------
#
# Created on 02/12/2003 by Christian Eheim (hide@address.com)
#
# LAST MODIFIED:
# $Date: 2004/01/21 23:01:53 $
# $Revision: 1.3 $
# $Author: eheim $
#
# ------------------------------------------------------------------------------

echo '
            <table border="0" valign="bottom" align="right" cellpadding="0" cellspacing="0">
            <tr>
            <td valign="middle" align="right">
				<form method="POST" action="tvez.php">
        ';
		$score = ($movie['votes'] > 0) ? floor(($movie['points']/$movie['votes'])+.5) : 0;
		for ($i=0;$i<$score;$i++)
			echo '<img src="images/icons/ball.red.gif">';
		for ($i=$score;$i<10;$i++)
			echo '<img src="images/icons/ball.gray.gif">';

echo '</td><td valign="middle">';

		$tn = preg_replace("/'/","\'",$movie['title']);
		echo '
		<span class="year">&nbsp;('.$movie["votes"].':'.$movie["points"].')</span>
		';
		if (isset($_SESSION['tvezAccess']) || !$LOGIN_ENABLED) {
			echo '
			<select name="castvote['.$movie['id'].']" onchange="javascript: if( confirm(\''.localize_string("Your vote is being submitted.").' '.localize_string("==1== points for ==2==.", array("'+this.value+'", $tn)).' '.localize_string("Changes will take effect next time you reload the movie info.").'\')) this.form.submit()">
				<option>--</option>
			';
			for ($j=1;$j<11;$j++)
				echo "<option value=\"$j\">$j</option>\n";
			echo "
			</select>
			";
		}

echo "
			</form>
            </td></tr>
            </table>
        ";
?>
Return current item: TVEz - Media Library